Re: [PATCH 2/3] mdadm: refactor ident->name handling

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

 



On 3/9/23 03:02, Mariusz Tkaczyk wrote:
> On Wed, 8 Mar 2023 14:04:12 -0500
>> Maybe it would be worth starting the enum outside the range of the
>> regular errno so they can overlap? Not sure if it adds any value, just a
>> thought.
>>
> I see no value either.
> What if someone will add new error definition to errno? Should we change our
> enum start then? I think that nobody will notice it until issue but it is
> unlikely too. For that reason I think that it is pointless from the beggining
> because we are defnining rule which won't be honored later.
> 
> I think that we can just to redefine errno codes in enum if they are needed. We
> are free to change particular enum constant value to make room for errno
> compatible codes if there will be need to. That should be safe if some code
> does not have ugly trick like calling external function and comparing it with
> enum constant:
> 
> */ let's say that SUCCESS is 0 */
> if (strncmp(arg, arg1, arg2) == ENUM_STATUS_SUCCESS)
> 
> but it is our job to catch it on review so we are safe here, right? :)

Fair enough

Jes




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux