public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
@ 2012-05-03 22:07 Michael Davidson
  2012-05-03 22:12 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Davidson @ 2012-05-03 22:07 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

[PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions

DEVICE_INT_ATTR() should use device_show_int() and device_store_int()
not device_show_ulong() and device_store_ulong()

Signed-off-by: Michael Davidson <md@google.com>
---

--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -508,7 +508,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);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
  2012-05-03 22:07 [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions Michael Davidson
@ 2012-05-03 22:12 ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2012-05-03 22:12 UTC (permalink / raw)
  To: Michael Davidson; +Cc: linux-kernel

On Thu, May 03, 2012 at 03:07:47PM -0700, Michael Davidson wrote:
> [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
> 
> DEVICE_INT_ATTR() should use device_show_int() and device_store_int()
> not device_show_ulong() and device_store_ulong()
> 
> Signed-off-by: Michael Davidson <md@google.com>
> ---
> 
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -508,7 +508,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) }

Something odd happened with your patch, and I can't apply it :(

Care to try again?


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
@ 2012-05-03 23:19 Michael Davidson
  2012-05-03 23:32 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Davidson @ 2012-05-03 23:19 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel

[PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions

DEVICE_INT_ATTR() should use device_show_int() and device_store_int()
not device_show_ulong() and device_store_ulong()

Signed-off-by: Michael Davidson <md@google.com>
---

--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -508,7 +508,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);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
  2012-05-03 23:19 Michael Davidson
@ 2012-05-03 23:32 ` Greg KH
  2012-05-03 23:39   ` Michael Davidson
  0 siblings, 1 reply; 5+ messages in thread
From: Greg KH @ 2012-05-03 23:32 UTC (permalink / raw)
  To: Michael Davidson; +Cc: linux-kernel

On Thu, May 03, 2012 at 04:19:02PM -0700, Michael Davidson wrote:
> [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions

This line isn't needed again in the patch body like this :(

> DEVICE_INT_ATTR() should use device_show_int() and device_store_int()
> not device_show_ulong() and device_store_ulong()
> 
> Signed-off-by: Michael Davidson <md@google.com>

Is this something that fixes a problem you have seen, so it needs to go
in now, and backported to stable kernel releases, or can it wait for 3.5
and you found it just by looking at the code?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
  2012-05-03 23:32 ` Greg KH
@ 2012-05-03 23:39   ` Michael Davidson
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Davidson @ 2012-05-03 23:39 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

I found the problem while porting some code to 3.3.

It looks as if the mce driver uses int attributes for a few things so I assume
that is broken but I have not actually verified it.

thanks,

md

On Thu, May 3, 2012 at 4:32 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, May 03, 2012 at 04:19:02PM -0700, Michael Davidson wrote:
>> [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions
>
> This line isn't needed again in the patch body like this :(
>
>> DEVICE_INT_ATTR() should use device_show_int() and device_store_int()
>> not device_show_ulong() and device_store_ulong()
>>
>> Signed-off-by: Michael Davidson <md@google.com>
>
> Is this something that fixes a problem you have seen, so it needs to go
> in now, and backported to stable kernel releases, or can it wait for 3.5
> and you found it just by looking at the code?
>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-03 23:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-03 22:07 [PATCH] driver-core: fix DEVICE_INT_ATTR to use correct show/store functions Michael Davidson
2012-05-03 22:12 ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2012-05-03 23:19 Michael Davidson
2012-05-03 23:32 ` Greg KH
2012-05-03 23:39   ` Michael Davidson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox