Re: [PATCH 07/22] mkfs: Move opts related #define to one place

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

 



On Fri, Mar 17, 2017 at 12:25 AM, Luis R. Rodriguez <mcgrof@xxxxxxxxxx> wrote:
> On Wed, Mar 15, 2017 at 05:00:02PM +0100, Jan Tulak wrote:
>> diff --git a/mkfs/xfs_mkfs.c b/mkfs/xfs_mkfs.c
>> index 0877c196..4ba6df05 100644
>> --- a/mkfs/xfs_mkfs.c
>> +++ b/mkfs/xfs_mkfs.c
>> @@ -48,6 +48,80 @@ unsigned int               sectorsize;
>>  #define MAX_CONFLICTS        8
>>  #define LAST_CONFLICT        (-1)
>>
>> +#define OPT_B                0
>> +#define B_LOG                0
>> +#define B_SIZE               1
>
> How about instead using enums, this way if we use kdoc format (hey the new
> kernel doc format is producing nicer docs) we can then document what the
> hell each of these things are nicely. Also, when enums are used in switches
> the compiler will nag at you if you happened to have missed a case, unless you
> have a default.
>
> We could have an enum for the opts and then one for each subopt group.
>
>   Luis

Good point. I kept it as defines, but given how I'm shuffling it, I
might turn it into enum as well. This change should cause no issue
except separating option/suboption definition. I will think about it,
but now I'm more for the enums.

Jan

-- 
Jan Tulak
jtulak@xxxxxxxxxx / jan@xxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux