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: <CAOiHx==7TV3879ADbiWGbHT0NysNck4FUQXkXEocjkD2BzEoRA@mail.gmail.com>
Date:   Mon, 24 Apr 2023 10:20:20 +0200
From:   Jonas Gorski <jonas.gorski@...il.com>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     Dhruva Gole <d-gole@...com>, Mark Brown <broonie@...nel.org>,
        Vaishnav Achath <vaishnav.a@...com>, Vignesh <vigneshr@...com>,
        Apurva Nandan <a-nandan@...com>,
        linux-arm-kernel@...ts.infradead.org, linux-spi@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Grant Likely <grant.likely@...retlab.ca>,
        Tanguy Bouzeloc <tanguy.bouzeloc@...xo.com>
Subject: Re: [PATCH] spi: bcm63xx: remove PM_SLEEP based conditional compilation

On Fri, 21 Apr 2023 at 19:17, Florian Fainelli <f.fainelli@...il.com> wrote:
>
> On 4/20/23 05:16, Dhruva Gole wrote:
> > Get rid of conditional compilation based on CONFIG_PM_SLEEP because
> > it may introduce build issues with certain configs where it maybe disabled
> > This is because if above config is not enabled the suspend-resume
> > functions are never part of the code but the bcm63xx_spi_pm_ops struct
> > still inits them to non-existent suspend-resume functions.
> >
> > Fixes: b42dfed83d95 ("spi: add Broadcom BCM63xx SPI controller driver")
> >
> > Signed-off-by: Dhruva Gole <d-gole@...com>
> > ---
> >   drivers/spi/spi-bcm63xx.c | 2 --
> >   1 file changed, 2 deletions(-)
> >
> > diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
> > index 96633a0051b1..99395932074c 100644
> > --- a/drivers/spi/spi-bcm63xx.c
> > +++ b/drivers/spi/spi-bcm63xx.c
> > @@ -617,7 +617,6 @@ static void bcm63xx_spi_remove(struct platform_device *pdev)
> >       clk_disable_unprepare(bs->clk);
> >   }
> >
> > -#ifdef CONFIG_PM_SLEEP
> >   static int bcm63xx_spi_suspend(struct device *dev)
>
> Don't we need a __maybe_unused here?

Actually the premise of this patch is wrong, and should rather be reverted.

The bcm63xx_spi_pm_ops struct is initialized with
SET_SYSTEM_SLEEP_PM_OPS(), which is defined as

#ifdef CONFIG_PM_SLEEP
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn) \
SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#else
#define SET_SYSTEM_SLEEP_PM_OPS(suspend_fn, resume_fn)
#endif

so for !CONFIG_PM_SLEEP it won't initialize the struct at all (or
reference non-existing functions), and therefore there will be no
build issues.

Regards,
Jonas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ