From: Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mika Westerberg
<mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
"Rafael J. Wysocki"
<rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] spi: Clean up probe and remove functions
Date: Fri, 14 Feb 2014 19:22:09 +0100 [thread overview]
Message-ID: <1392402129.4365.51.camel@chaos.site> (raw)
In-Reply-To: <20140214150341.GC4451-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
Hi Mark,
Le Friday 14 February 2014 à 15:03 +0000, Mark Brown a écrit :
> On Thu, Feb 13, 2014 at 03:28:41PM +0100, Jean Delvare wrote:
> > While backporting 33cf00e5 ("spi: attach/detach SPI device to the ACPI
> > power domain"), I noticed that the code changes were suboptimal:
> >
> > * Why use &spi->dev when we have dev at hand?
> >
> > * After fixing the above, spi is used only once, so we don't really
> > need a local variable for it.
>
> I've applied this but I have to say it's a bit marginal as a cleanup -
> for example while we do only use the SPI device once it's not entirely
> idiomatic to use to_spi_device() in the middle of the code rather than
> at the top of the function so it's a small speed bump to see that.
I don't disagree. The rationale for the change is that I simply reverted
to how the code was before 33cf00e5, assuming that the introduction of
spi as a local variable was caused by it being used more than once. If
you believe this was a good change on its own and would prefer to keep
it that way, I could send a patch replacing this one and only changing
&spi->dev to dev. Let me know.
And yes, this is not the most groundbreaking patch either way,
granted ;-)
--
Jean Delvare
Suse L3 Support
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-02-14 18:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 14:28 [PATCH] spi: Clean up probe and remove functions Jean Delvare
[not found] ` <20140213152841.390de00f-R0o5gVi9kd7kN2dkZ6Wm7A@public.gmane.org>
2014-02-13 15:14 ` Rafael J. Wysocki
2014-02-14 15:03 ` Mark Brown
[not found] ` <20140214150341.GC4451-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-02-14 18:22 ` Jean Delvare [this message]
[not found] ` <1392402129.4365.51.camel-H7Kp9ZFCxt/N0uC3ymp8PA@public.gmane.org>
2014-02-16 0:40 ` Mark Brown
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=1392402129.4365.51.camel@chaos.site \
--to=jdelvare-l3a5bk7wagm@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
--cc=rafael.j.wysocki-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).