All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] staging: unisys: common headers cleanup
@ 2014-08-05 18:57 Benjamin Romer
  2014-08-05 18:57 ` [PATCH 01/14] staging: unisys: get rid of unused VMMIO types Benjamin Romer
                   ` (13 more replies)
  0 siblings, 14 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

This patch series removes unused macros, replaces redundant macros, fixes
spacing and other formatting issues, and eliminates checkpatch warnings from
the header files in the include and common-spar directories, other than
volatile and new typedef warnings.

The volatile warnings will be addressed in a future patchset. The remaining
typedefs in the headers are all for enumerations or structures specific to
s-Par. 

Benjamin Romer (14):
  staging: unisys: get rid of unused VMMIO types
  staging: unisys: fix formatting in timskmod.h
  staging: unisys: get rid of semaphore macros
  staging: unisys: remove unused macros from timskmod.h
  staging: unisys: get rid of uiscmpxchg64
  staging: unisys: fix whitespace in uisutils.h
  staging: unisys: fix line lengths in controlvmcompletionstatus.h
  staging: unisys: fix spacing in iovmcall_gnuc.h
  staging: unisys: clean up vmcall functions
  staging: unisys: fix spacing in vbusdeviceinfo.h
  staging: unisys: remove do{} while(0) in macros in channel.h
  staging: unisys: fix spacing in channel.h
  staging: unisys: clean up comments in controlvmchannel.h message
    packet
  staging: unisys: fix macros in iochannel.h

 .../unisys/common-spar/include/channels/channel.h  | 14 +++---
 .../include/channels/controlvmchannel.h            | 41 +++++++++++-----
 .../common-spar/include/channels/iochannel.h       | 18 ++++----
 .../include/controlvmcompletionstatus.h            | 16 ++++---
 .../unisys/common-spar/include/iovmcall_gnuc.h     | 30 ++++++------
 .../unisys/common-spar/include/vbusdeviceinfo.h    |  1 +
 drivers/staging/unisys/include/timskmod.h          | 54 +---------------------
 drivers/staging/unisys/include/uisqueue.h          | 15 ------
 drivers/staging/unisys/include/uisutils.h          |  2 +
 drivers/staging/unisys/uislib/uislib.c             | 16 +++----
 drivers/staging/unisys/uislib/uisqueue.c           |  6 +--
 .../unisys/visorchipset/visorchipset_main.c        | 16 +++----
 12 files changed, 91 insertions(+), 138 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 01/14] staging: unisys: get rid of unused VMMIO types
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 02/14] staging: unisys: fix formatting in timskmod.h Benjamin Romer
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Delete the unused common VMMIO types in timskmod.h.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/timskmod.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index ecf1a6f..b20fc9d 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -71,17 +71,6 @@
 #define HOSTADDRESS unsigned long long
 #endif
 
-typedef long VMMIO;  /**< Virtual MMIO address (returned from ioremap), which
-    *   is a virtual address pointer to a memory-mapped region.
-    *   These are declared as "long" instead of u32* to force you to
-    *   use readb()/writeb()/memcpy_fromio()/etc to access them.
-    *   (On x86 we could probably get away with treating them as
-    *   pointers.)
-    */
-typedef long VMMIO8; /**< #VMMIO pointing to  8-bit data */
-typedef long VMMIO16;/**< #VMMIO pointing to 16-bit data */
-typedef long VMMIO32;/**< #VMMIO pointing to 32-bit data */
-
 #define LOCKSEM(sem)                   down_interruptible(sem)
 #define LOCKSEM_UNINTERRUPTIBLE(sem)   down(sem)
 #define UNLOCKSEM(sem)                 up(sem)
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 02/14] staging: unisys: fix formatting in timskmod.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
  2014-08-05 18:57 ` [PATCH 01/14] staging: unisys: get rid of unused VMMIO types Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 03/14] staging: unisys: get rid of semaphore macros Benjamin Romer
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Fix all whitespace formatting issues in timskmod.h.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/timskmod.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index b20fc9d..59144ba 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -293,6 +293,7 @@ static inline struct cdev *cdev_alloc_init(struct module *owner,
 					   const struct file_operations *fops)
 {
 	struct cdev *cdev = NULL;
+
 	cdev = cdev_alloc();
 	if (!cdev)
 		return NULL;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 03/14] staging: unisys: get rid of semaphore macros
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
  2014-08-05 18:57 ` [PATCH 01/14] staging: unisys: get rid of unused VMMIO types Benjamin Romer
  2014-08-05 18:57 ` [PATCH 02/14] staging: unisys: fix formatting in timskmod.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 04/14] staging: unisys: remove unused macros from timskmod.h Benjamin Romer
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Remove all of the semaphore macros from timskmod.h and switch all uses of those
types to the correct function names.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/timskmod.h          | 28 ----------------------
 drivers/staging/unisys/uislib/uislib.c             | 16 ++++++-------
 .../unisys/visorchipset/visorchipset_main.c        | 16 ++++++-------
 3 files changed, 16 insertions(+), 44 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index 59144ba..8e0ae45 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -71,34 +71,6 @@
 #define HOSTADDRESS unsigned long long
 #endif
 
-#define LOCKSEM(sem)                   down_interruptible(sem)
-#define LOCKSEM_UNINTERRUPTIBLE(sem)   down(sem)
-#define UNLOCKSEM(sem)                 up(sem)
-
-/** lock read/write semaphore for reading.
-    Note that all read/write semaphores are of the "uninterruptible" variety.
-    @param sem (rw_semaphore *) points to semaphore to lock
- */
-#define LOCKREADSEM(sem)               down_read(sem)
-
-/** unlock read/write semaphore for reading.
-    Note that all read/write semaphores are of the "uninterruptible" variety.
-    @param sem (rw_semaphore *) points to semaphore to unlock
- */
-#define UNLOCKREADSEM(sem)             up_read(sem)
-
-/** lock read/write semaphore for writing.
-    Note that all read/write semaphores are of the "uninterruptible" variety.
-    @param sem (rw_semaphore *) points to semaphore to lock
- */
-#define LOCKWRITESEM(sem)              down_write(sem)
-
-/** unlock read/write semaphore for writing.
-    Note that all read/write semaphores are of the "uninterruptible" variety.
-    @param sem (rw_semaphore *) points to semaphore to unlock
- */
-#define UNLOCKWRITESEM(sem)            up_write(sem)
-
 #ifdef ENABLE_RETURN_TRACE
 #define RETTRACE(x)                                            \
 	do {						       \
diff --git a/drivers/staging/unisys/uislib/uislib.c b/drivers/staging/unisys/uislib/uislib.c
index a3a96ad..4cb3487 100644
--- a/drivers/staging/unisys/uislib/uislib.c
+++ b/drivers/staging/unisys/uislib/uislib.c
@@ -1362,18 +1362,18 @@ Process_Incoming(void *v)
 		struct device_info *dev = NULL;
 
 		/* poll each channel for input */
-		LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels);
+		down(&Lock_Polling_Device_Channels);
 		new_tail = NULL;
 		list_for_each_safe(lelt, tmp, &List_Polling_Device_Channels) {
 			int rc = 0;
 			dev = list_entry(lelt, struct device_info,
 					 list_polling_device_channels);
-			LOCKSEM_UNINTERRUPTIBLE(&dev->interrupt_callback_lock);
+			down(&dev->interrupt_callback_lock);
 			if (dev->interrupt)
 				rc = dev->interrupt(dev->interrupt_context);
 			else
 				continue;
-			UNLOCKSEM(&dev->interrupt_callback_lock);
+			up(&dev->interrupt_callback_lock);
 			if (rc) {
 				/* dev->interrupt returned, but there
 				* is still more work to do.
@@ -1400,7 +1400,7 @@ Process_Incoming(void *v)
 			tot_moved_to_tail_cnt++;
 			list_move_tail(new_tail, &List_Polling_Device_Channels);
 		}
-		UNLOCKSEM(&Lock_Polling_Device_Channels);
+		up(&Lock_Polling_Device_Channels);
 		cur_cycles = get_cycles();
 		delta_cycles = cur_cycles - old_cycles;
 		old_cycles = cur_cycles;
@@ -1470,14 +1470,14 @@ uislib_enable_channel_interrupts(u32 busNo, u32 devNo,
 		       (int) (devNo));
 		return;
 	}
-	LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels);
+	down(&Lock_Polling_Device_Channels);
 	Initialize_incoming_thread();
 	dev->interrupt = interrupt;
 	dev->interrupt_context = interrupt_context;
 	dev->polling = TRUE;
 	list_add_tail(&(dev->list_polling_device_channels),
 		      &List_Polling_Device_Channels);
-	UNLOCKSEM(&Lock_Polling_Device_Channels);
+	up(&Lock_Polling_Device_Channels);
 }
 EXPORT_SYMBOL_GPL(uislib_enable_channel_interrupts);
 
@@ -1494,11 +1494,11 @@ uislib_disable_channel_interrupts(u32 busNo, u32 devNo)
 		       (int) (devNo));
 		return;
 	}
-	LOCKSEM_UNINTERRUPTIBLE(&Lock_Polling_Device_Channels);
+	down(&Lock_Polling_Device_Channels);
 	list_del(&dev->list_polling_device_channels);
 	dev->polling = FALSE;
 	dev->interrupt = NULL;
-	UNLOCKSEM(&Lock_Polling_Device_Channels);
+	up(&Lock_Polling_Device_Channels);
 }
 EXPORT_SYMBOL_GPL(uislib_disable_channel_interrupts);
 
diff --git a/drivers/staging/unisys/visorchipset/visorchipset_main.c b/drivers/staging/unisys/visorchipset/visorchipset_main.c
index fe3c012..e860512 100644
--- a/drivers/staging/unisys/visorchipset/visorchipset_main.c
+++ b/drivers/staging/unisys/visorchipset/visorchipset_main.c
@@ -594,7 +594,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 				    VISORCHIPSET_BUSDEV_RESPONDERS *responders,
 				    ULTRA_VBUS_DEVICEINFO *driverInfo)
 {
-	LOCKSEM_UNINTERRUPTIBLE(&NotifierLock);
+	down(&NotifierLock);
 	if (notifiers == NULL) {
 		memset(&BusDev_Server_Notifiers, 0,
 		       sizeof(BusDev_Server_Notifiers));
@@ -609,7 +609,7 @@ visorchipset_register_busdev_server(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 		BusDeviceInfo_Init(driverInfo, "chipset", "visorchipset",
 				   VERSION, NULL);
 
-	UNLOCKSEM(&NotifierLock);
+	up(&NotifierLock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_server);
 
@@ -618,7 +618,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 				    VISORCHIPSET_BUSDEV_RESPONDERS *responders,
 				    ULTRA_VBUS_DEVICEINFO *driverInfo)
 {
-	LOCKSEM_UNINTERRUPTIBLE(&NotifierLock);
+	down(&NotifierLock);
 	if (notifiers == NULL) {
 		memset(&BusDev_Client_Notifiers, 0,
 		       sizeof(BusDev_Client_Notifiers));
@@ -632,7 +632,7 @@ visorchipset_register_busdev_client(VISORCHIPSET_BUSDEV_NOTIFIERS *notifiers,
 	if (driverInfo)
 		BusDeviceInfo_Init(driverInfo, "chipset(bolts)", "visorchipset",
 				   VERSION, NULL);
-	UNLOCKSEM(&NotifierLock);
+	up(&NotifierLock);
 }
 EXPORT_SYMBOL_GPL(visorchipset_register_busdev_client);
 
@@ -944,7 +944,7 @@ bus_epilog(u32 busNo,
 	} else
 		pBusInfo->pendingMsgHdr.Id = CONTROLVM_INVALID;
 
-	LOCKSEM_UNINTERRUPTIBLE(&NotifierLock);
+	down(&NotifierLock);
 	if (response == CONTROLVM_RESP_SUCCESS) {
 		switch (cmd) {
 		case CONTROLVM_BUS_CREATE:
@@ -989,7 +989,7 @@ bus_epilog(u32 busNo,
 		;
 	else
 		bus_responder(cmd, busNo, response);
-	UNLOCKSEM(&NotifierLock);
+	up(&NotifierLock);
 }
 
 static void
@@ -1021,7 +1021,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd,
 	} else
 		pDevInfo->pendingMsgHdr.Id = CONTROLVM_INVALID;
 
-	LOCKSEM_UNINTERRUPTIBLE(&NotifierLock);
+	down(&NotifierLock);
 	if (response >= 0) {
 		switch (cmd) {
 		case CONTROLVM_DEVICE_CREATE:
@@ -1087,7 +1087,7 @@ device_epilog(u32 busNo, u32 devNo, ULTRA_SEGMENT_STATE state, u32 cmd,
 		;
 	else
 		device_responder(cmd, busNo, devNo, response);
-	UNLOCKSEM(&NotifierLock);
+	up(&NotifierLock);
 }
 
 static void
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 04/14] staging: unisys: remove unused macros from timskmod.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (2 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 03/14] staging: unisys: get rid of semaphore macros Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 05/14] staging: unisys: get rid of uiscmpxchg64 Benjamin Romer
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Several macros in timskmod.h are unused. Remove them.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/timskmod.h | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/staging/unisys/include/timskmod.h b/drivers/staging/unisys/include/timskmod.h
index 8e0ae45..e5e4ecd 100644
--- a/drivers/staging/unisys/include/timskmod.h
+++ b/drivers/staging/unisys/include/timskmod.h
@@ -62,8 +62,6 @@
 #if !defined SUCCESS
 #define SUCCESS 0
 #endif
-#define FAILURE (-1)
-#define DRIVERNAMEMAX 50
 #define MIN(a, b)     (((a) < (b)) ? (a) : (b))
 #define MAX(a, b)     (((a) > (b)) ? (a) : (b))
 #define STRUCTSEQUAL(x, y) (memcmp(&x, &y, sizeof(x)) == 0)
@@ -71,18 +69,6 @@
 #define HOSTADDRESS unsigned long long
 #endif
 
-#ifdef ENABLE_RETURN_TRACE
-#define RETTRACE(x)                                            \
-	do {						       \
-		if (1) {				       \
-			INFODRV("RET 0x%lx in %s",	       \
-				(ulong)(x), __func__);     \
-		}					   \
-	} while (0)
-#else
-#define RETTRACE(x)
-#endif
-
 /** Try to evaulate the provided expression, and do a RETINT(x) iff
  *  the expression evaluates to < 0.
  *  @param x the expression to try
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 05/14] staging: unisys: get rid of uiscmpxchg64
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (3 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 04/14] staging: unisys: remove unused macros from timskmod.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 06/14] staging: unisys: fix whitespace in uisutils.h Benjamin Romer
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Remove the uiscmpxchg64 macro from uisqueue.h and uisqueue.c.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/uisqueue.h | 15 ---------------
 drivers/staging/unisys/uislib/uisqueue.c  |  6 ++----
 2 files changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h
index a2abfa8..8983407 100644
--- a/drivers/staging/unisys/include/uisqueue.h
+++ b/drivers/staging/unisys/include/uisqueue.h
@@ -423,19 +423,4 @@ struct guest_msgs {
 
 };
 
-#ifndef __xg
-#define __xg(x) ((volatile long *)(x))
-#endif
-
-/*
-*  Below code is a copy of Linux kernel's cmpxchg function located at
-*  this place
-*  http://tcsxeon:8080/source/xref/00trunk-AppOS-linux/include/asm-x86/cmpxchg_64.h#84
-*  Reason for creating our own version of cmpxchg along with
-*  UISLIB_LOCK_PREFIX is to make the operation atomic even for non SMP
-*  guests.
-*/
-
-#define uislibcmpxchg64(p, o, n, s) cmpxchg(p, o, n)
-
 #endif				/* __UISQUEUE_H__ */
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
index 84eafca..f52bca1 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -43,8 +43,7 @@ uisqueue_InterlockedOr(unsigned long long __iomem *Target,
 	j = readq(Target);
 	do {
 		i = j;
-		j = uislibcmpxchg64((__force unsigned long long *)Target,
-				    i, i | Set, sizeof(*(Target)));
+		j = cmpxchg((__force unsigned long long *)Target, i, i | Set);
 
 	} while (i != j);
 
@@ -62,8 +61,7 @@ uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
 	j = readq(Target);
 	do {
 		i = j;
-		j = uislibcmpxchg64((__force unsigned long long *)Target,
-				    i, i & Set, sizeof(*(Target)));
+		j = cmpxchg((__force unsigned long long *)Target, i, i & Set);
 
 	} while (i != j);
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 06/14] staging: unisys: fix whitespace in uisutils.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (4 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 05/14] staging: unisys: get rid of uiscmpxchg64 Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 07/14] staging: unisys: fix line lengths in controlvmcompletionstatus.h Benjamin Romer
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Correct a couple of missing blank lines in uisutils.h.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/include/uisutils.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/unisys/include/uisutils.h b/drivers/staging/unisys/include/uisutils.h
index a1c193c..f1a1b0d 100644
--- a/drivers/staging/unisys/include/uisutils.h
+++ b/drivers/staging/unisys/include/uisutils.h
@@ -84,6 +84,7 @@ static inline void __iomem *
 dbg_ioremap_cache(u64 addr, unsigned long size, char *file, int line)
 {
 	void __iomem *new;
+
 	new = ioremap_cache(addr, size);
 	return new;
 }
@@ -94,6 +95,7 @@ static inline void *
 dbg_ioremap(u64 addr, unsigned long size, char *file, int line)
 {
 	void *new;
+
 	new = ioremap(addr, size);
 	return new;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 07/14] staging: unisys: fix line lengths in controlvmcompletionstatus.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (5 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 06/14] staging: unisys: fix whitespace in uisutils.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 08/14] staging: unisys: fix spacing in iovmcall_gnuc.h Benjamin Romer
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

The controlVM status file had comments going over the 80 character limit. These
are moved to the next line and the spacing is fixed.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../common-spar/include/controlvmcompletionstatus.h      | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/controlvmcompletionstatus.h b/drivers/staging/unisys/common-spar/include/controlvmcompletionstatus.h
index db77d6f..f74f5d8 100644
--- a/drivers/staging/unisys/common-spar/include/controlvmcompletionstatus.h
+++ b/drivers/staging/unisys/common-spar/include/controlvmcompletionstatus.h
@@ -62,14 +62,16 @@
 							 * DEVICE_CREATE,
 							 * DEVICE_DESTROY */
 /* Unable to invoke VIRTPCI callback */
-#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR 605 /* BUS_CREATE,
-								* BUS_DESTROY,
-								* DEVICE_CREATE,
-								* DEVICE_DESTROY */
+#define CONTROLVM_RESP_ERROR_VIRTPCI_DRIVER_CALLBACK_ERROR 605
+							/* BUS_CREATE,
+							 * BUS_DESTROY,
+							 * DEVICE_CREATE,
+							 * DEVICE_DESTROY */
 /* VIRTPCI Callback returned error */
-#define CONTROLVM_RESP_ERROR_GENERIC_DRIVER_CALLBACK_ERROR 606 /* SWITCH_ATTACHEXTPORT,
-								* SWITCH_DETACHEXTPORT
-								* DEVICE_CONFIGURE */
+#define CONTROLVM_RESP_ERROR_GENERIC_DRIVER_CALLBACK_ERROR 606
+							/* SWITCH_ATTACHEXTPORT,
+							 * SWITCH_DETACHEXTPORT
+							 * DEVICE_CONFIGURE */
 
 /* generic device callback returned error */
 /* Bus Related------------------------------------------------------[700-799] */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 08/14] staging: unisys: fix spacing in iovmcall_gnuc.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (6 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 07/14] staging: unisys: fix line lengths in controlvmcompletionstatus.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 09/14] staging: unisys: clean up vmcall functions Benjamin Romer
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

There are spacing errors in the functions in iovmcall_gnuc. Fix these.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
index fe9598c..55437f7 100644
--- a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
+++ b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
@@ -19,8 +19,8 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
 		     unsigned long reg_ecx)
 {
 	unsigned long result = 0;
-
 	unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
 	cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
 	if (cpuid_ecx & 0x80000000) {
 	      __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
@@ -39,8 +39,8 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
 			      unsigned long long reg_edx)
 {
 	unsigned long result = 0;
-
 	unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
+
 	cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
 	if (cpuid_ecx & 0x80000000) {
 	      __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 09/14] staging: unisys: clean up vmcall functions
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (7 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 08/14] staging: unisys: fix spacing in iovmcall_gnuc.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 10/14] staging: unisys: fix spacing in vbusdeviceinfo.h Benjamin Romer
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

Clean up the format of the vmcall functions in iovmcall_gnuc.h. These functions
are rewritten for clarity and to correct the indention, without changing any
functionality.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/common-spar/include/iovmcall_gnuc.h     | 26 +++++++++-------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
index 55437f7..57dd93e 100644
--- a/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
+++ b/drivers/staging/unisys/common-spar/include/iovmcall_gnuc.h
@@ -22,13 +22,11 @@ __unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
 	unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
 
 	cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
-	if (cpuid_ecx & 0x80000000) {
-	      __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
-				   "a"(tuple), "b"(reg_ebx), "c"(reg_ecx)
-				      );
-	} else {
-		result = -1;
-	}
+	if (!(cpuid_ecx & 0x80000000))
+		return -1;
+
+	__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
+		"a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
 	return result;
 }
 
@@ -42,12 +40,10 @@ __unisys_extended_vmcall_gnuc(unsigned long long tuple,
 	unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
 
 	cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
-	if (cpuid_ecx & 0x80000000) {
-	      __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
-				   "a"(tuple), "b"(reg_ebx), "c"(reg_ecx),
-				   "d"(reg_edx));
-	} else {
-		result = -1;
-	}
+	if (!(cpuid_ecx & 0x80000000))
+		return -1;
+
+	__asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
+		"a"(tuple), "b"(reg_ebx), "c"(reg_ecx), "d"(reg_edx));
 	return result;
-	}
+}
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 10/14] staging: unisys: fix spacing in vbusdeviceinfo.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (8 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 09/14] staging: unisys: clean up vmcall functions Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h Benjamin Romer
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

There was a missing line between declarations and code in vbusdeviceinfo.h.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
index 54593c1..3bbdc2b 100644
--- a/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
+++ b/drivers/staging/unisys/common-spar/include/vbusdeviceinfo.h
@@ -54,6 +54,7 @@ vbuschannel_sanitize_buffer(char *p, int remain, char *src, int srcmax)
 {
 	int chars = 0;
 	int nonprintable_streak = 0;
+
 	while (srcmax > 0) {
 		if ((*src >= ' ') && (*src < 0x7f)) {
 			if (nonprintable_streak) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (9 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 10/14] staging: unisys: fix spacing in vbusdeviceinfo.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-06  8:18   ` Dan Carpenter
  2014-08-05 18:57 ` [PATCH 12/14] staging: unisys: fix spacing " Benjamin Romer
                   ` (2 subsequent siblings)
  13 siblings, 1 reply; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

The CHANNEL_*_MISMATCH error message macros should not be inside of do blocks.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../staging/unisys/common-spar/include/channels/channel.h    | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h
index 2004cfe..c9f0427 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -52,30 +52,30 @@
 
 #define CHANNEL_GUID_MISMATCH(chType, chName, field, expected, actual, fil, \
 			      lin, logCtx)				\
-	do {								\
+	{								\
 		pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=%pUL actual=%pUL @%s:%d\n", \
 		       chName, &chType, field,	\
 		       &expected, &actual, \
 		       fil, lin);					\
-	} while (0)
+	}
 #define CHANNEL_U32_MISMATCH(chType, chName, field, expected, actual, fil, \
 			     lin, logCtx)				\
-	do {								\
+	{								\
 		pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=0x%-8.8lx actual=0x%-8.8lx @%s:%d\n", \
 		       chName, &chType, field,	\
 		       (unsigned long)expected, (unsigned long)actual,	\
 		       fil, lin);					\
-	} while (0)
+	}
 
 #define CHANNEL_U64_MISMATCH(chType, chName, field, expected, actual, fil, \
 			     lin, logCtx)				\
-	do {								\
+	{								\
 		pr_err("Channel mismatch on channel=%s(%pUL) field=%s expected=0x%-8.8Lx actual=0x%-8.8Lx @%s:%d\n", \
 		       chName, &chType, field,	\
 		       (unsigned long long)expected,			\
 		       (unsigned long long)actual,			\
 		       fil, lin);					\
-	} while (0)
+	}
 
 #define UltraLogEvent(logCtx, EventId, Severity, SubsystemMask, pFunctionName, \
 		      LineNumber, Str, args...)				\
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 12/14] staging: unisys: fix spacing in channel.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (10 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 13/14] staging: unisys: clean up comments in controlvmchannel.h message packet Benjamin Romer
  2014-08-05 18:57 ` [PATCH 14/14] staging: unisys: fix macros in iochannel.h Benjamin Romer
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Two functions were missing space between declarations and code.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 drivers/staging/unisys/common-spar/include/channels/channel.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/unisys/common-spar/include/channels/channel.h b/drivers/staging/unisys/common-spar/include/channels/channel.h
index c9f0427..982939a 100644
--- a/drivers/staging/unisys/common-spar/include/channels/channel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/channel.h
@@ -430,6 +430,7 @@ PathName_Last_N_Nodes(u8 *s, unsigned int n)
 {
 	u8 *p = s;
 	unsigned int node_count = 0;
+
 	while (*p != '\0') {
 		if ((*p == '/') || (*p == '\\'))
 			node_count++;
@@ -573,6 +574,7 @@ ULTRA_channel_client_release_os(void __iomem *pChannel, u8 *chanId,
 				void *logCtx, char *file, int line, char *func)
 {
 	CHANNEL_HEADER __iomem *pChan = pChannel;
+
 	if (readb(&pChan->CliErrorOS) != 0) {
 		/* we are in an error msg throttling state; come out of it */
 		UltraLogEvent(logCtx, CHANNELSTATE_DIAG_EVENTID_TRANSITOK,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 13/14] staging: unisys: clean up comments in controlvmchannel.h message packet
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (11 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 12/14] staging: unisys: fix spacing " Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-05 18:57 ` [PATCH 14/14] staging: unisys: fix macros in iochannel.h Benjamin Romer
  13 siblings, 0 replies; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: driverdev-devel, sparmaintainer, Benjamin Romer

The comments for the large union CONTROLVM_MESSAGE_PACKET were inconsistently
placed and one extended past the 80 char limit. These are cleaned up.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../include/channels/controlvmchannel.h            | 41 ++++++++++++++++------
 1 file changed, 30 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
index d08c198..9028bea 100644
--- a/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/controlvmchannel.h
@@ -322,8 +322,9 @@ typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE  {
 /* This is the format for a message in any ControlVm queue. */
 typedef struct _CONTROLVM_MESSAGE_PACKET  {
 	union  {
-
 		/* BEGIN Request messages */
+
+		/* for CONTROLVM_BUS_CREATE */
 		struct  {
 			u32 busNo;	      /*< bus # (0..n-1) from the msg
 					       * receiver's perspective */
@@ -339,14 +340,18 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 			uuid_le busDataTypeGuid;/*< indicates format of data in
 						    bus channel */
 			uuid_le busInstGuid;    /*< instance guid for the bus */
-		} createBus;	/* for CONTROLVM_BUS_CREATE */
+		} createBus;
+
+		/* for CONTROLVM_BUS_DESTROY */
 		struct  {
 			u32 busNo;	      /*< bus # (0..n-1) from the msg
 					       * receiver's perspective */
 
 	    /* Control uses header SegmentIndex field to access bus number... */
 			u32 reserved;	/* Natural alignment purposes */
-		} destroyBus;	/* for CONTROLVM_BUS_DESTROY */
+		} destroyBus;
+
+		/* for CONTROLVM_BUS_CONFIGURE */
 		struct  {
 			u32 busNo;		    /*< bus # (0..n-1) from the
 						     * msg receiver's
@@ -365,10 +370,12 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 					 *   corresponding
 					 *   sendBusInterruptHandle is kept in
 					 *   CP. */
-		} configureBus;	/* for CONTROLVM_BUS_CONFIGURE */
+		} configureBus;
 
 		/* for CONTROLVM_DEVICE_CREATE */
 		CONTROLVM_PACKET_DEVICE_CREATE createDevice;
+
+		/* for CONTROLVM_DEVICE_DESTROY */
 		struct  {
 			u32 busNo;	      /*< bus # (0..n-1) from the msg
 					       * receiver's perspective */
@@ -376,10 +383,12 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 	    /* Control uses header SegmentIndex field to access bus number... */
 			u32 devNo;	      /*< bus-relative (0..n-1) device
 					       * number */
-		} destroyDevice;	/* for CONTROLVM_DEVICE_DESTROY */
+		} destroyDevice;
 
 		/* for CONTROLVM_DEVICE_CONFIGURE */
 		CONTROLVM_PACKET_DEVICE_CONFIGURE configureDevice;
+
+		/* for CONTROLVM_DEVICE_RECONFIGURE */
 		struct  {
 			u32 busNo;	      /*< bus # (0..n-1) from the msg
 					       * receiver's perspective */
@@ -387,12 +396,16 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 	    /* Control uses header SegmentIndex field to access bus number... */
 			u32 devNo;	      /*< bus-relative (0..n-1) device
 					       * number */
-		} reconfigureDevice;	/* for CONTROLVM_DEVICE_RECONFIGURE */
+		} reconfigureDevice;
+
+		/* for CONTROLVM_BUS_CHANGESTATE */
 		struct  {
 			u32 busNo;
 			ULTRA_SEGMENT_STATE state;
 			u8 reserved[2];	/* Natural alignment purposes */
-		} busChangeState;	/* for CONTROLVM_BUS_CHANGESTATE */
+		} busChangeState;
+
+		/* for CONTROLVM_DEVICE_CHANGESTATE */
 		struct  {
 			u32 busNo;
 			u32 devNo;
@@ -403,13 +416,17 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 			/* remaining bits in this 32-bit word are available */
 			} flags;
 			u8 reserved[2];	/* Natural alignment purposes */
-		} deviceChangeState;	/* for CONTROLVM_DEVICE_CHANGESTATE */
+		} deviceChangeState;
+
+		/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
 		struct  {
 			u32 busNo;
 			u32 devNo;
 			ULTRA_SEGMENT_STATE state;
 			u8 reserved[6];	/* Natural alignment purposes */
-		} deviceChangeStateEvent; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
+		} deviceChangeStateEvent;
+
+		/* for CONTROLVM_CHIPSET_INIT */
 		struct  {
 			u32 busCount; /*< indicates the max number of busses */
 			u32 switchCount; /*< indicates the max number of
@@ -417,11 +434,13 @@ typedef struct _CONTROLVM_MESSAGE_PACKET  {
 					  *   partition only) */
 			ULTRA_CHIPSET_FEATURE features;
 			u32 platformNumber;	/* Platform Number */
-		} initChipset;	/* for CONTROLVM_CHIPSET_INIT */
+		} initChipset;
+
+		/* for CONTROLVM_CHIPSET_SELFTEST */
 		struct  {
 			u32 Options; /*< reserved */
 			u32 Test;    /*< bit 0 set to run embedded selftest */
-		} chipsetSelftest;	/* for CONTROLVM_CHIPSET_SELFTEST */
+		} chipsetSelftest;
 
 		    /* END Request messages */
 
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 14/14] staging: unisys: fix macros in iochannel.h
  2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
                   ` (12 preceding siblings ...)
  2014-08-05 18:57 ` [PATCH 13/14] staging: unisys: clean up comments in controlvmchannel.h message packet Benjamin Romer
@ 2014-08-05 18:57 ` Benjamin Romer
  2014-08-06  8:24   ` Dan Carpenter
  13 siblings, 1 reply; 19+ messages in thread
From: Benjamin Romer @ 2014-08-05 18:57 UTC (permalink / raw)
  To: gregkh; +Cc: jkc, driverdev-devel, sparmaintainer, Benjamin Romer

Remove the do blocks around several macros and fix spacing and trailing
semicolons.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
---
 .../unisys/common-spar/include/channels/iochannel.h    | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/unisys/common-spar/include/channels/iochannel.h b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
index ed66c27..a0c20e3 100644
--- a/drivers/staging/unisys/common-spar/include/channels/iochannel.h
+++ b/drivers/staging/unisys/common-spar/include/channels/iochannel.h
@@ -374,7 +374,7 @@ struct uiscmdrsp_scsi {
  * NOTE:[4] SCSI returns (n-4); so we return length-1-4 or length-5. */
 
 #define SET_NO_DISK_INQUIRY_RESULT(buf, len, lun, lun0notpresent, notpresent) \
-	do {								\
+	{								\
 		memset(buf, 0,						\
 		       MINNUM(len,					\
 			      (unsigned int) NO_DISK_INQUIRY_RESULT_LEN)); \
@@ -386,7 +386,7 @@ struct uiscmdrsp_scsi {
 			buf[0] = (u8) notpresent;			\
 		buf[4] = (u8) (						\
 			MINNUM(len,					\
-			       (unsigned int) NO_DISK_INQUIRY_RESULT_LEN) - 5);	\
+			       (unsigned int) NO_DISK_INQUIRY_RESULT_LEN) - 5);\
 		if (len >= NO_DISK_INQUIRY_RESULT_LEN) {		\
 			buf[8] = 'D';					\
 			buf[9] = 'E';					\
@@ -408,7 +408,7 @@ struct uiscmdrsp_scsi {
 			buf[30] = ' ';					\
 			buf[31] = '.';					\
 		}							\
-	} while (0)
+	}
 
 
 /*
@@ -749,7 +749,7 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
 #define QSLOTSFROMBYTES(bytes) (((bytes-SIZEOF_PROTOCOL)/2)/SIZEOF_CMDRSP)
 #define QSIZEFROMBYTES(bytes) (QSLOTSFROMBYTES(bytes)*SIZEOF_CMDRSP)
 #define SignalQInit(x)						\
-	do {							\
+	{							\
 		x->cmdQ.Size = QSIZEFROMBYTES(x->ChannelHeader.Size);	\
 		x->cmdQ.oSignalBase = SIZEOF_PROTOCOL -			\
 			offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);	\
@@ -767,10 +767,10 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
 		x->rspQ.MaxSignals = x->rspQ.MaxSignalSlots - 1;	\
 		x->ChannelHeader.oChannelSpace =			\
 			offsetof(ULTRA_IO_CHANNEL_PROTOCOL, cmdQ);	\
-	} while (0)
+	}
 
 #define INIT_CLIENTSTRING(chan, type, clientStr, clientStrLen)	\
-	do {								\
+	{								\
 		if (clientStr) {					\
 			chan->ChannelHeader.oClientString =		\
 				offsetof(type, clientString);		\
@@ -785,16 +785,16 @@ typedef struct _ULTRA_IO_CHANNEL_PROTOCOL {
 		else							\
 			if (clientStrLen > 0)				\
 				return 0;				\
-	} while (0)
+	}
 
 
 #define ULTRA_IO_CHANNEL_SERVER_READY(x, chanId, logCtx) \
 	ULTRA_CHANNEL_SERVER_TRANSITION(x, chanId, SrvState, CHANNELSRV_READY, \
-					logCtx);
+					logCtx)
 
 #define ULTRA_IO_CHANNEL_SERVER_NOTREADY(x, chanId, logCtx)	\
 	ULTRA_CHANNEL_SERVER_TRANSITION(x, chanId, SrvState, \
-					CHANNELSRV_UNINITIALIZED, logCtx);
+					CHANNELSRV_UNINITIALIZED, logCtx)
 
 static inline int ULTRA_VHBA_init_channel(ULTRA_IO_CHANNEL_PROTOCOL *x,
 					      struct vhba_wwnn *wwnn,
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h
  2014-08-05 18:57 ` [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h Benjamin Romer
@ 2014-08-06  8:18   ` Dan Carpenter
  2014-08-06 13:08     ` Romer, Benjamin M
  0 siblings, 1 reply; 19+ messages in thread
From: Dan Carpenter @ 2014-08-06  8:18 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: gregkh, sparmaintainer, driverdev-devel

On Tue, Aug 05, 2014 at 02:57:55PM -0400, Benjamin Romer wrote:
> The CHANNEL_*_MISMATCH error message macros should not be inside of do blocks.
> 

Why not?  We do that so they can be called like a function.  These seem
to not be called at all.   Just delete them (in a later patch).

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 14/14] staging: unisys: fix macros in iochannel.h
  2014-08-05 18:57 ` [PATCH 14/14] staging: unisys: fix macros in iochannel.h Benjamin Romer
@ 2014-08-06  8:24   ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2014-08-06  8:24 UTC (permalink / raw)
  To: Benjamin Romer; +Cc: gregkh, sparmaintainer, driverdev-devel

On Tue, Aug 05, 2014 at 02:57:58PM -0400, Benjamin Romer wrote:
> Remove the do blocks around several macros and fix spacing and trailing
> semicolons.
> 

do blocks are prefered style actually.  Otherwise people start leaving
semi-colons out in the caller code.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h
  2014-08-06  8:18   ` Dan Carpenter
@ 2014-08-06 13:08     ` Romer, Benjamin M
  2014-08-06 13:22       ` Dan Carpenter
  0 siblings, 1 reply; 19+ messages in thread
From: Romer, Benjamin M @ 2014-08-06 13:08 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: gregkh, *S-Par-Maintainer, driverdev-devel

On Wed, 2014-08-06 at 11:18 +0300, Dan Carpenter wrote:
> On Tue, Aug 05, 2014 at 02:57:55PM -0400, Benjamin Romer wrote:
> > The CHANNEL_*_MISMATCH error message macros should not be inside of do blocks.
> > 
> 
> Why not?  We do that so they can be called like a function.  These seem
> to not be called at all.   Just delete them (in a later patch).

I ran checkpatch.pl against the channel.h file and it complains about
the do blocks in the macros there. It also complains about do blocks in
iochannel.h. It's only a warning though. 

I'm all in favor of deleting them - they get used in
ULTRA_check_channel_client() in the same file, and only there. I'll just
remove the macros and put the equivalent code in where they were used.

-- 
Ben Romer | Software Engineer |
Virtual Systems Development 

Unisys Corporation |  2476
Swedesford Rd |  Malvern, PA 19355
|  610-648-7140



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h
  2014-08-06 13:08     ` Romer, Benjamin M
@ 2014-08-06 13:22       ` Dan Carpenter
  0 siblings, 0 replies; 19+ messages in thread
From: Dan Carpenter @ 2014-08-06 13:22 UTC (permalink / raw)
  To: Romer, Benjamin M; +Cc: gregkh, *S-Par-Maintainer, driverdev-devel

On Wed, Aug 06, 2014 at 08:08:11AM -0500, Romer, Benjamin M wrote:
> On Wed, 2014-08-06 at 11:18 +0300, Dan Carpenter wrote:
> > On Tue, Aug 05, 2014 at 02:57:55PM -0400, Benjamin Romer wrote:
> > > The CHANNEL_*_MISMATCH error message macros should not be inside of do blocks.
> > > 
> > 
> > Why not?  We do that so they can be called like a function.  These seem
> > to not be called at all.   Just delete them (in a later patch).
> 
> I ran checkpatch.pl against the channel.h file and it complains about
> the do blocks in the macros there. It also complains about do blocks in
> iochannel.h.  It's only a warning though.

Ah.  I see.  The thing is you should remove the final semi-colon from
the macro as well as the do while.

But it's best to just remove the macro.  It only obfuscates the code.

> 
> I'm all in favor of deleting them - they get used in
> ULTRA_check_channel_client() in the same file, and only there. I'll just
> remove the macros and put the equivalent code in where they were used.

Oh...  It is used after all.  Then one of your earlier patches:

[PATCH 02/12] staging: unisys: remove U32 type

must have broken the build.  That's not allowed...

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2014-08-06 13:22 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05 18:57 [PATCH 00/14] staging: unisys: common headers cleanup Benjamin Romer
2014-08-05 18:57 ` [PATCH 01/14] staging: unisys: get rid of unused VMMIO types Benjamin Romer
2014-08-05 18:57 ` [PATCH 02/14] staging: unisys: fix formatting in timskmod.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 03/14] staging: unisys: get rid of semaphore macros Benjamin Romer
2014-08-05 18:57 ` [PATCH 04/14] staging: unisys: remove unused macros from timskmod.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 05/14] staging: unisys: get rid of uiscmpxchg64 Benjamin Romer
2014-08-05 18:57 ` [PATCH 06/14] staging: unisys: fix whitespace in uisutils.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 07/14] staging: unisys: fix line lengths in controlvmcompletionstatus.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 08/14] staging: unisys: fix spacing in iovmcall_gnuc.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 09/14] staging: unisys: clean up vmcall functions Benjamin Romer
2014-08-05 18:57 ` [PATCH 10/14] staging: unisys: fix spacing in vbusdeviceinfo.h Benjamin Romer
2014-08-05 18:57 ` [PATCH 11/14] staging: unisys: remove do{} while(0) in macros in channel.h Benjamin Romer
2014-08-06  8:18   ` Dan Carpenter
2014-08-06 13:08     ` Romer, Benjamin M
2014-08-06 13:22       ` Dan Carpenter
2014-08-05 18:57 ` [PATCH 12/14] staging: unisys: fix spacing " Benjamin Romer
2014-08-05 18:57 ` [PATCH 13/14] staging: unisys: clean up comments in controlvmchannel.h message packet Benjamin Romer
2014-08-05 18:57 ` [PATCH 14/14] staging: unisys: fix macros in iochannel.h Benjamin Romer
2014-08-06  8:24   ` Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.