Linux-WPAN Archive on lore.kernel.org
 help / color / Atom feed
From: Stefan Schmidt <stefan@datenfreihafen.org>
To: Yang Yingliang <yangyingliang@huawei.com>,
	alex.aring@gmail.com, davem@davemloft.net
Cc: netdev@vger.kernel.org, linux-wpan@vger.kernel.org
Subject: Re: [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison
Date: Fri, 8 May 2020 17:09:43 +0200
Message-ID: <e9ce1e47-79aa-aca2-e182-b9063d17fad8@datenfreihafen.org> (raw)
In-Reply-To: <1588909928-58230-1-git-send-email-yangyingliang@huawei.com>

Hello.

On 08.05.20 05:52, Yang Yingliang wrote:
> The type of dispatch is u8 which is always '<=' 0xff, so the
> dispatch <= 0xff is always true, we can remove this comparison.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
> ---
>   net/ieee802154/6lowpan/rx.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/ieee802154/6lowpan/rx.c b/net/ieee802154/6lowpan/rx.c
> index ee17938..b34d050 100644
> --- a/net/ieee802154/6lowpan/rx.c
> +++ b/net/ieee802154/6lowpan/rx.c
> @@ -240,7 +240,7 @@ static inline bool lowpan_is_reserved(u8 dispatch)
>   	return ((dispatch >= 0x44 && dispatch <= 0x4F) ||
>   		(dispatch >= 0x51 && dispatch <= 0x5F) ||
>   		(dispatch >= 0xc8 && dispatch <= 0xdf) ||
> -		(dispatch >= 0xe8 && dispatch <= 0xff));
> +		dispatch >= 0xe8);
>   }
>   
>   /* lowpan_rx_h_check checks on generic 6LoWPAN requirements
> 

This looks good to me. Thanks for fixing this.

Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>

Dave, can you apply this directly to your net tree? I have no other 
ieee802154 fixes pending to fill a pull request.

regards
Stefan Schmidt

  reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-08  3:52 Yang Yingliang
2020-05-08 15:09 ` Stefan Schmidt [this message]
2020-05-09  5:26   ` Jakub Kicinski

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=e9ce1e47-79aa-aca2-e182-b9063d17fad8@datenfreihafen.org \
    --to=stefan@datenfreihafen.org \
    --cc=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-wpan@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yangyingliang@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

Linux-WPAN Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wpan/0 linux-wpan/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wpan linux-wpan/ https://lore.kernel.org/linux-wpan \
		linux-wpan@vger.kernel.org
	public-inbox-index linux-wpan

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wpan


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git