Re: [PATCH 10/13] iio: max9611: Use sysfs_emit()

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

 



On 12/17/21 10:05 AM, Jacopo Mondi wrote:
Hi Lars-Peter,

On Thu, Dec 16, 2021 at 07:52:14PM +0100, Lars-Peter Clausen wrote:
sysfs_emit() is preferred over raw s*printf() for sysfs attributes since it
knows about the sysfs buffer specifics and has some built-in checks for
size and alignment.

Use sysfs_emit() to format the custom `in_power_shunt_resistor` and
`in_current_shunt_resistor` device attributes of the max9611 driver.

Signed-off-by: Lars-Peter Clausen <lars@xxxxxxxxxx>
Looks good, I just wonder if a dependency on the CONFIG_SYSFS symbol
should now be added...

I don't think anything has changed in this regard. The function is called from a sysfs attribute callback. If SYSFS is disabled the callback will not be called. At the same time sysfs_emit() is stubbed out when SYSFS is disabled, so no compile error either.



[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