The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Dilger, Andreas" <andreas.dilger@intel.com>
To: Arushi Singhal <arushisinghal19971997@gmail.com>
Cc: "Drokin, Oleg" <oleg.drokin@intel.com>,
	James Simmons <jsimmons@infradead.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"outreachy-kernel@googlegroups.com" 
	<outreachy-kernel@googlegroups.com>,
	Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz>,
	Hamish Martin <hamish.martin@alliedtelesis.co.nz>
Subject: Re: [PATCH] staging: media: Replace a bit shift by a use of BIT.
Date: Wed, 22 Mar 2017 12:11:59 +0000	[thread overview]
Message-ID: <900FF751-5BFD-4B17-855C-6B1C0665B712@intel.com> (raw)
In-Reply-To: <20170322042028.GA22848@arushi-HP-Pavilion-Notebook>

On Mar 22, 2017, at 00:20, Arushi Singhal <arushisinghal19971997@gmail.com> wrote:
> 
> This patch replaces bit shifting on 1 with the BIT(x) macro.
> This was done with coccinelle:
> @@
> constant c;
> @@
> 
> -1 << c
> +BIT(c)

Hi Arushi,
thanks for taking time to contribute to the kernel.  There are a few problems with
this patch.

Firstly, I'm not sure why you sent this patch to lustre-devel, Oleg, James, and me,
since it has nothing to do with Lustre.  Conversely, the actual maintainer(s) of this
code would normally be better suited to review the patch.  This isn't totally clear
in this case since get_maintainer.pl lists another person submitting minor cleanups,
but "git log" does return some more likely candidates:
- David Daney <ddaney@caviumnetworks.com> (original author)
- Luuk Paulussen <luuk.paulussen@alliedtelesis.co.nz> (recent non-trivial patcher)
- Kyeong Yoo <kyeong.yoo@alliedtelesis.co.nz> (recent non-trivial reviewer)
- Richard Laing <richard.laing@alliedtelesis.co.nz>  " "
- Chris Packham <chris.packham@alliedtelesis.co.nz>
- Tim Beale <tim.beale@alliedtelesis.co.nz>
- Hamish Martin <hamish.martin@alliedtelesis.co.nz>


Secondly, as mentioned with the other patch you submitted, you need to stop and look
at whether your changes actually make sense.  In this case, I don't think they do
make sense, and this patch should probably just be abandoned.


> Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
> ---
> drivers/staging/octeon/ethernet-tx.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
> index ff4119e8de42..f00186ac4e27 100644
> --- a/drivers/staging/octeon/ethernet-tx.c
> +++ b/drivers/staging/octeon/ethernet-tx.c
> @@ -381,7 +381,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
> 	    (ip_hdr(skb)->version == 4) &&
> 	    (ip_hdr(skb)->ihl == 5) &&
> 	    ((ip_hdr(skb)->frag_off == 0) ||
> -	     (ip_hdr(skb)->frag_off == htons(1 << 14))) &&
> +	     (ip_hdr(skb)->frag_off == htons(BIT(14)))) &&

In this case, it is checking if the fragment offset in bytes is 16384, rather than doing
a bit comparison, so I don't think the use of BIT() is appropriate here.

> 	    ((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
> 	     (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
> 		/* Use hardware checksum calc */
> @@ -613,7 +613,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
> #endif
> 		work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
> 					  (ip_hdr(skb)->frag_off ==
> -					      1 << 14));
> +					      BIT(14)));

Same.

Cheers, Andreas
--
Andreas Dilger
Lustre Principal Architect
Intel Corporation

      parent reply	other threads:[~2017-03-22 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-22  4:20 [PATCH] staging: media: Replace a bit shift by a use of BIT Arushi Singhal
2017-03-22 10:23 ` [Outreachy kernel] " Julia Lawall
2017-03-22 12:11 ` Dilger, Andreas [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=900FF751-5BFD-4B17-855C-6B1C0665B712@intel.com \
    --to=andreas.dilger@intel.com \
    --cc=arushisinghal19971997@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hamish.martin@alliedtelesis.co.nz \
    --cc=jsimmons@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luuk.paulussen@alliedtelesis.co.nz \
    --cc=oleg.drokin@intel.com \
    --cc=outreachy-kernel@googlegroups.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