Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1263146 > unrolled thread
| Started by | Sunny Kumar <sunny.kumar.roy@gmail.com> |
|---|---|
| First post | 2015-11-05 13:00 +0100 |
| Last post | 2015-11-05 18:10 +0100 |
| Articles | 4 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro Sunny Kumar <sunny.kumar.roy@gmail.com> - 2015-11-05 13:00 +0100
Re: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro Leon Romanovsky <leon@leon.nu> - 2015-11-05 14:30 +0100
RE: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro "Marciniszyn, Mike" <mike.marciniszyn@intel.com> - 2015-11-05 15:30 +0100
Re: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro "ira.weiny" <ira.weiny@intel.com> - 2015-11-05 18:10 +0100
| From | Sunny Kumar <sunny.kumar.roy@gmail.com> |
|---|---|
| Date | 2015-11-05 13:00 +0100 |
| Subject | [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro |
| Message-ID | <qrrmW-69O-5@gated-at.bofh.it> |
This patch replaces bit shifting on 1 with the BIT(x) macro Signed-off-by: Sunny Kumar <sunnyk@cdac.in> --- drivers/staging/rdma/hfi1/user_sdma.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c index 36c838d..95a6d99 100644 --- a/drivers/staging/rdma/hfi1/user_sdma.c +++ b/drivers/staging/rdma/hfi1/user_sdma.c @@ -146,8 +146,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 #define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1)) /* Last packet in the request */ -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) #define SDMA_REQ_IN_USE 0 #define SDMA_REQ_FOR_THREAD 1 @@ -156,9 +156,9 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 #define SDMA_REQ_HAS_ERROR 4 #define SDMA_REQ_DONE_ERROR 5 -#define SDMA_PKT_Q_INACTIVE (1 << 0) -#define SDMA_PKT_Q_ACTIVE (1 << 1) -#define SDMA_PKT_Q_DEFERRED (1 << 2) +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) /* * Maximum retry attempts to submit a TX request -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Leon Romanovsky <leon@leon.nu> |
|---|---|
| Date | 2015-11-05 14:30 +0100 |
| Message-ID | <qrsM2-7f5-21@gated-at.bofh.it> |
| In reply to | #1263146 |
On Thu, Nov 05, 2015 at 05:28:03PM +0530, Sunny Kumar wrote: > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar <sunnyk@cdac.in> > --- > drivers/staging/rdma/hfi1/user_sdma.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > /* Last packet in the request */ > -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) > -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) > +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) > +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) > It is wrong. It actually creates 0x2 instead of 0x1. > -#define SDMA_PKT_Q_INACTIVE (1 << 0) > -#define SDMA_PKT_Q_ACTIVE (1 << 1) > -#define SDMA_PKT_Q_DEFERRED (1 << 2) > +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) > +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) > +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) The same comment as above. It is wrong. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "Marciniszyn, Mike" <mike.marciniszyn@intel.com> |
|---|---|
| Date | 2015-11-05 15:30 +0100 |
| Message-ID | <qrtI5-7PQ-3@gated-at.bofh.it> |
| In reply to | #1263146 |
> Subject: [PATCH 1/1] staging: rdma: hfi1 : Prefer using the BIT macro > > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar <sunnyk@cdac.in> > --- Nak. The patch leaves the shift in. Mike -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | "ira.weiny" <ira.weiny@intel.com> |
|---|---|
| Date | 2015-11-05 18:10 +0100 |
| Message-ID | <qrwcW-15C-13@gated-at.bofh.it> |
| In reply to | #1263146 |
On Thu, Nov 05, 2015 at 05:28:03PM +0530, Sunny Kumar wrote: > This patch replaces bit shifting on 1 with the BIT(x) macro > > Signed-off-by: Sunny Kumar <sunnyk@cdac.in> Also, NAK as has been covered in other responses. However, I wanted to add, similar to the hfi1_ioctl fix, we have follow on checkpatch patches which address this. Ira > --- > drivers/staging/rdma/hfi1/user_sdma.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/staging/rdma/hfi1/user_sdma.c b/drivers/staging/rdma/hfi1/user_sdma.c > index 36c838d..95a6d99 100644 > --- a/drivers/staging/rdma/hfi1/user_sdma.c > +++ b/drivers/staging/rdma/hfi1/user_sdma.c > @@ -146,8 +146,8 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 > #define KDETH_OM_MAX_SIZE (1 << ((KDETH_OM_LARGE / KDETH_OM_SMALL) + 1)) > > /* Last packet in the request */ > -#define TXREQ_FLAGS_REQ_LAST_PKT (1 << 0) > -#define TXREQ_FLAGS_IOVEC_LAST_PKT (1 << 0) > +#define TXREQ_FLAGS_REQ_LAST_PKT BIT(1 << 0) > +#define TXREQ_FLAGS_IOVEC_LAST_PKT BIT(1 << 0) > > #define SDMA_REQ_IN_USE 0 > #define SDMA_REQ_FOR_THREAD 1 > @@ -156,9 +156,9 @@ MODULE_PARM_DESC(sdma_comp_size, "Size of User SDMA completion ring. Default: 12 > #define SDMA_REQ_HAS_ERROR 4 > #define SDMA_REQ_DONE_ERROR 5 > > -#define SDMA_PKT_Q_INACTIVE (1 << 0) > -#define SDMA_PKT_Q_ACTIVE (1 << 1) > -#define SDMA_PKT_Q_DEFERRED (1 << 2) > +#define SDMA_PKT_Q_INACTIVE BIT(1 << 0) > +#define SDMA_PKT_Q_ACTIVE BIT(1 << 1) > +#define SDMA_PKT_Q_DEFERRED BIT(1 << 2) > > /* > * Maximum retry attempts to submit a TX request > -- > 2.1.4 > > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web