Commit cd7798cb authored by Jonathan Cameron's avatar Jonathan Cameron

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: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: default avatarAlexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20200913132115.800131-3-jic23@kernel.org
parent c9561fd2
...@@ -516,7 +516,8 @@ static void iio_trig_subirqunmask(struct irq_data *d) ...@@ -516,7 +516,8 @@ static void iio_trig_subirqunmask(struct irq_data *d)
trig->subirqs[d->irq - trig->subirq_base].enabled = true; trig->subirqs[d->irq - trig->subirq_base].enabled = true;
} }
static struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs) static __printf(1, 0)
struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs)
{ {
struct iio_trigger *trig; struct iio_trigger *trig;
int i; int i;
......
...@@ -691,8 +691,9 @@ static inline void *iio_priv(const struct iio_dev *indio_dev) ...@@ -691,8 +691,9 @@ static inline void *iio_priv(const struct iio_dev *indio_dev)
void iio_device_free(struct iio_dev *indio_dev); void iio_device_free(struct iio_dev *indio_dev);
struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv); struct iio_dev *devm_iio_device_alloc(struct device *parent, int sizeof_priv);
__printf(2, 3)
struct iio_trigger *devm_iio_trigger_alloc(struct device *dev, struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
const char *fmt, ...); const char *fmt, ...);
/** /**
* iio_buffer_enabled() - helper function to test if the buffer is enabled * iio_buffer_enabled() - helper function to test if the buffer is enabled
* @indio_dev: IIO device structure for device * @indio_dev: IIO device structure for device
......
...@@ -38,7 +38,7 @@ struct iio_poll_func { ...@@ -38,7 +38,7 @@ struct iio_poll_func {
}; };
struct iio_poll_func __printf(5, 6) struct iio_poll_func
*iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p), *iio_alloc_pollfunc(irqreturn_t (*h)(int irq, void *p),
irqreturn_t (*thread)(int irq, void *p), irqreturn_t (*thread)(int irq, void *p),
int type, int type,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment