lkml.org 
[lkml]   [2013]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/6] PowerCap: Add class driver
On 10/04/2013 09:51 AM, Greg KH wrote:
> On Fri, Oct 04, 2013 at 09:36:52AM -0700, Srinivas Pandruvada wrote:
>> +/* Power zone ro attributes define */
>> +#define powercap_attr_ro(_name) \
>> + static DEVICE_ATTR(_name, 0444, show_##_name, NULL)
>> +
>> +/* Power zone rw attributes define */
>> +#define powercap_attr_rw(_name) \
>> + static DEVICE_ATTR(_name, 0644, show_##_name, store_##_name)
>> +
>> +/* constraint attributes define rw */
>> +#define powercap_const_attr_rw(_name) \
>> + static DEVICE_ATTR(_name, 0644, show_constraint_##_name, \
>> + store_constraint_##_name)
>> +/* constraint attributes define ro */
>> +#define powercap_const_attr_ro(_name) \
>> + static DEVICE_ATTR(_name, 0644, show_constraint_##_name, NULL)
> Minor nit:
>
> Why are you using your own defines, why not just use the
> DEVICE_ATTR_RO() and DEVICE_ATTR_RW() macros? That way it makes it
> easier to grep for attributes, and ensure they have set the mode bits
> properly.
I will replace in the next patchset.

Thanks,
Srinivas





\
 
 \ /
  Last update: 2013-10-04 22:21    [W:3.164 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site