public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems
Date: Wed, 23 Mar 2016 06:03:11 +0100	[thread overview]
Message-ID: <56F2238F.8070601@denx.de> (raw)
In-Reply-To: <1458707296-16271-1-git-send-email-swarren@wwwdotorg.org>

On 03/23/2016 05:28 AM, Stephen Warren wrote:
> smsc95xx_read_reg() should calculate sizeof(*data) not sizeof(data) since
> data is a pointer, and the value pointed at is being transferred over USB,
> not the value of the pointer. This fixes operation of the driver in 64-bit
> builds, such as the Raspberry Pi 3.

Thanks!

Acked-by: Marek Vasut <marex@denx.de>

> Reported-by: Eric Anholt <eric@anholt.net>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> ---
>  drivers/usb/eth/smsc95xx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/eth/smsc95xx.c b/drivers/usb/eth/smsc95xx.c
> index 3099bf4fd4e5..08eaed5c2e03 100644
> --- a/drivers/usb/eth/smsc95xx.c
> +++ b/drivers/usb/eth/smsc95xx.c
> @@ -188,10 +188,10 @@ static int smsc95xx_read_reg(struct usb_device *udev, u32 index, u32 *data)
>  	len = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0),
>  			      USB_VENDOR_REQUEST_READ_REGISTER,
>  			      USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
> -			      0, index, tmpbuf, sizeof(data),
> +			      0, index, tmpbuf, sizeof(*data),
>  			      USB_CTRL_GET_TIMEOUT);
>  	*data = tmpbuf[0];
> -	if (len != sizeof(data)) {
> +	if (len != sizeof(*data)) {
>  		debug("smsc95xx_read_reg failed: index=%d, len=%d",
>  		      index, len);
>  		return -EIO;
> 


-- 
Best regards,
Marek Vasut

  reply	other threads:[~2016-03-23  5:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-23  4:28 [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems Stephen Warren
2016-03-23  5:03 ` Marek Vasut [this message]
2016-03-23 16:15 ` Joe Hershberger
2016-04-02  1:55 ` [U-Boot] " Tom Rini

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=56F2238F.8070601@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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