Re: [PATCH v2] iio: accel: st_accel: inline per-sensor data

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

 



On 16/11/16 09:20, Lorenzo Bianconi wrote:
>> We have #defines for all the individual sensor registers and
>> value/mask pairs #defined at the top of the file and used at
>> exactly one spot.
>>
>> This is usually good if the #defines give a meaning to the
>> opaque magic numbers.
>>
>> However in this case, the semantic meaning is inherent in the
>> name of the C99-addressable fields, and that means duplication
>> of information, and only makes the code hard to maintain since
>> you every time have to add a new #define AND update the site
>> where it is to be used.
>>
>> Get rid of the #defines and just open code the values into the
>> appropriate struct elements. Make sure to explicitly address
>> the .hz and .value fields in the st_sensor_odr_avl struct
>> so that the meaning of all values is clear.
>>
>> This patch is purely syntactic should have no semantic effect.
>>
>> Cc: Lorenzo Bianconi <lorenzo.bianconi83@xxxxxxxxx>
>> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
> Acked-by: Lorenzo Bianconi <lorenzo.bianconi@xxxxxx>
> 
Applied.

Thanks.

Jonathan

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux