public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tim Gardner <rtg.canonical@gmail.com>
To: Matt Fleming <matt@console-pimps.org>
Cc: Steve Langasek <steve.langasek@canonical.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
	"H. Peter Anvin" <hpa@zytor.com>, Olof Johansson <olof@lixom.net>,
	Tony Luck <tony.luck@intel.com>, David Airlie <airlied@linux.ie>,
	Corentin Chary <corentincj@iksaif.net>,
	Dave Jiang <dave.jiang@intel.com>,
	Peter Jones <pjones@redhat.com>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	tim.gardner@canonical.com
Subject: Re: [RFC PATCH 1/2] efi: Make 'efi_enabled' a function to query EFI facilities
Date: Fri, 04 Jan 2013 09:42:54 -0700	[thread overview]
Message-ID: <50E7068E.8080101@gmail.com> (raw)
In-Reply-To: <1357316128.8203.33.camel@mfleming-mobl1.ger.corp.intel.com>

On 01/04/2013 09:15 AM, Matt Fleming wrote:
> On Fri, 2013-01-04 at 08:08 -0700, Tim Gardner wrote:
>> On 01/03/2013 06:18 AM, Matt Fleming wrote:
>>> From: Matt Fleming <matt.fleming@intel.com>
>>>
>>
>> snip
>>
>>>   /*
>>> - * We play games with efi_enabled so that the compiler will, if possible, remove
>>> - * EFI-related code altogether.
>>> + * We play games with efi_enabled so that the compiler will, if
>>> + * possible, remove EFI-related code altogether.
>>>    */
>>> +#define EFI_BOOT		0x00000001 /* Were we booted from EFI? */
>>> +#define EFI_SYSTEM_TABLES	0x00000002 /* Can we use EFI system tables? */
>>> +#define EFI_CONFIG_TABLES	0x00000004 /* Can we use EFI config tables? */
>>> +#define EFI_RUNTIME_SERVICES	0x00000004 /* Can we use runtime services? */
>>> +#define EFI_MEMMAP		0x00000008 /* Can we use EFI memory map? */
>>> +#define EFI_64BIT		0x00000010 /* Is the firmware 64-bit? */
>>> +
>>
>> Your use of test_bit() and set_bit() imply that these macros should be
>> bit numbers, not bit masks. It'll work until you define a mask with an
>> integer value greater then 31.
>
> They're not intended to be bitmasks in the sense that no two bits are
> set in each constant (and I am aware of the upper limit).
>
> I have no problem changing the above values to bit numbers if that would
> be less confusing.
>

When you do change them to bit numbers you should also note that 
EFI_CONFIG_TABLES and EFI_RUNTIME_SERVICES have the same value, which I 
believe is in error.

rtg
-- 
Tim Gardner tim.gardner@canonical.com

  parent reply	other threads:[~2013-01-04 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-03 13:18 [RFC PATCH 0/2] EFI facilities bitfield Matt Fleming
2013-01-03 13:18 ` [RFC PATCH 1/2] efi: Make 'efi_enabled' a function to query EFI facilities Matt Fleming
2013-01-03 17:41   ` H. Peter Anvin
2013-01-04 15:08   ` Tim Gardner
2013-01-04 16:15     ` Matt Fleming
2013-01-04 16:17       ` H. Peter Anvin
2013-01-04 16:42       ` Tim Gardner [this message]
2013-01-03 13:18 ` [RFC PATCH 2/2] samsung-laptop: Disable on EFI hardware Matt Fleming

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=50E7068E.8080101@gmail.com \
    --to=rtg.canonical@gmail.com \
    --cc=airlied@linux.ie \
    --cc=corentincj@iksaif.net \
    --cc=dave.jiang@intel.com \
    --cc=hpa@zytor.com \
    --cc=konrad@kernel.org \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@console-pimps.org \
    --cc=mjg59@srcf.ucam.org \
    --cc=olof@lixom.net \
    --cc=pjones@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=steve.langasek@canonical.com \
    --cc=tim.gardner@canonical.com \
    --cc=tony.luck@intel.com \
    /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