Re: [PATCH] MIPS: fw: Gracefully handle unknown firmware protocols

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux