linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gwendal Grignou <gwendal@chromium.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jonathan Cameron <jic23@kernel.org>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Alexandru Ardelean <ardeleanalex@gmail.com>,
	linux-iio <linux-iio@vger.kernel.org>
Subject: Re: [PATCH v3 1/8] iio: set default trig->dev.parent
Date: Tue, 9 Mar 2021 11:37:27 -0800	[thread overview]
Message-ID: <CAPUE2usUJ2vteXUTXKB0TUgiTeEmfGXxYusQP71UsyrbpybMww@mail.gmail.com> (raw)
In-Reply-To: <CAHp75VeH36QdbU=CQ6KXZK=AHbS5AzSfowAMOCMenO+e+U0zZg@mail.gmail.com>

On Tue, Mar 9, 2021 at 2:00 AM Andy Shevchenko
<andy.shevchenko@gmail.com> wrote:
>
> On Tue, Mar 9, 2021 at 3:18 AM Gwendal Grignou <gwendal@chromium.org> wrote:
> >
> > When allocated with [devm_]iio_trigger_alloc(), set trig device parent to
> > the device the trigger is allocated for by default.
> >
> > It can always be reassigned in the probe routine.
> >
> > Change iio_trigger_alloc() API to add the device pointer to be coherent
> > with devm_iio_trigger_alloc, using similar interface to
> > iio_device_alloc().
>
> Few nit-picks below.
>
> ...
>
> > +static __printf(2, 0)
> > +struct iio_trigger *viio_trigger_alloc(struct device *parent,
>
> > +                                      const char *fmt,
> > +                                      va_list vargs)
>
> Can be one line.
Looking at the rest of the file, when arguments span on multiple
lines, there is only one argument per line: see iio_trigger_read_name
or iio_alloc_pollfunc.
>
> ...
>
> > +/**
> > + * iio_trigger_alloc - Allocate a trigger
> > + * @parent:            Device to allocate iio_trigger for
>
> > + * @fmt:               trigger name format. If it includes format
> > + *                     specifiers, the additional arguments following
> > + *                     format are formatted and inserted in the resulting
> > + *                     string replacing their respective specifiers.
>
> Strange indentation (Everything after the first period should go into
> the main description section). Also inconsistency with capital letters
> at the beginning of field description.
> Yes I have noticed that it's in the original code, but we may do
> better, don't we?
>
> > + * RETURNS:
> > + * Pointer to allocated iio_trigger on success, NULL on failure.
> > + */
>
> ...
>
> > +struct iio_trigger *iio_trigger_alloc(struct device *parent,
> > +                                     const char *fmt, ...)
>
> One line?
Done. Line is over 80 characters, but up to 100 character is now
allowed by checkpatch.pl.
>
> ...
>
> > +struct iio_trigger *devm_iio_trigger_alloc(struct device *parent,
> >                                            const char *fmt, ...);
>
> One line?
Done
>
> ...
>
> > +__printf(2, 3) struct iio_trigger *iio_trigger_alloc(struct device *parent,
> > +                                                    const char *fmt, ...);
>
> Perhaps leave __printf() on the first line and keep everything else on
> the second one?
Done, use the same format as devm_iio_trigger_alloc.

>
> --
> With Best Regards,
> Andy Shevchenko

  reply	other threads:[~2021-03-09 19:38 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  1:18 [PATCH v3 0/8] iio: Set default trigger device parent Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 1/8] iio: set default trig->dev.parent Gwendal Grignou
2021-03-09 10:00   ` Andy Shevchenko
2021-03-09 19:37     ` Gwendal Grignou [this message]
2021-03-09  1:18 ` [PATCH v3 2/8] iio: fix devm_iio_trigger_alloc with parent.cocci Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 3/8] iio: adis_trigger: Remove code to set trigger parent Gwendal Grignou
2021-03-09 10:02   ` Andy Shevchenko
2021-03-09 19:37     ` Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 4/8] iio: gp2ap020a00f: " Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 5/8] iio: lmp91000: " Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 6/8] iio: chemical: atlas: " Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 7/8] iio: as3935: " Gwendal Grignou
2021-03-09  1:18 ` [PATCH v3 8/8] iio: xilinx-xadc: " Gwendal Grignou
2021-03-09 10:04 ` [PATCH v3 0/8] iio: Set default trigger device parent Andy Shevchenko
2021-03-13 18:18   ` 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=CAPUE2usUJ2vteXUTXKB0TUgiTeEmfGXxYusQP71UsyrbpybMww@mail.gmail.com \
    --to=gwendal@chromium.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=ardeleanalex@gmail.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --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;
as well as URLs for NNTP newsgroup(s).