[PATCH 4/9] staging: unisys: clean up uisqueue.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix many of the checkpatch.pl strict warnings and checks generated. The
remaining strict checks require large-scale refactoring of structures, so
these will be fixed in subequent patches.

Signed-off-by: Benjamin Romer <benjamin.romer@xxxxxxxxxx>
---
 drivers/staging/unisys/include/uisqueue.h | 54 ++++++++++++++-----------------
 drivers/staging/unisys/uislib/uisqueue.c  |  8 ++---
 drivers/staging/unisys/virthba/virthba.c  | 16 ++++-----
 3 files changed, 37 insertions(+), 41 deletions(-)

diff --git a/drivers/staging/unisys/include/uisqueue.h b/drivers/staging/unisys/include/uisqueue.h
index 8983407..b649b35 100644
--- a/drivers/staging/unisys/include/uisqueue.h
+++ b/drivers/staging/unisys/include/uisqueue.h
@@ -34,7 +34,6 @@
 #include "controlvmcompletionstatus.h"
 
 struct uisqueue_info {
-
 	CHANNEL_HEADER __iomem *chan;
 	/* channel containing queues in which scsi commands &
 	 * responses are queued
@@ -48,13 +47,13 @@ struct uisqueue_info {
 	u64 non_empty_wakeup_cnt;
 
 	struct {
-		SIGNAL_QUEUE_HEADER Reserved1;	/*  */
-		SIGNAL_QUEUE_HEADER Reserved2;	/*  */
+		SIGNAL_QUEUE_HEADER reserved1;	/*  */
+		SIGNAL_QUEUE_HEADER reserved2;	/*  */
 	} safe_uis_queue;
 	unsigned int (*send_int_if_needed)(struct uisqueue_info *info,
 					   unsigned int whichcqueue,
-					   unsigned char issueInterruptIfEmpty,
-					   u64 interruptHandle,
+					   unsigned char interrupt_if_empty,
+					   u64 interrupt_handle,
 					   unsigned char io_termination);
 };
 
@@ -76,25 +75,25 @@ struct uisqueue_info {
 		".previous\n"                   \
 		"661:\n\tlock; "
 
-unsigned long long uisqueue_InterlockedOr(unsigned long long __iomem *Target,
-					  unsigned long long Set);
-unsigned long long uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
-					   unsigned long long Set);
+unsigned long long uisqueue_interlocked_or(unsigned long long __iomem *target,
+					   unsigned long long set);
+unsigned long long uisqueue_interlocked_and(unsigned long long __iomem *target,
+					    unsigned long long set);
 
 unsigned int uisqueue_send_int_if_needed(struct uisqueue_info *pqueueinfo,
 					 unsigned int whichqueue,
-					 unsigned char issueInterruptIfEmpty,
-					 u64 interruptHandle,
+					 unsigned char interrupt_if_empty,
+					 u64 interrupt_handle,
 					 unsigned char io_termination);
 
 int uisqueue_put_cmdrsp_with_lock_client(struct uisqueue_info *queueinfo,
 					 struct uiscmdrsp *cmdrsp,
 					 unsigned int queue,
 					 void *insertlock,
-					 unsigned char issueInterruptIfEmpty,
-					 u64 interruptHandle,
+					 unsigned char interrupt_if_empty,
+					 u64 interrupt_handle,
 					 char oktowait,
-					 u8 *channelId);
+					 u8 *channel_id);
 
 /* uisqueue_get_cmdrsp gets the cmdrsp entry at the head of the queue
  * and copies it to the area pointed by cmdrsp param.
@@ -155,10 +154,10 @@ struct device_info {
 	unsigned long long last_on_list_cnt;
 };
 
-typedef enum {
+enum switch_type {
 	RECOVERY_LAN = 1,
 	IB_LAN = 2
-} SWITCH_TYPE;
+};
 
 struct bus_info {
 	u32 busNo, deviceCount;
@@ -176,8 +175,8 @@ struct bus_info {
 				 * by IOVM; 0 otherwise... */
 };
 
-#define DEDICATED_SWITCH(pSwitch) ((pSwitch->extPortCount == 1) &&	\
-				   (pSwitch->intPortCount == 1))
+#define DEDICATED_SWITCH(switch) ((switch->extPortCount == 1) &&	\
+				   (switch->intPortCount == 1))
 
 struct sn_list_entry {
 	struct uisscsi_dest pdest;	/* scsi bus, target, lun for
@@ -189,7 +188,7 @@ struct sn_list_entry {
 	struct sn_list_entry *next;
 };
 
-struct networkPolicy {
+struct network_policy {
 	u32 promiscuous:1;
 	u32 macassign:1;
 	u32 peerforwarding:1;
@@ -204,8 +203,7 @@ struct networkPolicy {
  * code that processes the ControlVm channel messages.
  */
 
-
-typedef enum {
+enum iopart_msg_type {
 	IOPART_ADD_VNIC,
 	IOPART_DEL_VNIC,
 	IOPART_DEL_ALL_VNICS,
@@ -225,7 +223,7 @@ typedef enum {
 	IOPART_RESUME_VDISK,
 	IOPART_ADD_DEVICE,	/* add generic device */
 	IOPART_DEL_DEVICE,	/* del generic device */
-} IOPART_MSG_TYPE;
+};
 
 struct add_virt_iopart {
 	void *chanptr;		/* pointer to data channel */
@@ -249,7 +247,7 @@ struct add_virt_iopart {
 
 	u8 useG2GCopy;		/* Used to determine if a virtual HBA
 				 * needs to use G2G copy. */
-	u8 Filler[7];
+	u8 filler[7];
 
 	u32 busNo;
 	u32 devNo;
@@ -303,8 +301,7 @@ struct del_switch_iopart {	     /* destroy switch */
 };
 
 struct io_msgs {
-
-	IOPART_MSG_TYPE msgtype;
+	enum iopart_msg_type msgtype;
 
 	/* additional params needed by some messages */
 	union {
@@ -335,7 +332,7 @@ struct io_msgs {
 * the ControlVm channel messages.
 */
 
-typedef enum {
+enum guestpart_msg_type {
 	GUEST_ADD_VBUS,
 	GUEST_ADD_VHBA,
 	GUEST_ADD_VNIC,
@@ -350,7 +347,7 @@ typedef enum {
 	GUEST_PAUSE_VNIC,
 	GUEST_RESUME_VHBA,
 	GUEST_RESUME_VNIC
-} GUESTPART_MSG_TYPE;
+};
 
 struct add_vbus_guestpart {
 	void __iomem *chanptr;		/* pointer to data channel for bus -
@@ -400,8 +397,7 @@ struct init_chipset_guestpart {
 };
 
 struct guest_msgs {
-
-	GUESTPART_MSG_TYPE msgtype;
+	enum guestpart_msg_type msgtype;
 
 	/* additional params needed by messages */
 	union {
diff --git a/drivers/staging/unisys/uislib/uisqueue.c b/drivers/staging/unisys/uislib/uisqueue.c
index 83f8761..cde6cd3 100644
--- a/drivers/staging/unisys/uislib/uisqueue.c
+++ b/drivers/staging/unisys/uislib/uisqueue.c
@@ -34,7 +34,7 @@
 /* Exported functions                                */
 /*****************************************************/
 unsigned long long
-uisqueue_InterlockedOr(unsigned long long __iomem *Target,
+uisqueue_interlocked_or(unsigned long long __iomem *Target,
 		       unsigned long long Set)
 {
 	unsigned long long i;
@@ -49,10 +49,10 @@ uisqueue_InterlockedOr(unsigned long long __iomem *Target,
 
 	return j;
 }
-EXPORT_SYMBOL_GPL(uisqueue_InterlockedOr);
+EXPORT_SYMBOL_GPL(uisqueue_interlocked_or);
 
 unsigned long long
-uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
+uisqueue_interlocked_and(unsigned long long __iomem *Target,
 			unsigned long long Set)
 {
 	unsigned long long i;
@@ -67,7 +67,7 @@ uisqueue_InterlockedAnd(unsigned long long __iomem *Target,
 
 	return j;
 }
-EXPORT_SYMBOL_GPL(uisqueue_InterlockedAnd);
+EXPORT_SYMBOL_GPL(uisqueue_interlocked_and);
 
 static u8
 do_locked_client_insert(struct uisqueue_info *queueinfo,
diff --git a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
index ce672c5..938e2c8 100644
--- a/drivers/staging/unisys/virthba/virthba.c
+++ b/drivers/staging/unisys/virthba/virthba.c
@@ -436,7 +436,7 @@ virthba_ISR(int irq, void *dev_id)
 		0)) {
 		virthbainfo->interrupts_disabled++;
 		mask = ~ULTRA_CHANNEL_ENABLE_INTS;
-		rc1 = uisqueue_InterlockedAnd(virthbainfo->flags_addr, mask);
+		rc1 = uisqueue_interlocked_and(virthbainfo->flags_addr, mask);
 	}
 	if (visor_signalqueue_empty(pChannelHeader, IOCHAN_FROM_IOPART)) {
 		virthbainfo->interrupts_notme++;
@@ -627,9 +627,9 @@ virthba_probe(struct virtpci_dev *virtpcidev, const struct pci_device_id *id)
 		       virthbainfo->interrupt_vector);
 		mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
 			 ULTRA_IO_DRIVER_DISABLES_INTS);
-		uisqueue_InterlockedAnd(Features_addr, mask);
+		uisqueue_interlocked_and(Features_addr, mask);
 		mask = ULTRA_IO_DRIVER_ENABLES_INTS;
-		uisqueue_InterlockedOr(Features_addr, mask);
+		uisqueue_interlocked_or(Features_addr, mask);
 		rsltq_wait_usecs = 4000000;
 	}
 
@@ -1353,7 +1353,7 @@ process_incoming_rsps(void *v)
 		atomic_set(&virthbainfo->interrupt_rcvd, 0);
 		/* drain queue */
 		drain_queue(virthbainfo, dc, cmdrsp);
-		rc1 = uisqueue_InterlockedOr(virthbainfo->flags_addr, mask);
+		rc1 = uisqueue_interlocked_or(virthbainfo->flags_addr, mask);
 		if (dc->threadinfo.should_stop)
 			break;
 	}
@@ -1457,16 +1457,16 @@ static ssize_t enable_ints_write(struct file *file,
 			if (new_value == 1) {
 				mask = ~(ULTRA_IO_CHANNEL_IS_POLLING |
 					 ULTRA_IO_DRIVER_DISABLES_INTS);
-				uisqueue_InterlockedAnd(Features_addr, mask);
+				uisqueue_interlocked_and(Features_addr, mask);
 				mask = ULTRA_IO_DRIVER_ENABLES_INTS;
-				uisqueue_InterlockedOr(Features_addr, mask);
+				uisqueue_interlocked_or(Features_addr, mask);
 				rsltq_wait_usecs = 4000000;
 			} else {
 				mask = ~(ULTRA_IO_DRIVER_ENABLES_INTS |
 					 ULTRA_IO_DRIVER_DISABLES_INTS);
-				uisqueue_InterlockedAnd(Features_addr, mask);
+				uisqueue_interlocked_and(Features_addr, mask);
 				mask = ULTRA_IO_CHANNEL_IS_POLLING;
-				uisqueue_InterlockedOr(Features_addr, mask);
+				uisqueue_interlocked_or(Features_addr, mask);
 				rsltq_wait_usecs = 4000;
 			}
 		}
-- 
1.9.1

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




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux