lkml.org 
[lkml]   [2013]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3 07/10] intel_mid: Added custom device_handler support
On 10/14/2013 09:16 AM, Joe Perches wrote:
> On Mon, 2013-10-14 at 09:03 -0700, H. Peter Anvin wrote:
>> On 10/11/2013 08:43 PM, David Cohen wrote:
>>>
>>> /* MSIC subdevices */
>>> - {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data},
>>> - {"msic_gpio", SFI_DEV_TYPE_IPC, 1, &msic_gpio_platform_data},
>>> - {"msic_audio", SFI_DEV_TYPE_IPC, 1, &msic_audio_platform_data},
>>> - {"msic_power_btn", SFI_DEV_TYPE_IPC, 1, &msic_power_btn_platform_data},
>>> - {"msic_ocd", SFI_DEV_TYPE_IPC, 1, &msic_ocd_platform_data},
>>> - {"msic_thermal", SFI_DEV_TYPE_IPC, 1, &msic_thermal_platform_data},
>>> -
>>> + {"msic_battery", SFI_DEV_TYPE_IPC, 1, &msic_battery_platform_data,
>>> + NULL},
>>> + {"msic_gpio", SFI_DEV_TYPE_IPC, 1, &msic_gpio_platform_data, NULL},
>>> + {"msic_audio", SFI_DEV_TYPE_IPC, 1, &msic_audio_platform_data, NULL},
>>> + {"msic_power_btn", SFI_DEV_TYPE_IPC, 1, &msic_power_btn_platform_data,
>>> + NULL},
>>> + {"msic_ocd", SFI_DEV_TYPE_IPC, 1, &msic_ocd_platform_data, NULL},
>>> + {"msic_thermal", SFI_DEV_TYPE_IPC, 1, &msic_thermal_platform_data,
>>> + NULL},
>>> {},
>>> };
>>>
>>
>> For highly regular arrays like this it is better to keep each line a
>> single line even if it gets a bit too long rather than randomly breaking
>> them. The alternative is to put every field of every entry on a
>> separate line, but I don't think that is necessary called for here.
>
> True.
>
> Another option is to #define YA macro to produce the
> SFI_DEV_TYPE_IPC, 1, ... NULL that's common to all of them.

Thanks for your feedback. The parameters happen to be similar at this
time, but they won't be after next patches. I believe a macro could
remove only prefix 'SFI_DEV_TYPE_' and suffix '_platform_data', which
seems enough to reduce line size.

I'll change it in new patch set.

Br, David Cohen



\
 
 \ /
  Last update: 2013-10-14 19:01    [W:0.071 / U:2.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site