All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suniel Mahesh <sunil.m@techveda.org>
To: Joe Perches <joe@perches.com>, Gilad Ben-Yossef <gilad@benyossef.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux Crypto Mailing List <linux-crypto@vger.kernel.org>,
	driverdev-devel@linuxdriverproject.org,
	devel@driverdev.osuosl.org,
	Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	karthik@techveda.org
Subject: Re: [PATCH] staging: ccree: local variable "dev" not required
Date: Fri, 6 Oct 2017 09:37:06 +0530	[thread overview]
Message-ID: <f53ea8d6-c31d-cc26-e99c-a7a3f23e6059@techveda.org> (raw)
In-Reply-To: <1507226431.4434.37.camel@perches.com>

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 

      reply	other threads:[~2017-10-06  4:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-04 19:12 [PATCH] staging: ccree: local variable "dev" not required sunil.m
2017-10-05  7:07 ` Gilad Ben-Yossef
2017-10-05 18:00   ` Joe Perches
2017-10-06  4:07     ` Suniel Mahesh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f53ea8d6-c31d-cc26-e99c-a7a3f23e6059@techveda.org \
    --to=sunil.m@techveda.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gilad@benyossef.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=karthik@techveda.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.