Skip to contentSkip to conversation

Staging: rdma ipath: fix checkpatch issues

PATCH In review SirnamSwetha 3 participants 11 messages Oct 27, 2015 Staging

lore
Share & tools
lore
#0 lore raw

cover Staging: rdma ipath: fix checkpatch issues

This patchset fixes checkpatch issues, for ipath_common.h and ipath_cq.c

SirnamSwetha (8):
Staging: rdma ipath: Removing multiple blank lines
Staging: rdma ipath: __aligned(size) is preferred over

    __attribute__((aligned(size)))

Staging : rdma ipath: spaces preferred around that '<<' Staging : rdma ipath: "foo * bar" should be "foo *bar"
Staging: rdma ipath: Fix space before tabs, line over 80 characters
Staging: rdma ipath: 'explict' misspelled
Staging: rdma ipath: No space is necessary after a cast
Staging: rdma ipath: braces should be used on all arms

 drivers/staging/rdma/ipath/ipath_common.h | 33 +++++++++++++++----------------
 drivers/staging/rdma/ipath/ipath_cq.c     | 28 ++++++++++++++------------
 2 files changed, 31 insertions(+), 30 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/8 Staging: rdma ipath: Removing multiple blank lines

This patch fixes the checkpatch issue

CHECK: Please don't use multiple blank lines

---
 drivers/staging/rdma/ipath/ipath_common.h | 4 ----
 1 file changed, 4 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +0 -4
index 28cfe97..812fb9b 100644
@@ -39,7 +39,6 @@
  * to communicate between kernel and user code.
  */
 
-
 /* This is the IEEE-assigned OUI for QLogic Inc. InfiniPath */
 #define IPATH_SRC_OUI_1 0x00
 #define IPATH_SRC_OUI_2 0x11
@@ -344,7 +343,6 @@ struct ipath_base_info {
 
 } __attribute__ ((aligned(8)));
 
-
 /*
  * This version number is given to the driver by the user code during
  * initialization in the spu_userversion field of ipath_user_info, so
@@ -767,7 +765,6 @@ struct ether_header {
 	__u8 unused[2];		/* currently unused */
 };
 
-
 /* IB - LRH header consts */
 #define IPATH_LRH_GRH 0x0003	/* 1. word of IB LRH - next header: GRH */
 #define IPATH_LRH_BTH 0x0002	/* 1. word of IB LRH - next header: BTH */
@@ -793,7 +790,6 @@ struct ether_header {
 #define RCVHQ_RCV_TYPE_NON_KD    2
 #define RCVHQ_RCV_TYPE_ERROR     3
 
-
 /* sub OpCodes - ith4x  */
 #define IPATH_ITH4X_OPCODE_ENCAP 0x81
 #define IPATH_ITH4X_OPCODE_LID_ARP 0x82
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/8 Staging: rdma ipath: __aligned(size) is preferred over __attribute__((aligned(size)))

In reply to SirnamSwetha

This patch fixes the checkpatch issue:

WARNING: __aligned(size) is preferred over __attribute__((aligned(size)))

---
 drivers/staging/rdma/ipath/ipath_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +2 -2
index 812fb9b..df2a211 100644
@@ -341,7 +341,7 @@ struct ipath_base_info {
 	__u64 spi_port_rcvhdr_base;
 	__u64 spi_port_rcvhdr_tailaddr;
 
-} __attribute__ ((aligned(8)));
+} __aligned(8);
 
 /*
  * This version number is given to the driver by the user code during
@@ -425,7 +425,7 @@ struct ipath_user_info {
 	 */
 	__u64 spu_base_info;
 
-} __attribute__ ((aligned(8)));
+} __aligned(8);
 
 /* User commands. */
 
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/8 Staging : rdma ipath: spaces preferred around that '<<'

In reply to SirnamSwetha

This patch fixes the checkpatch issue:

CHECK: spaces preferred around that '<<'

---
 drivers/staging/rdma/ipath/ipath_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +2 -2
index df2a211..3f9b4bc 100644
@@ -365,7 +365,7 @@ struct ipath_base_info {
  */
 #define IPATH_USER_SWMINOR 6
 
-#define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR<<16) | IPATH_USER_SWMINOR)
+#define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR << 16) | IPATH_USER_SWMINOR)
 
 #define IPATH_KERN_TYPE 0
 
@@ -380,7 +380,7 @@ struct ipath_base_info {
  * spi_sw_version field of ipath_base_info, so the user code can in turn
  * check for compatibility with the kernel.
 */
-#define IPATH_KERN_SWVERSION ((IPATH_KERN_TYPE<<31) | IPATH_USER_SWVERSION)
+#define IPATH_KERN_SWVERSION ((IPATH_KERN_TYPE << 31) | IPATH_USER_SWVERSION)
 
 /*
  * This structure is passed to ipath_userinit() to tell the driver where
Signature · 1 line
1.9.1
#4 lore raw

Re: [Outreachy kernel] [PATCH 3/8] Staging : rdma ipath: spaces preferred around that '<<'

Quoted 5 lines · SirnamSwetha

This patch fixes the checkpatch issue:

CHECK: spaces preferred around that '<<'

Normally there would be a space between the two parts of your name.

Also, you shouldn't be sending patches to linux-usb, only to the outreachy mailing list.

julia

Quoted 36 lines
---
 drivers/staging/rdma/ipath/ipath_common.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +2 -3
index df2a211..3f9b4bc 100644
@@ -365,7 +365,7 @@ struct ipath_base_info {
  */
 #define IPATH_USER_SWMINOR 6
 
-#define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR<<16) | IPATH_USER_SWMINOR)
+#define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR << 16) | IPATH_USER_SWMINOR)
 
 #define IPATH_KERN_TYPE 0
 
@@ -380,7 +380,7 @@ struct ipath_base_info {
  * spi_sw_version field of ipath_base_info, so the user code can in turn
  * check for compatibility with the kernel.
 */
-#define IPATH_KERN_SWVERSION ((IPATH_KERN_TYPE<<31) | IPATH_USER_SWVERSION)
+#define IPATH_KERN_SWVERSION ((IPATH_KERN_TYPE << 31) | IPATH_USER_SWVERSION)
 
 /*
  * This structure is passed to ipath_userinit() to tell the driver where
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/e7077e1d1c8bc59b7ebfa8151fa4788b38daf74b.1445936144.git.theonly.ultimate%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw

PATCH 4/8 Staging : rdma ipath: "foo * bar" should be "foo *bar"

In reply to SirnamSwetha

This patch fixes:

ERROR: "foo * bar" should be "foo *bar"

---
 drivers/staging/rdma/ipath/ipath_common.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +4 -4
index 3f9b4bc..9ce581e 100644
@@ -798,24 +798,24 @@ struct ether_header {
 
 /* functions for extracting fields from rcvhdrq entries for the driver.
  */
-static inline __u32 ipath_hdrget_err_flags(const __le32 * rbuf)
+static inline __u32 ipath_hdrget_err_flags(const __le32 *rbuf)
 {
 	return __le32_to_cpu(rbuf[1]) & INFINIPATH_RHF_H_ERR_MASK;
 }
 
-static inline __u32 ipath_hdrget_rcv_type(const __le32 * rbuf)
+static inline __u32 ipath_hdrget_rcv_type(const __le32 *rbuf)
 {
 	return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_RCVTYPE_SHIFT)
 	    & INFINIPATH_RHF_RCVTYPE_MASK;
 }
 
-static inline __u32 ipath_hdrget_length_in_bytes(const __le32 * rbuf)
+static inline __u32 ipath_hdrget_length_in_bytes(const __le32 *rbuf)
 {
 	return ((__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_LENGTH_SHIFT)
 		& INFINIPATH_RHF_LENGTH_MASK) << 2;
 }
 
-static inline __u32 ipath_hdrget_index(const __le32 * rbuf)
+static inline __u32 ipath_hdrget_index(const __le32 *rbuf)
 {
 	return (__le32_to_cpu(rbuf[0]) >> INFINIPATH_RHF_EGRINDEX_SHIFT)
 	    & INFINIPATH_RHF_EGRINDEX_MASK;
Signature · 1 line
1.9.1
#6 lore raw

PATCH 5/8 Staging: rdma ipath: Fix space before tabs, line over 80 characters

In reply to SirnamSwetha

This patch fixes:

CHECK: no space before tabs

WARNING: line over 80 characters

---
 drivers/staging/rdma/ipath/ipath_common.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/staging/rdma/ipath/ipath_common.h +7 -4
index 9ce581e..567869a 100644
@@ -431,15 +431,17 @@ struct ipath_user_info {
 
 #define IPATH_CMD_MIN		16
 
-#define __IPATH_CMD_USER_INIT	16	/* old set up userspace (for old user code) */
+/* old set up userspace (for old user code) */
+#define __IPATH_CMD_USER_INIT	16
 #define IPATH_CMD_PORT_INFO	17	/* find out what resources we got */
 #define IPATH_CMD_RECV_CTRL	18	/* control receipt of packets */
 #define IPATH_CMD_TID_UPDATE	19	/* update expected TID entries */
 #define IPATH_CMD_TID_FREE	20	/* free expected TID entries */
 #define IPATH_CMD_SET_PART_KEY	21	/* add partition key */
-#define __IPATH_CMD_SLAVE_INFO	22	/* return info on slave processes (for old user code) */
+/* return info on slave processes (for old user code) */
+#define __IPATH_CMD_SLAVE_INFO	22
 #define IPATH_CMD_ASSIGN_PORT	23	/* allocate HCA and port */
-#define IPATH_CMD_USER_INIT 	24	/* set up userspace */
+#define IPATH_CMD_USER_INIT	24/* set up userspace */
 #define IPATH_CMD_UNUSED_1	25
 #define IPATH_CMD_UNUSED_2	26
 #define IPATH_CMD_PIOAVAILUPD	27	/* force an update of PIOAvail reg */
@@ -497,7 +499,8 @@ struct ipath_cmd {
 		 */
 		__u64 sdma_complete;
 		/* address in userspace of struct ipath_port_info to
-		   write result to */
+		 *  write result to
+		 */
 		__u64 port_info;
 		/* enable/disable receipt of packets */
 		__u32 recv_ctrl;
Signature · 1 line
1.9.1
#7 lore raw

PATCH 6/8 Staging: rdma ipath: 'explict' misspelled

In reply to SirnamSwetha

Fix: CHECK: 'explict' may be misspelled - perhaps 'explicit'?

---
 drivers/staging/rdma/ipath/ipath_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rdma/ipath/ipath_common.h +1 -1
index 567869a..24dd8b6 100644
@@ -209,7 +209,7 @@ typedef enum _ipath_ureg {
  * open to get implementation-specific info, and info specific to this
  * instance.
  *
- * This struct must have explict pad fields where type sizes
+ * This struct must have explicit pad fields where type sizes
  * may result in different alignments between 32 and 64 bit
  * programs, since the 64 bit * bit kernel requires the user code
  * to have matching offsets
Signature · 1 line
1.9.1
#8 lore raw

PATCH 7/8 Staging: rdma ipath: No space is necessary after a cast

In reply to SirnamSwetha

This patch fixes the issue:

CHECK: No space is necessary after a cast

---
 drivers/staging/rdma/ipath/ipath_cq.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/staging/rdma/ipath/ipath_cq.c +9 -9
index e9dd911..071de3c 100644
@@ -60,7 +60,7 @@ void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int solicited)
 	 */
 	wc = cq->queue;
 	head = wc->head;
-	if (head >= (unsigned) cq->ibcq.cqe) {
+	if (head >= (unsigned)cq->ibcq.cqe) {
 		head = cq->ibcq.cqe;
 		next = 0;
 	} else
@@ -83,7 +83,7 @@ void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int solicited)
 		wc->uqueue[head].opcode = entry->opcode;
 		wc->uqueue[head].vendor_err = entry->vendor_err;
 		wc->uqueue[head].byte_len = entry->byte_len;
-		wc->uqueue[head].ex.imm_data = (__u32 __force) entry->ex.imm_data;
+		wc->uqueue[head].ex.imm_data = (__u32 __force)entry->ex.imm_data;
 		wc->uqueue[head].qp_num = entry->qp->qp_num;
 		wc->uqueue[head].src_qp = entry->src_qp;
 		wc->uqueue[head].wc_flags = entry->wc_flags;
@@ -144,8 +144,8 @@ int ipath_poll_cq(struct ib_cq *ibcq, int num_entries, struct ib_wc *entry)
 
 	wc = cq->queue;
 	tail = wc->tail;
-	if (tail > (u32) cq->ibcq.cqe)
-		tail = (u32) cq->ibcq.cqe;
+	if (tail > (u32)cq->ibcq.cqe)
+		tail = (u32)cq->ibcq.cqe;
 	for (npolled = 0; npolled < num_entries; ++npolled, ++entry) {
 		if (tail == wc->head)
 			break;
@@ -417,11 +417,11 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 	 */
 	old_wc = cq->queue;
 	head = old_wc->head;
-	if (head > (u32) cq->ibcq.cqe)
-		head = (u32) cq->ibcq.cqe;
+	if (head > (u32)cq->ibcq.cqe)
+		head = (u32)cq->ibcq.cqe;
 	tail = old_wc->tail;
-	if (tail > (u32) cq->ibcq.cqe)
-		tail = (u32) cq->ibcq.cqe;
+	if (tail > (u32)cq->ibcq.cqe)
+		tail = (u32)cq->ibcq.cqe;
 	if (head < tail)
 		n = cq->ibcq.cqe + 1 + head - tail;
 	else
@@ -435,7 +435,7 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
 			wc->uqueue[n] = old_wc->uqueue[tail];
 		else
 			wc->kqueue[n] = old_wc->kqueue[tail];
-		if (tail == (u32) cq->ibcq.cqe)
+		if (tail == (u32)cq->ibcq.cqe)
 			tail = 0;
 		else
 			tail++;
Signature · 1 line
1.9.1
#9 lore raw

PATCH 8/8 Staging: rdma ipath: braces should be used on all arms

In reply to SirnamSwetha

Fix all instances of the following checkpatch.pl check:

CHECK: braces {} should be used on all arms of this statement

---
 drivers/staging/rdma/ipath/ipath_cq.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/staging/rdma/ipath/ipath_cq.c +6 -4
index 071de3c..a676232 100644
@@ -63,8 +63,9 @@ void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int solicited)
 	if (head >= (unsigned)cq->ibcq.cqe) {
 		head = cq->ibcq.cqe;
 		next = 0;
-	} else
+	} else {
 		next = head + 1;
+	}
 	if (unlikely(next == wc->tail)) {
 		spin_unlock_irqrestore(&cq->lock, flags);
 		if (cq->ibcq.event_handler) {
@@ -94,8 +95,9 @@ void ipath_cq_enter(struct ipath_cq *cq, struct ib_wc *entry, int solicited)
 		wc->uqueue[head].port_num = entry->port_num;
 		/* Make sure entry is written before the head index. */
 		smp_wmb();
-	} else
+	} else {
 		wc->kqueue[head] = *entry;
+	}
 	wc->head = next;
 
 	if (cq->notify == IB_CQ_NEXT_COMP ||
@@ -261,9 +263,9 @@ struct ib_cq *ipath_create_cq(struct ib_device *ibdev,
 			ret = ERR_PTR(err);
 			goto bail_ip;
 		}
-	} else
+	} else {
 		cq->ip = NULL;
-
+	}
 	spin_lock(&dev->n_cqs_lock);
 	if (dev->n_cqs_allocated == ib_ipath_max_cqs) {
 		spin_unlock(&dev->n_cqs_lock);
Signature · 1 line
1.9.1
maintainer
#10 lore raw
In reply to SirnamSwetha
Quoted 2 lines · SirnamSwetha

This patchset fixes checkpatch issues, for ipath_common.h and ipath_cq.c

Why did you cc: the linux-usb mailing list on these? They have nothing to do with the USB subsystem.

Please use scripts/get_maintainer.pl to determine mailing lists to cc:

But, for the Outreachy application process, please just use the outreachy-kernel list, no need to bother any vger.kernel.org list with your patches.

thanks,

greg k-h