Skip to contentSkip to conversation

drivers/net/ethernet/freescale/enetc/enetc.h:84:9: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '130560' to '65024'

DISCUSSION kernel test robot 1 participant 1 message Jan 4

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   54e82e93ca93e49cb4c33988adec5c8cb9d0df31
commit: e59bc32df2e989f034623a580e30a2a72af33b3f net: enetc: correct the value of ENETC_RXB_TRUESIZE
date:   3 months ago
config: powerpc-randconfig-001-20260105 (https://download.01.org/0day-ci/archive/20260105/[email protected]/config)
compiler: powerpc-linux-gcc (GCC) 12.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260105/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from drivers/net/ethernet/freescale/enetc/enetc.c:4:
drivers/net/ethernet/freescale/enetc/enetc.c: In function 'enetc_build_xdp_buff':

>> drivers/net/ethernet/freescale/enetc/enetc.h:84:9: warning: conversion from 'long unsigned int' to 'u16' {aka 'short unsigned int'} changes value from '130560' to '65024' [-Woverflow]
      84 |         (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM)
         |         ^
   drivers/net/ethernet/freescale/enetc/enetc.c:1876:24: note: in expansion of macro 'ENETC_RXB_DMA_SIZE_XDP'
    1876 |                 size = ENETC_RXB_DMA_SIZE_XDP;
         |                        ^~~~~~~~~~~~~~~~~~~~~~

vim +84 drivers/net/ethernet/freescale/enetc/enetc.h

69797ff888d3db Wei Fang        2024-12-19  77  
d4fd0404c1c95b Claudiu Manoil  2019-01-22  78  #define ENETC_RX_MAXFRM_SIZE	ENETC_MAC_MAXFRM_SIZE
e59bc32df2e989 Wei Fang        2025-10-16  79  #define ENETC_RXB_TRUESIZE	(PAGE_SIZE >> 1)
d4fd0404c1c95b Claudiu Manoil  2019-01-22  80  #define ENETC_RXB_PAD		NET_SKB_PAD /* add extra space if needed */
d4fd0404c1c95b Claudiu Manoil  2019-01-22  81  #define ENETC_RXB_DMA_SIZE	\
d4fd0404c1c95b Claudiu Manoil  2019-01-22  82  	(SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - ENETC_RXB_PAD)
d1b15102dd16ad Vladimir Oltean 2021-03-31  83  #define ENETC_RXB_DMA_SIZE_XDP	\

d1b15102dd16ad Vladimir Oltean 2021-03-31 @84 (SKB_WITH_OVERHEAD(ENETC_RXB_TRUESIZE) - XDP_PACKET_HEADROOM)
d4fd0404c1c95b Claudiu Manoil 2019-01-22 85

:::::: The code at line 84 was first introduced by commit
:::::: d1b15102dd16adc17fd5e4db8a485e6459f98906 net: enetc: add support for XDP_DROP and XDP_PASS

:::::: TO: Vladimir Oltean <[email protected]> :::::: CC: David S. Miller <[email protected]>

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki