* [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems
@ 2016-03-23 4:28 Stephen Warren
2016-03-23 5:03 ` Marek Vasut
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Stephen Warren @ 2016-03-23 4:28 UTC (permalink / raw)
To: u-boot
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.
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;
--
2.7.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems
2016-03-23 4:28 [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems Stephen Warren
@ 2016-03-23 5:03 ` Marek Vasut
2016-03-23 16:15 ` Joe Hershberger
2016-04-02 1:55 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Marek Vasut @ 2016-03-23 5:03 UTC (permalink / raw)
To: u-boot
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems
2016-03-23 4:28 [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems Stephen Warren
2016-03-23 5:03 ` Marek Vasut
@ 2016-03-23 16:15 ` Joe Hershberger
2016-04-02 1:55 ` [U-Boot] " Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Joe Hershberger @ 2016-03-23 16:15 UTC (permalink / raw)
To: u-boot
On Tue, Mar 22, 2016 at 11:28 PM, Stephen Warren <swarren@wwwdotorg.org> 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.
>
> Reported-by: Eric Anholt <eric@anholt.net>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] smsc95xx: fix operation on 64-bit systems
2016-03-23 4:28 [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems Stephen Warren
2016-03-23 5:03 ` Marek Vasut
2016-03-23 16:15 ` Joe Hershberger
@ 2016-04-02 1:55 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2016-04-02 1:55 UTC (permalink / raw)
To: u-boot
On Tue, Mar 22, 2016 at 10:28:16PM -0600, 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.
>
> Reported-by: Eric Anholt <eric@anholt.net>
> Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
> Acked-by: Marek Vasut <marex@denx.de>
> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160401/5d9d0d0b/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-04-02 1:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-23 4:28 [U-Boot] [PATCH] smsc95xx: fix operation on 64-bit systems Stephen Warren
2016-03-23 5:03 ` Marek Vasut
2016-03-23 16:15 ` Joe Hershberger
2016-04-02 1:55 ` [U-Boot] " Tom Rini
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.