lkml.org 
[lkml]   [2019]   [May]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 3/3] backlight: lm3630a: add firmware node support
From
Date
Pavel

On 5/1/19 3:26 AM, Pavel Machek wrote:
> Hi!
>
>>> @@ -396,13 +506,20 @@ static int lm3630a_probe(struct i2c_client *client,
>>> GFP_KERNEL);
>>> if (pdata == NULL)
>>> return -ENOMEM;
>>> +
>>> /* default values */
>>> - pdata->leda_ctrl = LM3630A_LEDA_ENABLE;
>>> - pdata->ledb_ctrl = LM3630A_LEDB_ENABLE;
>>> + pdata->leda_ctrl = LM3630A_LEDA_DISABLE;
>>> + pdata->ledb_ctrl = LM3630A_LEDB_DISABLE;
>>
>> This is not needed since default is disabled and kzalloc will set these to 0
>
> Let compiler do this kind of optimalizations. Code makes sense as-is.
>

Yes the code makes sense but it is unnecessary.

Dan

> Pavel
>

\
 
 \ /
  Last update: 2019-05-01 14:20    [W:0.059 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site