Commits
Jason Liu committed 28942017c59
LF-697 net: ethernet: freescale: sdk_fman: fix the build warnings The patch fixes the build warnings by adding the comments 'fall through' to avoid the build warnings The patch also initializes the value pgid_val to avoid the warning: ‘pgid_val’ may be used uninitialized The patch should not and will not have any function impact. drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.c: In function ‘ValidateNextEngineParams’: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_cc.c:1681:51: warning: this statement may fall through [-Wimplicit-fallthrough=] In file included from drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c:40: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c: In function ‘GetGenHdrCode’: drivers/net/ethernet/freescale/sdk_fman/inc/error_ext.h:446:12: warning: this statement may fall through [-Wimplicit-fallthrough=] In file included from drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c:40: drivers/net/ethernet/freescale/sdk_fman/inc/error_ext.h:446:12: warning: this statement may fall through [-Wimplicit-fallthrough=] drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c:255:13: note: here 255 | case (HEADER_TYPE_ETH): | ^~~~ In file included from drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c:40: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_kg.c:278:13: note: here 278 | case (HEADER_TYPE_MINENCAP): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c: In function ‘BuildHmct’: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c:673:32: warning: this statement may fall through [-Wimplicit-fallthrough=] 673 | tmpReg = HMCD_INSRT_UDP_LITE; drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Pcd/fm_manip.c:674:21: note: here 674 | case (e_FM_PCD_MANIP_INSRT_BY_HDR_UDP): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c: In function ‘FM_PORT_Config’: arch/arm64/include/asm/io.h:36:22: warning: this statement may fall through [-Wimplicit-fallthrough=] 36 | #define __raw_writel __raw_writel drivers/net/ethernet/freescale/sdk_fman/src/inc/types_linux.h:99:25: note: in expansion of macro ‘__raw_writel’ 99 | #define out_be32(a, v) __raw_writel(__cpu_to_be32(v), a) | ^~~~~~~~~~~~ drivers/net/ethernet/freescale/sdk_fman/src/inc/types_linux.h:121:37: note: in expansion of macro ‘out_be32’ 121 | #define WRITE_UINT32(arg, data) out_be32(&(arg), data)//*(volatile unsigned int *)(&(arg)) = (data) | ^~~~~~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:2404:13: note: in expansion of macro ‘WRITE_UINT32’ 2404 | WRITE_UINT32( p_FmPort->p_FmPortBmiRegs->txPortBmiRegs.fmbm_tfp, | ^~~~~~~~~~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:2407:9: note: here 2407 | case (e_FM_PORT_TYPE_TX_10G): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:2435:60: warning: this statement may fall through [-Wimplicit-fallthrough=] 2435 | p_FmPort->p_FmPortDriverParam->noScatherGather = drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:2438:9: note: here 2438 | case (e_FM_PORT_TYPE_OH_HOST_COMMAND): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c: In function ‘FM_PORT_ModifyCounter’: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:4268:16: warning: this statement may fall through [-Wimplicit-fallthrough=] 4268 | if ((p_FmPort->portType == e_FM_PORT_TYPE_RX) | ^ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:4273:9: note: here 4273 | case (e_FM_PORT_COUNTERS_ENQ_TOTAL): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c: In function ‘SetPcd’: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:1396:24: warning: this statement may fall through [-Wimplicit-fallthrough=] 1396 | tmpReg = NIA_KG_CC_EN; drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/Port/fm_port.c:1397:13: note: here 1397 | case (e_FM_PORT_PCD_SUPPORT_PRS_AND_KG): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c: In function ‘FM_GetCounter’: drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c:4804:16: warning: this statement may fall through [-Wimplicit-fallthrough=] 4804 | if ((p_Fm->p_FmStateStruct->revInfo.majorRev == 4) || | ^ drivers/net/ethernet/freescale/sdk_fman/Peripherals/FM/fm.c:4810:9: note: here 4810 | case (e_FM_COUNTERS_ENQ_TOTAL_FRAME): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c: In function ‘fm_get_counter’: drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c:1803:6: warning: this statement may fall through [-Wimplicit-fallthrough=] 1803 | if (p_fm->p_FmStateStruct->revInfo.majorRev >= 6) | ^ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_sysfs_fm.c:1806:2: note: here 1806 | case (e_FM_COUNTERS_ENQ_TOTAL_FRAME): | ^~~~ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c: In function ‘compat_copy_fm_pcd_cc_next_engine’: drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c:378:33: warning: this statement may fall through [-Wimplicit-fallthrough=] 378 | param->manip_id = compat_pcd_id2ptr(compat_param->manip_id); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c:379:13: note: here 379 | default: | ^~~~~~~ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c:405:40: warning: this statement may fall through [-Wimplicit-fallthrough=] 405 | compat_param->manip_id = compat_pcd_ptr2id(param->manip_id); | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/freescale/sdk_fman/src/wrapper/lnxwrp_ioctls_fm_compat.c:406:13: note: here 406 | default: | ^~~~~~~ In file included from drivers/net/ethernet/mscc/ocelot.h:21, from drivers/net/ethernet/mscc/ocelot_tsn.c:12: drivers/net/ethernet/mscc/ocelot_tsn.c: In function ‘ocelot_seq_gen_set’: include/soc/mscc/ocelot.h:499:48: warning: ‘pgid_val’ may be used uninitialized in this function [-Wmaybe-uninitialized] 499 | #define ocelot_write_rix(ocelot, val, reg, ri) __ocelot_write_ix(ocelot, val, reg, reg##_RSZ * (ri)) | ^~~~~~~~~~~~~~~~~ drivers/net/ethernet/mscc/ocelot_tsn.c:755:5: note: ‘pgid_val’ was declared here 755 | u8 pgid_val, fwdport; Signed-off-by: Jason Liu <jason.hui.liu@nxp.com> Cc: Madalin Bucur <madalin.bucur@nxp.com> Reviewed-by: Fugang Duan <fugang.duan@nxp.com>