All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harvey Harrison <harvey.harrison@gmail.com>
To: Bryan Wu <cooloney@kernel.org>
Cc: david-b@pacbell.net, greg@kroah.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jie Zhang <jie.zhang@analog.com>
Subject: Re: [PATCH 1/1] [usb/host]: use get/put_unaligned_* helpers to fix more potential unaligned issues.
Date: Thu, 15 May 2008 08:37:28 -0700	[thread overview]
Message-ID: <1210865849.6191.65.camel@brick> (raw)
In-Reply-To: <1210832364-20012-1-git-send-email-cooloney@kernel.org>

On Thu, 2008-05-15 at 14:19 +0800, Bryan Wu wrote:
> Cc: Harvey Harrison <harvey.harrison@gmail.com>

Looks fine.

Reviewed-by: Harvey Harrison <harvey.harrison@gmail.com>

> Signed-off-by: Jie Zhang <jie.zhang@analog.com>
> Signed-off-by: Bryan Wu <cooloney@kernel.org>
> ---
>  drivers/usb/host/isp116x-hcd.c |    4 ++--
>  drivers/usb/host/uhci-hub.c    |    6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c
> index 20b9a0d..97ac6ff 100644
> --- a/drivers/usb/host/isp116x-hcd.c
> +++ b/drivers/usb/host/isp116x-hcd.c
> @@ -1024,7 +1024,7 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
>  		break;
>  	case GetHubStatus:
>  		DBG("GetHubStatus\n");
> -		*(__le32 *) buf = 0;
> +		put_unaligned_le32(0, buf);
>  		break;
>  	case GetPortStatus:
>  		DBG("GetPortStatus\n");
> @@ -1033,7 +1033,7 @@ static int isp116x_hub_control(struct usb_hcd *hcd,
>  		spin_lock_irqsave(&isp116x->lock, flags);
>  		tmp = isp116x_read_reg32(isp116x, (--wIndex) ? HCRHPORT2 : HCRHPORT1);
>  		spin_unlock_irqrestore(&isp116x->lock, flags);
> -		*(__le32 *) buf = cpu_to_le32(tmp);
> +		put_unaligned_le32(tmp, buf);
>  		DBG("GetPortStatus: port[%d]  %08x\n", wIndex + 1, tmp);
>  		break;
>  	case ClearPortFeature:
> diff --git a/drivers/usb/host/uhci-hub.c b/drivers/usb/host/uhci-hub.c
> index 8e4427a..801fa99 100644
> --- a/drivers/usb/host/uhci-hub.c
> +++ b/drivers/usb/host/uhci-hub.c
> @@ -253,7 +253,7 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>  	switch (typeReq) {
>  
>  	case GetHubStatus:
> -		*(__le32 *)buf = cpu_to_le32(0);
> +		put_unaligned_le32(0, buf);
>  		OK(4);		/* hub power */
>  	case GetPortStatus:
>  		if (port >= uhci->rh_numports)
> @@ -306,8 +306,8 @@ static int uhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
>  			dev_dbg(uhci_dev(uhci), "port %d portsc %04x,%02x\n",
>  					wIndex, status, lstatus);
>  
> -		*(__le16 *)buf = cpu_to_le16(wPortStatus);
> -		*(__le16 *)(buf + 2) = cpu_to_le16(wPortChange);
> +		put_unaligned_le16(wPortStatus, buf);
> +		put_unaligned_le16(wPortChange, buf + 2);
>  		OK(4);
>  	case SetHubFeature:		/* We don't implement these */
>  	case ClearHubFeature:


  parent reply	other threads:[~2008-05-15 15:37 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15  6:19 [PATCH 1/1] [usb/host]: use get/put_unaligned_* helpers to fix more potential unaligned issues Bryan Wu
2008-05-15  7:40 ` Oliver Neukum
2008-05-15  8:03   ` Jie Zhang
2008-05-15  8:09     ` Bryan Wu
2008-05-15  8:36     ` Oliver Neukum
2008-05-15  9:15       ` Jie Zhang
2008-05-15  9:54         ` Bryan Wu
2008-05-15 12:19           ` Oliver Neukum
2008-05-15 13:03             ` David Brownell
2008-05-15 13:27               ` Oliver Neukum
2008-05-15 14:28           ` Alan Stern
2008-05-16  0:33             ` [PATCH] usb: file-storage.c use unaligned access helpers Harvey Harrison
2008-05-16 14:32               ` Alan Stern
2008-05-16 18:09                 ` [RFC-PATCH] lib: add byteorder helpers for the aligned case Harvey Harrison
2008-05-17  0:35                   ` Alan Stern
2008-05-17  0:37                     ` Harvey Harrison
2008-05-15 15:37 ` Harvey Harrison [this message]
2008-05-16  0:05 ` [PATCH 1/1] [usb/host]: use get/put_unaligned_* helpers to fix more potential unaligned issues Andrew Morton

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=1210865849.6191.65.camel@brick \
    --to=harvey.harrison@gmail.com \
    --cc=cooloney@kernel.org \
    --cc=david-b@pacbell.net \
    --cc=greg@kroah.com \
    --cc=jie.zhang@analog.com \
    --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 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.