RE: [PATCH 4/5] platform/x86/intel/ifs: Implement Array BIST test

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

 



> Why bother with a bitfield?  Just do:

How much "bother" is a bitfield?

> union ifs_array {
>	u64	data;
>	struct {
>		u32	array_bitmask;
>		u16	array_bank;
>		u16	flags;
>	};
>};
>
> Then you only need to mask 'ctrl_result' out of flags.  You don't need
> any crazy macros.

"only need" to special case this one field ... but that's extra
code for humans to read (and humans aren't good at that)
rather than the computer (compiler) which is really good at
doing this.

Using bitfields is also following the existing style of this driver.

-Tony




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

  Powered by Linux