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: <CAK8P3a0wU+yAm0X_URFVuM=GragqQnvz2Reto5e09fzqCVrUqQ@mail.gmail.com>
Date:   Wed, 21 Jul 2021 18:12:23 +0200
From:   Arnd Bergmann <arnd@...nel.org>
To:     Andy Shevchenko <andy.shevchenko@...il.com>
Cc:     Jonathan Cameron <jic23@...nel.org>,
        Sean Nyekjaer <sean@...nix.com>, Arnd Bergmann <arnd@...db.de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Linus Walleij <linus.walleij@...aro.org>,
        Stephan Gerhold <stephan@...hold.net>,
        Hans de Goede <hdegoede@...hat.com>,
        Tomas Melin <tomas.melin@...sala.com>,
        Mike Looijmans <mike.looijmans@...ic.nl>,
        Alexandru Ardelean <aardelean@...iqon.com>,
        linux-iio@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iio: accel: fxls8962af: fix i2c dependency

On Wed, Jul 21, 2021 at 5:52 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Wed, Jul 21, 2021 at 6:13 PM Arnd Bergmann <arnd@...nel.org> wrote:
> >
> > From: Arnd Bergmann <arnd@...db.de>
> >
> > With CONFIG_SPI=y and CONFIG_I2C=m, building fxls8962af into vmlinux
> > causes a link error against the I2C module:
> >
> > aarch64-linux-ld: drivers/iio/accel/fxls8962af-core.o: in function `fxls8962af_fifo_flush':
> > fxls8962af-core.c:(.text+0x3a0): undefined reference to `i2c_verify_client'
> >
> > Work around it by adding a Kconfig dependency that forces the SPI driver
> > to be a loadable module whenever I2C is a module.
>
> ...
>
> >  config FXLS8962AF
> >         tristate
> > +       depends on I2C || !I2C # cannot be built-in for modular I2C
>
> Can you enlighten me how this will not be a no-op?

This part does nothing, it only causes a warning when FXLS8962AF
gets selected =y when I2C=m.

The important bit is the other hunk that adds the same dependency
to the FXLS8962AF_SPI symbol, which enforces that either I2C
is completely disabled, or treated as a dependency that prevents
the user from setting FXLS8962AF_SPI=y when that would cause
a link failure.

The effect is similar to a 'depends on SND_SOC_I2C_AND_SPI',
except we only need it on the SPI symbol here because the SPI
core cannot be in a module itself.

        Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ