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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 28 Dec 2021 09:37:09 +0100
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     kernel test robot <lkp@...el.com>
Cc:     Atish Patra <atishp@...osinc.com>, llvm@...ts.linux.dev,
        kbuild-all@...ts.01.org, Atish Patra <Atish.Patra@....com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [atishp04:isa_ext_support 3/4] arch/riscv/kernel/cpufeature.c:82:24:
 warning: address of array 'edata->dtprop' will always evaluate to 'true'

On Tue, Dec 28, 2021 at 9:21 AM kernel test robot <lkp@...el.com> wrote:
> tree:   https://github.com/atishp04/linux isa_ext_support
> head:   cf2f3fa532aa7c672f681ca0685046c738bfb45f
> commit: ae97a995345b68c472f3a904fc8fbefaa97ae26a [3/4] RISC-V: Provide a framework for parsing multi-letter ISA extensions
> config: riscv-randconfig-c006-20211226 (https://download.01.org/0day-ci/archive/20211228/202112280309.fgjGevFd-lkp@intel.com/config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 0c553cc1af2e4c14100df6cf4a6fc91987e778e6)
> 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 riscv cross compiling tool for clang build
>         # apt-get install binutils-riscv64-linux-gnu
>         # https://github.com/atishp04/linux/commit/ae97a995345b68c472f3a904fc8fbefaa97ae26a
>         git remote add atishp04 https://github.com/atishp04/linux
>         git fetch --no-tags atishp04 isa_ext_support
>         git checkout ae97a995345b68c472f3a904fc8fbefaa97ae26a
>         # 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=riscv SHELL=/bin/bash arch/riscv/kernel/
>
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
>
> All warnings (new ones prefixed by >>):
>
> >> arch/riscv/kernel/cpufeature.c:82:24: warning: address of array 'edata->dtprop' will always evaluate to 'true' [-Wpointer-bool-conversion]
>            if (!edata || !edata->dtprop)
>                          ~~~~~~~~^~~~~~
>    1 warning generated.
>
>
> vim +82 arch/riscv/kernel/cpufeature.c
>
>     76
>     77  int riscv_isa_ext_list_add(struct riscv_isa_ext_data *edata)
>     78  {
>     79          struct device_node *node, *enode;
>     80          int eid;
>     81
>   > 82          if (!edata || !edata->dtprop)

if (!edata || !edata->dtprop[0])

>     83                  return -EINVAL;
>     84
>     85          node = of_find_node_by_path("/cpus");
>     86          if (!node) {
>     87                  pr_err("No CPU information found in DT\n");
>     88                  return -ENOENT;
>     89          }

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ