linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Randy Dunlap <rdunlap@infradead.org>
Cc: Luis Chamberlain <mcgrof@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Borislav Petkov <bp@suse.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Borislav Petkov <bp@alien8.de>
Subject: Re: [PATCH] firmware_loader: simplfy builtin or module check
Date: Wed, 12 Jan 2022 15:56:39 +0900	[thread overview]
Message-ID: <CAK7LNARiDFpphJrhk5q00d5sSPWAQ2mMLu8Z2YP0Xwk=3WGt3w@mail.gmail.com> (raw)
In-Reply-To: <3e721c69-afa9-6634-2e52-e9a9c2a89372@infradead.org>

On Wed, Jan 12, 2022 at 3:37 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
>
>
> On 1/11/22 18:34, Luis Chamberlain wrote:
> > The existing check is outdated and confuses developers. Use the
> > already existing IS_ENABLED() defined on kconfig.h which makes
> > the intention much clearer.
> >
> > Reported-by: Borislav Petkov <bp@alien8.de>
> > Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
>
> Acked-by: Randy Dunlap <rdunlap@infradead.org>
>
> Thanks.
>
> > ---
> >  include/linux/firmware.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/include/linux/firmware.h b/include/linux/firmware.h
> > index 3b057dfc8284..fa3493dbe84a 100644
> > --- a/include/linux/firmware.h
> > +++ b/include/linux/firmware.h
> > @@ -34,7 +34,7 @@ static inline bool firmware_request_builtin(struct firmware *fw,
> >  }
> >  #endif
> >
> > -#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
>
> The "defined(MODULE)" part wasn't needed here. :)



It _is_ needed.

This seems to be equivalent to IS_REACHABLE(CONFIG_FW_LOADER),
not IS_ENABLE(CONFIG_FW_LOADER).



>
> > +#if IS_ENABLED(CONFIG_FW_LOADER)
> >  int request_firmware(const struct firmware **fw, const char *name,
> >                    struct device *device);
> >  int firmware_request_nowarn(const struct firmware **fw, const char *name,
>
> --
> ~Randy



-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2022-01-12  6:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-12  2:34 [PATCH] firmware_loader: simplfy builtin or module check Luis Chamberlain
2022-01-12  6:37 ` Randy Dunlap
2022-01-12  6:56   ` Masahiro Yamada [this message]
2022-01-12  7:03     ` Randy Dunlap
2022-01-12  7:36       ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK7LNARiDFpphJrhk5q00d5sSPWAQ2mMLu8Z2YP0Xwk=3WGt3w@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=bp@alien8.de \
    --cc=bp@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcgrof@kernel.org \
    --cc=rdunlap@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).