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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdL1gxMRS0naR33L9as0XGWhe-zW86sk3bQO_xWTSEfqg@mail.gmail.com>
Date:   Sun, 14 Nov 2021 13:46:17 +0200
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     kernel test robot <lkp@...el.com>
Cc:     Nathan Chancellor <nathan@...nel.org>, llvm@...ts.linux.dev,
        kbuild-all@...ts.01.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Hans de Goede <hdegoede@...hat.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Subject: Re: drivers/platform/x86/thinkpad_acpi.c:4475:35: error: unused
 variable 'fwbug_cards_ids'

On Sun, Nov 14, 2021 at 1:42 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
> On Sun, Nov 14, 2021 at 5:15 AM kernel test robot <lkp@...el.com> wrote:
> >
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head:   c8c109546a19613d323a319d0c921cb1f317e629
> > commit: fd96e35ea7b95f1e216277805be89d66e4ae962d platform/x86: thinkpad_acpi: Fix bitwise vs. logical warning
> > date:   4 weeks ago
> > config: i386-buildonly-randconfig-r005-20211114 (attached as .config)
> > compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dddeeafb529e769cde87bd29ef6271ac6bfa5c)
> > 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
> >         # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fd96e35ea7b95f1e216277805be89d66e4ae962d
> >         git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >         git fetch --no-tags linus master
> >         git checkout fd96e35ea7b95f1e216277805be89d66e4ae962d
> >         # save the attached .config to linux build tree
> >         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=i386
> >
> > If you fix the issue, kindly add following tag as appropriate
> > Reported-by: kernel test robot <lkp@...el.com>
> >
> > All errors (new ones prefixed by >>):
> >
> > >> drivers/platform/x86/thinkpad_acpi.c:4475:35: error: unused variable 'fwbug_cards_ids' [-Werror,-Wunused-const-variable]
> >    static const struct pci_device_id fwbug_cards_ids[] __initconst = {
> >                                      ^
> >    1 error generated.
>
> Perhaps something like
>
>   if (!dmi_check_system(bt_fwbug_list))
>     return 0;
>   if (!pci_dev_present(fwbug_cards_ids))
>     return 0;
>
>   vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_RFKILL, FW_BUG "disable
> bluetooth subdriver for Intel cards\n");
>   return 1;
>
> would work?

>From the code perspective the complaint by the compiler is false
positive in a sense that it tries to aggressively optimize (which is
fine) followed by "oops, after above we found some unused stuff". I
think it may be hard to see for the compiler the difference between if
(0 && func(x)) and if (0).


-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ