Linux-kselftest Archive on lore.kernel.org
 help / color / Atom feed
From: Luis Chamberlain <mcgrof@kernel.org>
To: Scott Branden <scott.branden@broadcom.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Brown <david.brown@linaro.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Shuah Khan <shuah@kernel.org>,
	bjorn.andersson@linaro.org,
	Shuah Khan <skhan@linuxfoundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-fsdevel@vger.kernel.org,
	BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Olof Johansson <olof@lixom.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	Colin Ian King <colin.king@canonical.com>,
	Kees Cook <keescook@chromium.org>, Takashi Iwai <tiwai@suse.de>,
	linux-kselftest@vger.kernel.org, Andy Gross <agross@kernel.org>
Subject: Re: [PATCH] firmware_loader: change enum fw_opt to u32
Date: Fri, 22 May 2020 23:00:25 +0000
Message-ID: <20200522230025.GG11244@42.do-not-panic.com> (raw)
In-Reply-To: <d87aabd0-1195-64ae-d871-b0771be832a8@broadcom.com>

On Fri, May 22, 2020 at 03:49:05PM -0700, Scott Branden wrote:
> Hi Luis,
> 
> On 2020-05-22 3:45 p.m., Luis Chamberlain wrote:
> > On Fri, May 22, 2020 at 02:46:58PM -0700, Scott Branden wrote:
> > >   /**
> > > - * enum fw_opt - options to control firmware loading behaviour
> > > + * fw_opt - options to control firmware loading behaviour
> > >    *
> > >    * @FW_OPT_UEVENT: Enables the fallback mechanism to send a kobject uevent
> > >    *	when the firmware is not found. Userspace is in charge to load the
> > > @@ -33,15 +33,13 @@
> > >    *	the platform's main firmware. If both this fallback and the sysfs
> > >    *      fallback are enabled, then this fallback will be tried first.
> > >    */
> > > -enum fw_opt {
> > > -	FW_OPT_UEVENT			= BIT(0),
> > > -	FW_OPT_NOWAIT			= BIT(1),
> > > -	FW_OPT_USERHELPER		= BIT(2),
> > > -	FW_OPT_NO_WARN			= BIT(3),
> > > -	FW_OPT_NOCACHE			= BIT(4),
> > > -	FW_OPT_NOFALLBACK_SYSFS		= BIT(5),
> > > -	FW_OPT_FALLBACK_PLATFORM	= BIT(6),
> > > -};
> > > +#define FW_OPT_UEVENT			BIT(0)
> > > +#define FW_OPT_NOWAIT			BIT(1)
> > > +#define FW_OPT_USERHELPER		BIT(2)
> > > +#define FW_OPT_NO_WARN			BIT(3)
> > > +#define FW_OPT_NOCACHE			BIT(4)
> > > +#define FW_OPT_NOFALLBACK_SYSFS		BIT(5)
> > > +#define FW_OPT_FALLBACK_PLATFORM	BIT(6)
> > Everything looked good up to here. The enum defines each flag.
> > We just want to use an enum for *one* flag represetnation, not
> > a bundle.
>
> I do not know exactly what you are looking for then.  The FW_OPT_*
> values are OR'd together in the code.  You still want the fw_opt enum
> above left in place entirely and then the values used in OR'd
> together?

Yes, exactly. If they are combined then we just use a u32 to represent
these are then flags combined. An enum represents just *one* flag, not
a set which are OR'd together. Let me know if this is still not clear.

  Luis

  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-22 21:46 Scott Branden
2020-05-22 22:45 ` Luis Chamberlain
2020-05-22 22:49   ` Scott Branden
2020-05-22 23:00     ` Luis Chamberlain [this message]
2020-05-23  6:05       ` Greg Kroah-Hartman
2020-05-23  6:48         ` Luis Chamberlain

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=20200522230025.GG11244@42.do-not-panic.com \
    --to=mcgrof@kernel.org \
    --cc=agross@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bjorn.andersson@linaro.org \
    --cc=colin.king@canonical.com \
    --cc=dan.carpenter@oracle.com \
    --cc=david.brown@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=keescook@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=rafael@kernel.org \
    --cc=scott.branden@broadcom.com \
    --cc=shuah@kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.de \
    --cc=viro@zeniv.linux.org.uk \
    /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

Linux-kselftest Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-kselftest/0 linux-kselftest/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-kselftest linux-kselftest/ https://lore.kernel.org/linux-kselftest \
		linux-kselftest@vger.kernel.org
	public-inbox-index linux-kselftest

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kselftest


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git