* [PATCH] IB/rxe: fix compare_const_fl.cocci warnings
@ 2016-02-18 13:06 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-02-18 13:06 UTC (permalink / raw)
To: Kamal Heib
Cc: kbuild-all-JC7UmRfGjtg, Doug Ledford, Amir Vadai, Haggai Eran,
Sean Hefty, Hal Rosenstock, Greg Kroah-Hartman,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Move constants to the right of binary operators.
Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
CC: Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
---
The constants on the right look a bit nicer. Another possibility would be
!!.
tree: https://github.com/dledford/linux.git rxe-v2
head: bc91f3e63df667e8da8894a51149a2fc9acf0e71
commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add
Soft-RoCE to kbuild and makefiles
rxe_mr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/rdma/rxe/rxe_mr.c
+++ b/drivers/staging/rdma/rxe/rxe_mr.c
@@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
key = key << 1;
- key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
- ^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
+ key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
+ ^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
key &= 0xff;
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] IB/rxe: fix compare_const_fl.cocci warnings
@ 2016-02-18 13:06 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2016-02-18 13:06 UTC (permalink / raw)
To: Kamal Heib
Cc: kbuild-all, Doug Ledford, Amir Vadai, Haggai Eran, Sean Hefty,
Hal Rosenstock, Greg Kroah-Hartman, linux-rdma, devel,
linux-kernel
Move constants to the right of binary operators.
Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
CC: Kamal Heib <kamalh@mellanox.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
---
The constants on the right look a bit nicer. Another possibility would be
!!.
tree: https://github.com/dledford/linux.git rxe-v2
head: bc91f3e63df667e8da8894a51149a2fc9acf0e71
commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add
Soft-RoCE to kbuild and makefiles
rxe_mr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/staging/rdma/rxe/rxe_mr.c
+++ b/drivers/staging/rdma/rxe/rxe_mr.c
@@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
key = key << 1;
- key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
- ^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
+ key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
+ ^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
key &= 0xff;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] IB/rxe: fix compare_const_fl.cocci warnings
2016-02-18 13:06 ` Julia Lawall
@ 2016-02-18 16:56 ` Doug Ledford
-1 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-02-18 16:56 UTC (permalink / raw)
To: Julia Lawall, Kamal Heib
Cc: kbuild-all-JC7UmRfGjtg, Amir Vadai, Haggai Eran, Sean Hefty,
Hal Rosenstock, Greg Kroah-Hartman,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]
On 2/18/2016 8:06 AM, Julia Lawall wrote:
> Move constants to the right of binary operators.
>
> Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
>
> CC: Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Fengguang Wu <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
> ---
>
> The constants on the right look a bit nicer. Another possibility would be
> !!.
>
> tree: https://github.com/dledford/linux.git rxe-v2
> head: bc91f3e63df667e8da8894a51149a2fc9acf0e71
> commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add
> Soft-RoCE to kbuild and makefiles
>
> rxe_mr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/staging/rdma/rxe/rxe_mr.c
> +++ b/drivers/staging/rdma/rxe/rxe_mr.c
> @@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
>
> key = key << 1;
>
> - key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
> - ^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
> + key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
> + ^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
>
> key &= 0xff;
>
Thanks, applied to my rxe-v2 branch.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] IB/rxe: fix compare_const_fl.cocci warnings
@ 2016-02-18 16:56 ` Doug Ledford
0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2016-02-18 16:56 UTC (permalink / raw)
To: Julia Lawall, Kamal Heib
Cc: kbuild-all, Amir Vadai, Haggai Eran, Sean Hefty, Hal Rosenstock,
Greg Kroah-Hartman, linux-rdma, devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1163 bytes --]
On 2/18/2016 8:06 AM, Julia Lawall wrote:
> Move constants to the right of binary operators.
>
> Generated by: scripts/coccinelle/misc/compare_const_fl.cocci
>
> CC: Kamal Heib <kamalh@mellanox.com>
> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
> ---
>
> The constants on the right look a bit nicer. Another possibility would be
> !!.
>
> tree: https://github.com/dledford/linux.git rxe-v2
> head: bc91f3e63df667e8da8894a51149a2fc9acf0e71
> commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add
> Soft-RoCE to kbuild and makefiles
>
> rxe_mr.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- a/drivers/staging/rdma/rxe/rxe_mr.c
> +++ b/drivers/staging/rdma/rxe/rxe_mr.c
> @@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
>
> key = key << 1;
>
> - key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
> - ^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
> + key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
> + ^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
>
> key &= 0xff;
>
Thanks, applied to my rxe-v2 branch.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-18 16:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-18 13:06 [PATCH] IB/rxe: fix compare_const_fl.cocci warnings Julia Lawall
2016-02-18 13:06 ` Julia Lawall
2016-02-18 16:56 ` Doug Ledford
2016-02-18 16:56 ` Doug Ledford
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.