drivers/net/ethernet/sfc/ef100_rx.c:44:9-10: WARNING: return of 0/1 in function 'check_fcs' with return type bool

From: kernel test robot
Date: Fri Aug 21 2020 - 21:23:46 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f873db9acd3c92d4741bc3676c9eb511b2f9a6f6
commit: 8e57daf70671e482209b5d231a181f04845cf73e sfc_ef100: RX path for EF100
date: 3 weeks ago
config: i386-randconfig-c003-20200821 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


coccinelle warnings: (new ones prefixed by >>)

>> drivers/net/ethernet/sfc/ef100_rx.c:44:9-10: WARNING: return of 0/1 in function 'check_fcs' with return type bool

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e57daf70671e482209b5d231a181f04845cf73e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8e57daf70671e482209b5d231a181f04845cf73e
vim +/check_fcs +44 drivers/net/ethernet/sfc/ef100_rx.c

20
21 /* Get the value of a field in the RX prefix */
22 #define PREFIX_OFFSET_W(_f) (ESF_GZ_RX_PREFIX_ ## _f ## _LBN / 32)
23 #define PREFIX_OFFSET_B(_f) (ESF_GZ_RX_PREFIX_ ## _f ## _LBN % 32)
24 #define PREFIX_WIDTH_MASK(_f) ((1UL << ESF_GZ_RX_PREFIX_ ## _f ## _WIDTH) - 1)
25 #define PREFIX_WORD(_p, _f) le32_to_cpu((__force __le32)(_p)[PREFIX_OFFSET_W(_f)])
26 #define PREFIX_FIELD(_p, _f) ((PREFIX_WORD(_p, _f) >> PREFIX_OFFSET_B(_f)) & \
27 PREFIX_WIDTH_MASK(_f))
28
29 #define ESF_GZ_RX_PREFIX_NT_OR_INNER_L3_CLASS_LBN \
30 (ESF_GZ_RX_PREFIX_CLASS_LBN + ESF_GZ_RX_PREFIX_HCLASS_NT_OR_INNER_L3_CLASS_LBN)
31 #define ESF_GZ_RX_PREFIX_NT_OR_INNER_L3_CLASS_WIDTH \
32 ESF_GZ_RX_PREFIX_HCLASS_NT_OR_INNER_L3_CLASS_WIDTH
33
34 static bool check_fcs(struct efx_channel *channel, u32 *prefix)
35 {
36 u16 rxclass;
37 u8 l2status;
38
39 rxclass = le16_to_cpu((__force __le16)PREFIX_FIELD(prefix, CLASS));
40 l2status = PREFIX_FIELD(&rxclass, HCLASS_L2_STATUS);
41
42 if (likely(l2status == ESE_GZ_RH_HCLASS_L2_STATUS_OK))
43 /* Everything is ok */
> 44 return 0;
45
46 if (l2status == ESE_GZ_RH_HCLASS_L2_STATUS_FCS_ERR)
47 channel->n_rx_eth_crc_err++;
48 return 1;
49 }
50

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip