public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Alexandru Ardelean <ardeleanalex@gmail.com>
Cc: linux-iio <linux-iio@vger.kernel.org>,
	Lee Jones <lee.jones@linaro.org>,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>
Subject: Re: [PATCH 2/3] iio: Add __printf() attributes to various allocation functions
Date: Sat, 19 Sep 2020 13:08:01 +0100	[thread overview]
Message-ID: <20200919130801.1085e8c0@archlinux> (raw)
In-Reply-To: <CA+U=DspU3pyM54KgTweoQWAqO0zbJno4pTxaBdzhg0Pz-Bda4g@mail.gmail.com>

On Fri, 18 Sep 2020 16:25:05 +0300
Alexandru Ardelean <ardeleanalex@gmail.com> wrote:

> On Sun, Sep 13, 2020 at 4:24 PM Jonathan Cameron <jic23@kernel.org> wrote:
> >
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > 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
> >  
> 
> Stylistically, it looks like plenty of these attributes are specified
> on a separate line before the function definition.
> Example:
> 
> __printf(1, 0)
> static struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs)
> 
> It doesn't make much difference to me how it's placed.
> 
> Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Thanks. I've tweaked it wrt to both the feedback you gave and that
which Andy gave in the request to review thread.

So on this example we end up with
static printf(..)
struct

Thanks!

Jonathan

> 
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> >  drivers/iio/industrialio-trigger.c   | 2 +-
> >  include/linux/iio/iio.h              | 4 ++--
> >  include/linux/iio/trigger_consumer.h | 2 +-
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/iio/industrialio-trigger.c b/drivers/iio/industrialio-trigger.c
> > index 6f16357fd732..adfe023cad48 100644
> > --- a/drivers/iio/industrialio-trigger.c
> > +++ b/drivers/iio/industrialio-trigger.c
> > @@ -516,7 +516,7 @@ static void iio_trig_subirqunmask(struct irq_data *d)
> >         trig->subirqs[d->irq - trig->subirq_base].enabled = true;
> >  }
> >
> > -static struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs)
> > +__printf(1, 0) static struct iio_trigger *viio_trigger_alloc(const char *fmt, va_list vargs)
> >  {
> >         struct iio_trigger *trig;
> >         int i;
> > diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h
> > index e2df67a3b9ab..a02a3efad794 100644
> > --- a/include/linux/iio/iio.h
> > +++ b/include/linux/iio/iio.h
> > @@ -691,8 +691,8 @@ static inline void *iio_priv(const 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_trigger *devm_iio_trigger_alloc(struct device *dev,
> > -                                               const char *fmt, ...);
> > +__printf(2, 3) struct iio_trigger *devm_iio_trigger_alloc(struct device *dev,
> > +                                                         const char *fmt, ...);
> >  /**
> >   * iio_buffer_enabled() - helper function to test if the buffer is enabled
> >   * @indio_dev:         IIO device structure for device
> > diff --git a/include/linux/iio/trigger_consumer.h b/include/linux/iio/trigger_consumer.h
> > index 3aa2f132dd67..2c05dfad88d7 100644
> > --- a/include/linux/iio/trigger_consumer.h
> > +++ b/include/linux/iio/trigger_consumer.h
> > @@ -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),
> >                     irqreturn_t (*thread)(int irq, void *p),
> >                     int type,
> > --
> > 2.28.0
> >  


  reply	other threads:[~2020-09-19 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-13 13:21 [PATCH 0/3] IIO get to warning free for W=1 C=1 Jonathan Cameron
2020-09-13 13:21 ` [PATCH 1/3] iio:imu:adis16400: Sort out missing kernel doc Jonathan Cameron
2020-09-14  5:52   ` Alexandru Ardelean
2020-09-17 18:02     ` Jonathan Cameron
2020-09-13 13:21 ` [PATCH 2/3] iio: Add __printf() attributes to various allocation functions Jonathan Cameron
2020-09-18 13:25   ` Alexandru Ardelean
2020-09-19 12:08     ` Jonathan Cameron [this message]
2020-09-13 13:21 ` [PATCH 3/3] iio:core: Tidy up kernel-doc Jonathan Cameron
2020-09-18 12:48   ` Alexandru Ardelean
2020-09-19 11:51     ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200919130801.1085e8c0@archlinux \
    --to=jic23@kernel.org \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=ardeleanalex@gmail.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox