Skip to contentSkip to conversation

bitops: more BITS_TO_* macros

PATCH Nick Desaulniers 1 participant 1 message Jan 6, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 202001041127.OfJhgtyl%[email protected]

#1 lore raw

Yury,
Apologies if it was already reported (working backwards through emails missed during the holidays), but this warning looks legit. Can you please take a look?

Quoted 72 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Yury Norov <[email protected]>

Hi Yury,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.5-rc4 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Yury-Norov/lib-rework-bitmap_parse/20200104-032153
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7ca4ad5ba886557b67d42242a80f303c3a99ded1
config: arm64-defconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project 8ca79dac559219358b0c6bb00bded30935c7aa6a)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All warnings (new ones prefixed by >>):

In file included from drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c:63:

Quoted 1 line
Quoted 1 line

drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h:299:9: warning: 'BITS_TO_BYTES' macro redefined [-Wmacro-redefined]

   #define BITS_TO_BYTES(x) ((x)/8)
           ^
   include/linux/bitops.h:18:9: note: previous definition is here
   #define BITS_TO_BYTES(nr)       DIV_ROUND_UP(nr, BITS_PER_TYPE(char))
           ^

1 warning generated.

vim +/BITS_TO_BYTES +299 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h

619c5cb6885b93 drivers/net/bnx2x/bnx2x_init.h                   Vlad Zolotarov 2011-06-14  281
619c5cb6885b93 drivers/net/bnx2x/bnx2x_init.h                   Vlad Zolotarov 2011-06-14  282
dbedd44e982d61 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Joe Perches    2015-03-06  283  /* congestion management port init api description
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  284   * the api works as follows:
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  285   * the driver should pass the cmng_init_input struct, the port_init function
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  286   * will prepare the required internal ram structure which will be passed back
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  287   * to the driver (cmng_init) that will write it into the internal ram.
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  288   *
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  289   * IMPORTANT REMARKS:
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  290   * 1. the cmng_init struct does not represent the contiguous internal ram
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  291   *    structure. the driver should use the XSTORM_CMNG_PERPORT_VARS_OFFSET
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  292   *    offset in order to write the port sub struct and the
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  293   *    PFID_FROM_PORT_AND_VNIC offset for writing the vnic sub struct (in other
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  294   *    words - don't use memcpy!).
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  295   * 2. although the cmng_init struct is filled for the maximal vnic number
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  296   *    possible, the driver should only write the valid vnics into the internal
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  297   *    ram according to the appropriate port mode.
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz    2012-04-03  298   */

b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz 2012-04-03 @299 #define BITS_TO_BYTES(x) ((x)/8)
b475d78f464195 drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h Yuval Mintz 2012-04-03 300

:::::: The code at line 299 was first introduced by commit
:::::: b475d78f464195cbdeeda0d80a2ffbd54653a4bd bnx2x: congestion management re-organization

:::::: TO: Yuval Mintz <[email protected]>
:::::: CC: David S. Miller <[email protected]>

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Signature · 2 lines
Thanks,
~Nick Desaulniers