[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0eee6d96-e4fc-763b-a8b9-52c85ddd5531@hpe.com>
Date: Tue, 3 Sep 2019 07:12:28 -0700
From: Mike Travis <mike.travis@....com>
To: Christoph Hellwig <hch@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Borislav Petkov <bp@...en8.de>,
Dimitri Sivanich <dimitri.sivanich@....com>,
Russ Anderson <russ.anderson@....com>,
Hedi Berriche <hedi.berriche@....com>,
Steve Wahl <steve.wahl@....com>, x86@...nel.org,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH 2/8] x86/platform/uv: Return UV Hubless System Type
On 9/2/2019 11:49 PM, Christoph Hellwig wrote:
>> static inline bool is_early_uv_system(void)
>> {
>> return !((efi.uv_systab == EFI_INVALID_TABLE_ADDR) || !efi.uv_systab);
>
> No need for the inner braces here.
>
> But woudn't this be nicer as:
>
> return efi.uv_systab != EFI_INVALID_TABLE_ADDR && efi.uv_systab;
>
> anyway?
Yes, good catch. It somehow evolved to this but your suggestion is
much more clear.
>
>> +#define is_uv_hubless _is_uv_hubless
>
> Why the weird macro indirection?
>
>> -static inline int is_uv_hubless(void) { return 0; }
>> +static inline int _is_uv_hubless(int uv) { return 0; }
>> +#define is_uv_hubless _is_uv_hubless
>
> And here again.
>
Sorry, I should have explained this better. The problem arises because
we have a number of UV specific kernel modules that support multiple
distributions. And with back porting to earlier distros we cannot
rely on the KERNEL_VERSION macro to define whether the source is being
built for an earlier kernel. So this allows an ifdef on the function
name to discover if the kernel is before or after these changes.
The primary motivation is to avoid referencing the hub structures
when there aren't any, thus avoiding any NULL dereferences. (Similar
to patch 8/8.)
Powered by blists - more mailing lists