From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
To: Simon Horman <horms@verge.net.au>
Cc: "linux-kernel@lists.codethink.co.uk"
<linux-kernel@lists.codethink.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Geert Uytterhoeven <geert+renesas@glider.be>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ben Dooks (Codethink)" <ben.dooks@codethink.co.uk>
Subject: RE: [PATCH] usb: renesas_usbhs: fix __le16 warnings
Date: Thu, 17 Oct 2019 02:18:47 +0000 [thread overview]
Message-ID: <TYAPR01MB45440369B72F2C994CF8C85FD86D0@TYAPR01MB4544.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20191016122656.3jpmes4rnz47u5wc@verge.net.au>
Hi Simon-san,
> From: Simon Horman, Sent: Wednesday, October 16, 2019 9:27 PM
<snip>
> > diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c
> > index 4c3de777ef6c..a3c30b609433 100644
> > --- a/drivers/usb/renesas_usbhs/common.c
> > +++ b/drivers/usb/renesas_usbhs/common.c
> > @@ -162,17 +162,17 @@ void usbhs_usbreq_get_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
> > req->bRequest = (val >> 8) & 0xFF;
> > req->bRequestType = (val >> 0) & 0xFF;
> >
> > - req->wValue = usbhs_read(priv, USBVAL);
> > - req->wIndex = usbhs_read(priv, USBINDX);
> > - req->wLength = usbhs_read(priv, USBLENG);
> > + req->wValue = cpu_to_le16(usbhs_read(priv, USBVAL));
> > + req->wIndex = cpu_to_le16(usbhs_read(priv, USBINDX));
> > + req->wLength = cpu_to_le16(usbhs_read(priv, USBLENG));
>
> usbhs_read is backed by readl which performs
> a le->cpu conversion. Rather than have a double conversion
> perhaps it would be nicer to introduce usbhs_read_le.
> Likewise for write.
I'm afraid but, I could not understand these comments.
At the moment, the usbhs_{read,write}() call io{read,write}16(),
not {read,write}l().
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/renesas_usbhs/common.c?h=v5.4-rc3#n62
Best regards,
Yoshihiro Shimoda
>
> > }
> >
> > void usbhs_usbreq_set_val(struct usbhs_priv *priv, struct usb_ctrlrequest *req)
> > {
> > usbhs_write(priv, USBREQ, (req->bRequest << 8) | req->bRequestType);
> > - usbhs_write(priv, USBVAL, req->wValue);
> > - usbhs_write(priv, USBINDX, req->wIndex);
> > - usbhs_write(priv, USBLENG, req->wLength);
> > + usbhs_write(priv, USBVAL, le16_to_cpu(req->wValue));
> > + usbhs_write(priv, USBINDX, le16_to_cpu(req->wIndex));
> > + usbhs_write(priv, USBLENG, le16_to_cpu(req->wLength));
> >
> > usbhs_bset(priv, DCPCTR, SUREQ, SUREQ);
> > }
> > --
> > 2.23.0
> >
next prev parent reply other threads:[~2019-10-17 2:18 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-15 15:50 [PATCH] usb: renesas_usbhs: fix __le16 warnings Ben Dooks (Codethink)
2019-10-15 16:45 ` Geert Uytterhoeven
2019-10-16 2:35 ` Yoshihiro Shimoda
2019-10-16 12:26 ` Simon Horman
2019-10-17 2:18 ` Yoshihiro Shimoda [this message]
2019-10-17 6:57 ` Geert Uytterhoeven
2019-10-17 10:00 ` Simon Horman
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=TYAPR01MB45440369B72F2C994CF8C85FD86D0@TYAPR01MB4544.jpnprd01.prod.outlook.com \
--to=yoshihiro.shimoda.uh@renesas.com \
--cc=ben.dooks@codethink.co.uk \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=horms@verge.net.au \
--cc=linux-kernel@lists.codethink.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@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 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).