Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp855964ybr; Fri, 22 May 2020 23:08:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPBCRAJa0uEmRMJF0rcsxPHlFO3Zmi344WTF/EW+kSVyXNOfIun1EgquHx/wpjvyeMfUx2 X-Received: by 2002:a05:6402:74b:: with SMTP id p11mr5955738edy.229.1590214082461; Fri, 22 May 2020 23:08:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590214082; cv=none; d=google.com; s=arc-20160816; b=NCIVzgEEh4xAzV6dPLD6zSZmNysHkPjT83tFAFZwFGaYeJE9MBfOaDFzMsDde1ol9q tgsK0EhAcCd/8DIQBAVsmJkSbQ8xuDg/gXAh+IVhWKtC9noGg+yB2wHdL7rBfXtO2lYC AAPX/mOYjzV3NWlrD9HGwyhGWgtWFRM7jlqFgIvOxk13QtlUCV8AGvANM7XScoW0W5a1 Mm2iuCid+21p8q9NpnJeUAJRwQ3KsIqCBcUORWJJGjsppR2MggOooPkkNLkWE5JkmGcw hbQ3LdzyhNvcuzfVi5C/kAdWqtYCorye3jsZn+tPUgVwWAdx7l3dlySiBP9r1tzwhCcS /Gsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RwSVjDACD9G3i+8eqzK2jObn/1PHdHQidvOVPG5cV+Y=; b=MQL//9uAantUC+LgOWs2oZSV1dj0kf1w5Z3FfxXeFWT3L2S4FR9/LmlUt1x+y4As7z 2DTcfCBYLqyi/NONy8OZl92VakTFS7fnPbo7vWd3ZfVcjFHnjFWFXTOz4lnGkCCMrBSs rOUifZjxksEV+m5MGvEO/wxlnU5jSL+AYqU0ifMaBG3np6vZWSmSwvAO0dlZVTiu3sZJ 7s7wRg8nyneXwbCzytS7jzZvsmqKeGXRkLRXo6tHBVdJdhj4DOtaO+3vOVHFUL81qkpd B6k8Eemb9oOcHlQkeCtIkOWfsrDLUIGKZjtZynJzICt2HB9uWAwJGdxo+iiFay8LBOMX JwWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XjXxc9dw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v26si6329007ejb.314.2020.05.22.23.07.38; Fri, 22 May 2020 23:08:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XjXxc9dw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387604AbgEWGFx (ORCPT + 99 others); Sat, 23 May 2020 02:05:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:39240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387446AbgEWGFx (ORCPT ); Sat, 23 May 2020 02:05:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CACD42072C; Sat, 23 May 2020 06:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590213952; bh=C1Z/ykijQkXEDxKuat87W9+yNZvMZvP4bUwTmC+spjs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XjXxc9dw7SZ93/g6KObshDL9/6CkEB6mKSTSZ0Ay1pyfblZRRPVDdr5XCf3rvjT4J gv58zQ1jkBmwl7eR3xCk35Sw0+etCsWgN0yMuhc3uZ3/Ipa0tfg+XZB7B15nB2PsQQ 8pwI3oHK1JDr5D4U8WMzN86Uiy8HFHwtVoTws6jQ= Date: Sat, 23 May 2020 08:05:48 +0200 From: Greg Kroah-Hartman To: Luis Chamberlain Cc: Scott Branden , David Brown , Alexander Viro , Shuah Khan , bjorn.andersson@linaro.org, Shuah Khan , Arnd Bergmann , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-fsdevel@vger.kernel.org, BCM Kernel Feedback , Olof Johansson , Andrew Morton , Dan Carpenter , Colin Ian King , Kees Cook , Takashi Iwai , linux-kselftest@vger.kernel.org, Andy Gross Subject: Re: [PATCH] firmware_loader: change enum fw_opt to u32 Message-ID: <20200523060548.GA3124611@kroah.com> References: <20200522214658.12722-1-scott.branden@broadcom.com> <20200522224508.GE11244@42.do-not-panic.com> <20200522230025.GG11244@42.do-not-panic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200522230025.GG11244@42.do-not-panic.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 22, 2020 at 11:00:25PM +0000, Luis Chamberlain wrote: > 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. If this is the case, why have an enum at all? What difference is it from a #define like was done here? thanks, greg k-h