lkml.org 
[lkml]   [2017]   [Oct]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] staging: ccree: local variable "dev" not required
Date
On Thursday 05 October 2017 11:30 PM, Joe Perches wrote:
> On Thu, 2017-10-05 at 10:07 +0300, Gilad Ben-Yossef wrote:
>> On Wed, Oct 4, 2017 at 10:12 PM, <sunil.m@techveda.org> wrote:
>>> There is no need to create a local pointer variable "dev" and
>>> pass it various API's, instead use plat_dev which is enumerated
>>> by platform core on successful probe.
> []
>> I'm sorry but I don't understand what is the problem you are trying to solve or
>> what is the improvement suggested.

Hi Gilad and all,

Actually this patch is not a major improvement nor trying to solve some thing.

As struct device is a member of struct platform_device, I thought why can't we use
plat_dev (pointer to struct platform_device) through out the code. May be I was trying
to make code look compact, may be I am wrong.

>>
>> Why is having a local variable undesirable? I think having it makes
>> the code more readable, not less.
>
> IMO: The local variable is _not_ undesirable.
> It does make the code more readable and
> shortens line lengths too.
>

Yes, as you guys pointed out, we can use local variables. It is definitely making
the code more readable and shortening line lengths.

Please drop the patch, if this not helping the code look better.

Thanks
Suniel

\
 
 \ /
  Last update: 2017-10-06 06:07    [W:0.036 / U:3.596 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site