From: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Julia Lawall <Julia.Lawall@lip6.fr>,
kernel-janitors@vger.kernel.org,
Gilles Muller <Gilles.Muller@lip6.fr>,
Nicolas Palix <nicolas.palix@imag.fr>,
Michal Marek <mmarek@suse.com>,
cocci@systeme.lip6.fr,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Benjamin Tissoires <benjamin.tissoires@redhat.com>,
Bastien Nocera <hadess@hadess.net>,
Stephen Just <stephenjust@gmail.com>,
"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <lenb@kernel.org>,
Robert Moore <robert.moore@intel.com>,
Lv Zheng <lv.zheng@intel.com>,
Mika Westerberg <mika.westerberg@linux.intel.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
devel@acpica.org,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: [PATCH] coccinelle: api: detect unnecessary le16_to_cpu
Date: Mon, 3 Jul 2017 19:14:27 +0200 [thread overview]
Message-ID: <20170703171427.qtpodt7watymphac@earth> (raw)
In-Reply-To: <CAHp75VeJY8Xr2H8XK8A7Piu-38TnAeKu5Gn+edtkZmbw2quW0g@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 789 bytes --]
Hi,
On Mon, Jul 03, 2017 at 07:37:59PM +0300, Andy Shevchenko wrote:
> On Mon, Jul 3, 2017 at 4:36 PM, Sebastian Reichel
> <sebastian.reichel@collabora.co.uk> wrote:
> > On Sat, Jul 01, 2017 at 09:28:10PM +0200, Julia Lawall wrote:
>
> > * drivers/gpio/gpio-pca953x.c (line 190-192)
>
> It has double conversion there:
> 1. LE CPU: Read as LE and converted to LE (no-op), so, just u16
> 2. BE CPU: Read as BE and converted to LE, makes it __le16
>
> Looks like the conversion is not needed, only get_unaligned() is necessary.
>
> P.S. What about lines 244-245 there? I think they are no-op.
> Interesting that those two parts were added in quite different
> commits.
val[0] = (u16)ret & 0xFF;
val[1] = (u16)ret >> 8;
looks like cpu_to_be16()?
-- Sebastian
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-07-03 17:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-01 19:28 [PATCH] coccinelle: api: detect unnecessary le16_to_cpu Julia Lawall
2017-07-03 13:36 ` Sebastian Reichel
2017-07-03 16:37 ` Andy Shevchenko
2017-07-03 17:14 ` Sebastian Reichel [this message]
2017-07-03 17:33 ` Andy Shevchenko
2017-07-03 18:20 ` Sebastian Reichel
2017-07-04 9:11 ` Julia Lawall
2017-07-04 9:51 ` Andy Shevchenko
2017-07-04 9:53 ` Julia Lawall
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=20170703171427.qtpodt7watymphac@earth \
--to=sebastian.reichel@collabora.co.uk \
--cc=Gilles.Muller@lip6.fr \
--cc=Julia.Lawall@lip6.fr \
--cc=andy.shevchenko@gmail.com \
--cc=benjamin.tissoires@redhat.com \
--cc=cocci@systeme.lip6.fr \
--cc=devel@acpica.org \
--cc=hadess@hadess.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lv.zheng@intel.com \
--cc=mika.westerberg@linux.intel.com \
--cc=mmarek@suse.com \
--cc=nicolas.palix@imag.fr \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.com \
--cc=stephenjust@gmail.com \
/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).