Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ieee802154: 6lowpan: remove unnecessary comparison

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>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Yang Yingliang and committed by
Jakub Kicinski
3712c1c2 cf86a086

+1 -1
+1 -1
net/ieee802154/6lowpan/rx.c
··· 240 240 return ((dispatch >= 0x44 && dispatch <= 0x4F) || 241 241 (dispatch >= 0x51 && dispatch <= 0x5F) || 242 242 (dispatch >= 0xc8 && dispatch <= 0xdf) || 243 - (dispatch >= 0xe8 && dispatch <= 0xff)); 243 + dispatch >= 0xe8); 244 244 } 245 245 246 246 /* lowpan_rx_h_check checks on generic 6LoWPAN requirements