mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xie He <xie.he.0141@gmail.com>
To: Zou Wei <zou_wei@huawei.com>
Cc: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] net: wan: sdla: Use bitwise instead of arithmetic
Date: Fri, 30 Oct 2020 01:58:59 -0700	[thread overview]
Message-ID: <20201030085859.448125-1-xie.he.0141@gmail.com> (raw)
In-Reply-To: <1603873191-106077-1-git-send-email-zou_wei@huawei.com>

> Fix the following coccinelle warnings:
>
> ./drivers/net/wan/sdla.c:841:38-39: WARNING: sum of probable bitmasks, consider |
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>  drivers/net/wan/sdla.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
> index bc2c1c7..cf43f4c 100644
> --- a/drivers/net/wan/sdla.c
> +++ b/drivers/net/wan/sdla.c
> @@ -838,7 +838,8 @@ static void sdla_receive(struct net_device *dev)
>  		case SDLA_S502A:
>  		case SDLA_S502E:
>  			if (success)
> -				__sdla_read(dev, SDLA_502_RCV_BUF + SDLA_502_DATA_OFS, skb_put(skb,len), len);
> +				__sdla_read(dev, SDLA_502_RCV_BUF | SDLA_502_DATA_OFS,
> +					    skb_put(skb, len), len);
>  
>  			SDLA_WINDOW(dev, SDLA_502_RCV_BUF);
>  			cmd->opp_flag = 0;

No, this is not a bit-OR. This is a sum. The argument is an address,
SDLA_502_RCV_BUF is a base address, SDLA_502_DATA_OFS is an offset.
They should be sumed instead of bit-OR'ed.

      reply	other threads:[~2020-10-30  8:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-28  8:19 Zou Wei
2020-10-30  8:58 ` Xie He [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=20201030085859.448125-1-xie.he.0141@gmail.com \
    --to=xie.he.0141@gmail.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zou_wei@huawei.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

all inboxes | Powered by JetHome®