2012-05-08 19:08:47

by Alan Stern

[permalink] [raw]
Subject: [PATCH] device core: fix a copy-paste error

This patch (as1552) fixes a fairly obvious copy-paste error that could
have serious consequences on architectures where sizeof(int) !=
sizeof(unsigned long).

Signed-off-by: Alan Stern <[email protected]>
CC: <[email protected]>

---

This just caught my eye while I was adding another macro immediately
below DEVICE_INT_ATTR.


include/linux/device.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: usb-3.4/include/linux/device.h
===================================================================
--- usb-3.4.orig/include/linux/device.h
+++ usb-3.4/include/linux/device.h
@@ -502,7 +502,7 @@ ssize_t device_store_int(struct device *
{ __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
#define DEVICE_INT_ATTR(_name, _mode, _var) \
struct dev_ext_attribute dev_attr_##_name = \
- { __ATTR(_name, _mode, device_show_ulong, device_store_ulong), &(_var) }
+ { __ATTR(_name, _mode, device_show_int, device_store_int), &(_var) }

extern int device_create_file(struct device *device,
const struct device_attribute *entry);


2012-05-08 22:55:19

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH] device core: fix a copy-paste error

On Tue, May 08, 2012 at 03:08:45PM -0400, Alan Stern wrote:
> This patch (as1552) fixes a fairly obvious copy-paste error that could
> have serious consequences on architectures where sizeof(int) !=
> sizeof(unsigned long).
>
> Signed-off-by: Alan Stern <[email protected]>
> CC: <[email protected]>
>
> ---
>
> This just caught my eye while I was adding another macro immediately
> below DEVICE_INT_ATTR.
>
>
> include/linux/device.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

This is already fixed up in my driver-core-next tree from a patch from
Michael Davidson <[email protected]>.

sorry,

greg k-h