Re: [PATCH 5/9] block/mq-deadline: Improve compile-time argument checking

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

 



On 2021/05/28 4:38, Bart Van Assche wrote:
> On 5/26/21 8:24 PM, Damien Le Moal wrote:
>> On 2021/05/27 10:02, Bart Van Assche wrote:
>>> +enum dd_data_dir {
>>> +	DD_READ		= READ,
>>> +	DD_WRITE	= WRITE,
>>> +} __packed;
>>
>> Why the "__packed" here ?
> 
> I agree that using __packed here does not have any advantage. I will
> leave it out.
> 
>>> +
>>> +enum { DD_DIR_COUNT = 2 };
>>
>> Why not a simple #define for this one ?
> 
> I only use the C preprocessor if there is no other solution. As far as I
> know there are no rules in the kernel coding style guidelines with
> regard whether to use a #define or an enum to define a constant?

It is fine as is. I just find it a little too verbose compared to a simple macro
definition. Just a matter of taste I guess :)



-- 
Damien Le Moal
Western Digital Research




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux