public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Julia Lawall <julia.lawall@lip6.fr>, Kamal Heib <kamalh@mellanox.com>
Cc: kbuild-all@01.org, Amir Vadai <amirv@mellanox.com>,
	Haggai Eran <haggaie@mellanox.com>,
	Sean Hefty <sean.hefty@intel.com>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-rdma@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] IB/rxe: fix compare_const_fl.cocci warnings
Date: Thu, 18 Feb 2016 11:56:59 -0500	[thread overview]
Message-ID: <56C5F7DB.1070009@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1602180803370.2671@hadrien>

[-- 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 --]

      reply	other threads:[~2016-02-18 16:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 13:06 [PATCH] IB/rxe: fix compare_const_fl.cocci warnings Julia Lawall
2016-02-18 16:56 ` Doug Ledford [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56C5F7DB.1070009@redhat.com \
    --to=dledford@redhat.com \
    --cc=amirv@mellanox.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haggaie@mellanox.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=kamalh@mellanox.com \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sean.hefty@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox