Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

iio: Add __printf() attributes to various allocation functions

A partial set of these was added to IIO a long time back.
This fills in some gaps in coverage highlighted by building
with W=1

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200913132115.800131-3-jic23@kernel.org

+5 -3
+2 -1
drivers/iio/industrialio-trigger.c
··· 516 516 trig->subirqs[d->irq - trig->subirq_base].enabled = true; 517 517 } 518 518 519 - static struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs) 519 + static __printf(1, 0) 520 + struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs) 520 521 { 521 522 struct iio_trigger *trig; 522 523 int i;
+2 -1
include/linux/iio/iio.h
··· 691 691 692 692 void iio_device_free(struct iio_dev *indio_dev); 693 693 struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv); 694 + __printf(2, 3) 694 695 struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, 695 - const char *fmt, ...); 696 + const char *fmt, ...); 696 697 /** 697 698 * iio_buffer_enabled() - helper function to test if the buffer is enabled 698 699 * @indio_dev: IIO device structure for device
+1 -1
include/linux/iio/trigger_consumer.h
··· 38 38 }; 39 39 40 40 41 - struct iio_poll_func 41 + __printf(5, 6) struct iio_poll_func 42 42 *iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p), 43 43 irqreturn_t (*thread)(int irq, void *p), 44 44 int type,