[patch] refactor SENSORS_DEV_ATTR: was pc87360 de-macro and code shrink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jean Delvare wrote:

>Hi Jim,
>
>On 2005-07-28, Jim Cromie wrote:
>  
>
>>attached is a patch which:
>>
>>1. adds an __ATTR_N macro to device.h,
>>which takes an extra _index arg, and initializes device_attibute's new
>>.index member.
>>    
>>
>
>This seems to be duplicating the SENSOR_DEVICE_ATTR macro as defined in
>include/linux/hwmon-sysfs.h.
>
>  
>
its almost the same - and was heavily inspired by it.
The difference is that __ATTR_N is a smaller building block,
it has only the RHS of the initialization, it does not have the
variable declaration or the assignment/initialization itself.

So attached patch refactors SENSOR_DEV_ATTR
into a declaration and an initialization expression,
allowing latter to be used in array initializations.


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diff.refactor-sensor-dev-attr-initializer
Url: http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20050728/c32b097a/attachment.pl 


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux