linux-wpan.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison
@ 2020-05-08  3:52 Yang Yingliang
  2020-05-08 15:09 ` Stefan Schmidt
  0 siblings, 1 reply; 3+ messages in thread
From: Yang Yingliang @ 2020-05-08  3:52 UTC (permalink / raw)
  To: alex.aring, stefan, davem; +Cc: netdev, linux-wpan, yangyingliang

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
-- 
1.8.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison
  2020-05-08  3:52 [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison Yang Yingliang
@ 2020-05-08 15:09 ` Stefan Schmidt
  2020-05-09  5:26   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Schmidt @ 2020-05-08 15:09 UTC (permalink / raw)
  To: Yang Yingliang, alex.aring, davem; +Cc: netdev, linux-wpan

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison
  2020-05-08 15:09 ` Stefan Schmidt
@ 2020-05-09  5:26   ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-05-09  5:26 UTC (permalink / raw)
  To: Stefan Schmidt, Yang Yingliang; +Cc: alex.aring, davem, netdev, linux-wpan

On Fri, 8 May 2020 17:09:43 +0200 Stefan Schmidt wrote:
>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>
>
> 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.

I'm sitting in for Dave today, applied to net-next, thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-09  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-08  3:52 [PATCH net-next] ieee802154: 6lowpan: remove unnecessary comparison Yang Yingliang
2020-05-08 15:09 ` Stefan Schmidt
2020-05-09  5:26   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).