[clk:clk-toshiba 3/4] drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true'

kernel test robot lkp at intel.com
Thu Jan 6 15:13:42 PST 2022


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-toshiba
head:   70faf946ad975c64efb2eb809f9139f304a494b0
commit: b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa [3/4] clk: visconti: Add support common clock driver and reset driver
config: arm64-randconfig-r003-20220106 (https://download.01.org/0day-ci/archive/20220107/202201070705.HU38Acnr-lkp@intel.com/config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project ca7ffe09dc6e525109e3cd570cc5182ce568be13)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/commit/?id=b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa
        git remote add clk https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git
        git fetch --no-tags clk clk-toshiba
        git checkout b4cbe606dc3674b25cb661e7cd1a1c6ddaaafaaa
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/clk/visconti/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

>> drivers/clk/visconti/pll.c:292:20: warning: address of array 'ctx->clk_data.hws' will always evaluate to 'true' [-Wpointer-bool-conversion]
           if (ctx->clk_data.hws && id)
               ~~~~~~~~~~~~~~^~~ ~~
   1 warning generated.


vim +292 drivers/clk/visconti/pll.c

   287	
   288	static void visconti_pll_add_lookup(struct visconti_pll_provider *ctx,
   289					    struct clk_hw *hw_clk,
   290					    unsigned int id)
   291	{
 > 292		if (ctx->clk_data.hws && id)
   293			ctx->clk_data.hws[id] = hw_clk;
   294	}
   295	

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



More information about the linux-arm-kernel mailing list