![]() ![]() The fix is only superficially tested by a ROHM/kionix KX022A driver. String constant and when the sysfs file is read the kernel will accessįixes: 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") The added attribute "wrapping" does not copy the pointer to stored This expectation was not forced by the API - and someĭrivers did register attributes created by IIO_CONST_ATTR(). To silently expect that all attributes given in buffer_attrs array areĭevice-attributes. The iio_triggered_buffer_setup_ext() was changed byĬommit 15097c7a1adc ("iio: buffer: wrap all buffer attributes into iio_dev_attr") ` (2 more replies) 0 siblings, 3 replies 6 messages in thread 10:54 iio: Add IIO_STATIC_CONST_DEVICE_ATTR Matti 10:54 ` Matti Vaittinen ^ raw reply related 6 messages in thread Thanks to Simon Glass for the translation =] ~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~ ~~~ "I don't think so," said Rene Descartes. * Generic attributes of onetype or another */ iio_const_dev_attr_show_#_name, NULL, 0) return sysfs_emit(buf, "%s\n", _string) \ static ssize_t iio_const_dev_attr_show_#_name( \ #define IIO_STATIC_CONST_DEVICE_ATTR(_name, _string) \ Include/linux/iio/sysfs.h | 11 ĭiff -git a/include/linux/iio/sysfs.h b/include/linux/iio/sysfs.h The summy 'show' callback in each individual driver :/ :) And I still think this macro is better than adding ![]() Feel free to suggest something if you guys have more I am not thrilled about how keyword 'static' is handled here but in myĬalendar this day seems to be called the day of the developer without Used when replacing the IIO_CONST_ATTR - attributes for triggeredīuffers because the triggered buffer attributes must be of type Iio_dev_attr which returns constant value. Linux-iio, linux-kernel, linux-arm-kernelĪdd IIO_STATIC_CONST_DEVICE_ATTR macro for creating an read-only Uwe Kleine-König, Matti Vaittinen, Mihail Chindris, Srinivas Pandruvada, Miaoqian Lin, Miquel Raynal, Jonathan Cameron, Eugen Hristev, Nicolas Ferre,Īlexandre Belloni, Claudiu Beznea, Alexandru Ardelean, 10:54 ` iio: Fix unsafe buffer attributes Matti VaittinenĠ siblings, 1 reply 6 messages in threadįrom: Matti Vaittinen 10:54 UTC ( / raw)Ĭc: Cosmin Tanislav, Lars-Peter Clausen, Michael Hennerich, Iio: Add IIO_STATIC_CONST_DEVICE_ATTR archive mirror help / color / mirror / Atom feed * iio: Add IIO_STATIC_CONST_DEVICE_ATTR 10:54 Matti Vaittinen
0 Comments
Leave a Reply. |