Re: [PATCH v1 1/2] eeprom: at24: convert magic numbers to structs.

From: Bartosz Golaszewski
Date: Fri Dec 08 2017 - 10:05:13 EST


2017-12-08 15:10 GMT+01:00 Sven Van Asbroeck <thesven73@xxxxxxxxx>:
> Hi Bartosz, thanks for the encouragement !
>
> Bartosz wrote:
>> Also: please have the AT24/at24 prefix for symbols in the driver.
>
> These specific symbols are declared static, i.e. they're visible only
> inside at24.c.
> Do you think they should still have an at24 prefix ?
>
> +#define DECLARE_AT24_PLATDATA(_name, _len, _flags) \
> + static const struct at24_platform_data platdata_##_name = { \
> + .byte_len = _len, .flags = _flags, \
> + }

Yes, it's a common pattern in the kernel and it adds to readability.

Thanks,
Bartosz