[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.2408251449540.30766@angie.orcam.me.uk>
Date: Sun, 25 Aug 2024 14:56:33 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...am.me.uk>
To: Jiaxun Yang <jiaxun.yang@...goat.com>
cc: Bjørn Mork <bjorn@...k.no>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
"linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
linux-kernel@...r.kernel.org,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] MIPS: fw: Gracefully handle unknown firmware protocols
On Sun, 25 Aug 2024, Jiaxun Yang wrote:
> Maybe something like:
>
> static inline bool valid_fw_arg(unsigned long arg)
> {
> #ifdef CONFIG_64BIT
> if (arg >= XKPHYS && arg < XKSEG)
> return TRUE;
> #endif
> return arg >= CKSEG0 && arg < CKSSEG;
> }
Or rather:
if (IS_ENABLED(CONFIG_64BIT) && arg >= XKPHYS && arg < XKSEG)
return TRUE;
as we want to avoid code interspersed with preprocessor conditionals where
possible (cf. "21) Conditional Compilation" in our coding style document,
also for the rationale).
Maciej
Powered by blists - more mailing lists