lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202408280146.axPqeLlk-lkp@intel.com>
Date: Wed, 28 Aug 2024 01:34:59 +0800
From: kernel test robot <lkp@...el.com>
To: Hongbo Li <lihongbo22@...wei.com>, sam@...dozajonas.com,
	davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
	pabeni@...hat.com, horms@...nel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	lihongbo22@...wei.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next v2 1/2] net/ncsi: Use str_up_down to simplify
 the code

Hi Hongbo,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Hongbo-Li/net-ncsi-Use-str_up_down-to-simplify-the-code/20240827-104622
base:   net-next/main
patch link:    https://lore.kernel.org/r/20240827025246.963115-2-lihongbo22%40huawei.com
patch subject: [PATCH net-next v2 1/2] net/ncsi: Use str_up_down to simplify the code
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20240828/202408280146.axPqeLlk-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 08e5a1de8227512d4774a534b91cb2353cef6284)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240828/202408280146.axPqeLlk-lkp@intel.com/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 <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408280146.axPqeLlk-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   In file included from net/ncsi/ncsi-manage.c:6:
   In file included from include/linux/module.h:19:
   In file included from include/linux/elf.h:6:
   In file included from arch/s390/include/asm/elf.h:181:
   In file included from arch/s390/include/asm/mmu_context.h:11:
   In file included from arch/s390/include/asm/pgalloc.h:18:
   In file included from include/linux/mm.h:2228:
   include/linux/vmstat.h:503:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     503 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     504 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:510:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     510 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     511 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:517:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     517 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:523:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     523 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     524 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   In file included from net/ncsi/ncsi-manage.c:9:
   In file included from include/linux/netdevice.h:38:
   In file included from include/net/net_namespace.h:43:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:548:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     548 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:561:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     561 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
         |                                                           ^
   include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
     102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
         |                                                      ^
   In file included from net/ncsi/ncsi-manage.c:9:
   In file included from include/linux/netdevice.h:38:
   In file included from include/net/net_namespace.h:43:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:574:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     574 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
         |                                                           ^
   include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
     115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
         |                                                      ^
   In file included from net/ncsi/ncsi-manage.c:9:
   In file included from include/linux/netdevice.h:38:
   In file included from include/net/net_namespace.h:43:
   In file included from include/linux/skbuff.h:28:
   In file included from include/linux/dma-mapping.h:11:
   In file included from include/linux/scatterlist.h:9:
   In file included from arch/s390/include/asm/io.h:93:
   include/asm-generic/io.h:585:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     585 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:595:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     595 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:605:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     605 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:693:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     693 |         readsb(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:701:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     701 |         readsw(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:709:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     709 |         readsl(PCI_IOBASE + addr, buffer, count);
         |                ~~~~~~~~~~ ^
   include/asm-generic/io.h:718:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     718 |         writesb(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:727:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     727 |         writesw(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
   include/asm-generic/io.h:736:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     736 |         writesl(PCI_IOBASE + addr, buffer, count);
         |                 ~~~~~~~~~~ ^
>> net/ncsi/ncsi-manage.c:1284:9: error: call to undeclared function 'str_up_down'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    1284 |                                            str_up_down(ncm->data[2] & 0x1));
         |                                            ^
>> net/ncsi/ncsi-manage.c:1284:9: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat]
    1282 |                                            "NCSI: Channel %u added to queue (link %s)\n",
         |                                                                                   ~~
         |                                                                                   %d
    1283 |                                            nc->id,
    1284 |                                            str_up_down(ncm->data[2] & 0x1));
         |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/net/net_debug.h:57:38: note: expanded from macro 'netdev_dbg'
      57 |         dynamic_netdev_dbg(__dev, format, ##args);              \
         |                                   ~~~~~~    ^~~~
   include/linux/dynamic_debug.h:278:19: note: expanded from macro 'dynamic_netdev_dbg'
     278 |                            dev, fmt, ##__VA_ARGS__)
         |                                 ~~~    ^~~~~~~~~~~
   include/linux/dynamic_debug.h:250:59: note: expanded from macro '_dynamic_func_call'
     250 |         _dynamic_func_call_cls(_DPRINTK_CLASS_DFLT, fmt, func, ##__VA_ARGS__)
         |                                                                  ^~~~~~~~~~~
   include/linux/dynamic_debug.h:248:65: note: expanded from macro '_dynamic_func_call_cls'
     248 |         __dynamic_func_call_cls(__UNIQUE_ID(ddebug), cls, fmt, func, ##__VA_ARGS__)
         |                                                                        ^~~~~~~~~~~
   include/linux/dynamic_debug.h:224:15: note: expanded from macro '__dynamic_func_call_cls'
     224 |                 func(&id, ##__VA_ARGS__);                       \
         |                             ^~~~~~~~~~~
   17 warnings and 1 error generated.


vim +/str_up_down +1284 net/ncsi/ncsi-manage.c

  1224	
  1225	static int ncsi_choose_active_channel(struct ncsi_dev_priv *ndp)
  1226	{
  1227		struct ncsi_channel *nc, *found, *hot_nc;
  1228		struct ncsi_channel_mode *ncm;
  1229		unsigned long flags, cflags;
  1230		struct ncsi_package *np;
  1231		bool with_link;
  1232	
  1233		spin_lock_irqsave(&ndp->lock, flags);
  1234		hot_nc = ndp->hot_channel;
  1235		spin_unlock_irqrestore(&ndp->lock, flags);
  1236	
  1237		/* By default the search is done once an inactive channel with up
  1238		 * link is found, unless a preferred channel is set.
  1239		 * If multi_package or multi_channel are configured all channels in the
  1240		 * whitelist are added to the channel queue.
  1241		 */
  1242		found = NULL;
  1243		with_link = false;
  1244		NCSI_FOR_EACH_PACKAGE(ndp, np) {
  1245			if (!(ndp->package_whitelist & (0x1 << np->id)))
  1246				continue;
  1247			NCSI_FOR_EACH_CHANNEL(np, nc) {
  1248				if (!(np->channel_whitelist & (0x1 << nc->id)))
  1249					continue;
  1250	
  1251				spin_lock_irqsave(&nc->lock, cflags);
  1252	
  1253				if (!list_empty(&nc->link) ||
  1254				    nc->state != NCSI_CHANNEL_INACTIVE) {
  1255					spin_unlock_irqrestore(&nc->lock, cflags);
  1256					continue;
  1257				}
  1258	
  1259				if (!found)
  1260					found = nc;
  1261	
  1262				if (nc == hot_nc)
  1263					found = nc;
  1264	
  1265				ncm = &nc->modes[NCSI_MODE_LINK];
  1266				if (ncm->data[2] & 0x1) {
  1267					found = nc;
  1268					with_link = true;
  1269				}
  1270	
  1271				/* If multi_channel is enabled configure all valid
  1272				 * channels whether or not they currently have link
  1273				 * so they will have AENs enabled.
  1274				 */
  1275				if (with_link || np->multi_channel) {
  1276					spin_lock_irqsave(&ndp->lock, flags);
  1277					list_add_tail_rcu(&nc->link,
  1278							  &ndp->channel_queue);
  1279					spin_unlock_irqrestore(&ndp->lock, flags);
  1280	
  1281					netdev_dbg(ndp->ndev.dev,
  1282						   "NCSI: Channel %u added to queue (link %s)\n",
  1283						   nc->id,
> 1284						   str_up_down(ncm->data[2] & 0x1));
  1285				}
  1286	
  1287				spin_unlock_irqrestore(&nc->lock, cflags);
  1288	
  1289				if (with_link && !np->multi_channel)
  1290					break;
  1291			}
  1292			if (with_link && !ndp->multi_package)
  1293				break;
  1294		}
  1295	
  1296		if (list_empty(&ndp->channel_queue) && found) {
  1297			netdev_info(ndp->ndev.dev,
  1298				    "NCSI: No channel with link found, configuring channel %u\n",
  1299				    found->id);
  1300			spin_lock_irqsave(&ndp->lock, flags);
  1301			list_add_tail_rcu(&found->link, &ndp->channel_queue);
  1302			spin_unlock_irqrestore(&ndp->lock, flags);
  1303		} else if (!found) {
  1304			netdev_warn(ndp->ndev.dev,
  1305				    "NCSI: No channel found to configure!\n");
  1306			ncsi_report_link(ndp, true);
  1307			return -ENODEV;
  1308		}
  1309	
  1310		return ncsi_process_next_channel(ndp);
  1311	}
  1312	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ