linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [libgpiod v2][PATCH 0/4] core: add gpiod_request_lines
Date: Mon, 4 Apr 2022 17:54:37 +0800	[thread overview]
Message-ID: <20220404095437.GA24083@sol> (raw)
In-Reply-To: <CAMRc=MfqgEozMGR-24O=Eeoo+v2QYc8n_NHPb0A7GYDL_1bL=Q@mail.gmail.com>

On Sat, Apr 02, 2022 at 02:47:31PM +0200, Bartosz Golaszewski wrote:
> On Thu, Mar 31, 2022 at 3:12 AM Kent Gibson <warthog618@gmail.com> wrote:
> >
> > In my review of the CXX bindings I suggested a top-level version of
> > Chip.request_lines(), and possibly a C API version as well, so here
> > is the C version, plus a couple of semi-related tweaks I made along
> > the way.
> >
> > The first patch adds the gpiod_request_lines().
> > Patch 3 migrates the appropriate tools.
> > Patch 4 minimizes the lifetimes of objects in the tools as I've
> > previously seen confusion over how long lived objects need to be.
> > Patch 2 is just a rename cos "inexistent" looks weird to me.
> > Strictly speaking it is fine, but unless there is a problem with
> > using "nonexistent" I would go with the latter.
> >
> > This series may be require my unsigned values patch.
> >
> > Cheers,
> > Kent.
> >
> > Kent Gibson (4):
> >   core: add gpiod_request_lines
> >   tools: rename inexistent to nonexistent
> >   tools: migrate to gpiod_request_lines
> >   tools: minimize object lifetimes
> >
> >  include/gpiod.h            | 15 ++++++++
> >  lib/line-request.c         | 17 +++++++++
> >  tests/tests-line-request.c | 73 ++++++++++++++++++++++++++++++++++++++
> >  tools/gpio-tools-test.bats |  4 +--
> >  tools/gpiodetect.c         |  2 +-
> >  tools/gpiofind.c           |  2 +-
> >  tools/gpioget.c            | 25 +++++++------
> >  tools/gpioinfo.c           |  4 +--
> >  tools/gpiomon.c            | 16 ++++-----
> >  tools/gpioset.c            | 18 +++++-----
> >  tools/tools-common.c       | 50 ++++++++++----------------
> >  tools/tools-common.h       |  5 +--
> >  12 files changed, 164 insertions(+), 67 deletions(-)
> >
> > --
> > 2.35.1
> >
> 
> Ugh, I didn't respond under the C++ review in time before you spent
> time on this. :/
> 

Not a problem - it was just something to fill in time.

> I don't agree with this change. For C API I think the intention for v2
> was to avoid having all kinds of high-level helpers and limit the
> number of functions to only those that are necessary to fully leverage
> the kernel uAPI and this one isn't necessary. I think we discussed it
> multiple times and agreed that the C library needs to be minimal this
> time.
> 
> For C++ and Python the issue is irrelevant because you can do:
> 
> auto request = gpiod::Chip("/dev/gpiochip0").request_lines(req_cfg, line_cfg);
> 
> or
> 
> request = gpiod.Chip("/dev/gpiochip0").request_lines(req_cfg, line_cfg)
> 

The point isn't being able to do a one liner, the point is to remove the
chip object from the set of concerns for the basic use case, and so
provide an easier on-ramp for the casual user.

> respectively and achieve the same result while still using a one-liner.
> 
> Unless there's a *really* good reason to do this, it's a NAK from my side.
> 

That's fine.

Cheers,
Kent.

      reply	other threads:[~2022-04-04  9:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-31  1:11 [libgpiod v2][PATCH 0/4] core: add gpiod_request_lines Kent Gibson
2022-03-31  1:11 ` [libgpiod v2][PATCH 1/4] " Kent Gibson
2022-03-31  1:11 ` [libgpiod v2][PATCH 2/4] tools: rename inexistent to nonexistent Kent Gibson
2022-03-31  1:11 ` [libgpiod v2][PATCH 3/4] tools: migrate to gpiod_request_lines Kent Gibson
2022-03-31  1:11 ` [libgpiod v2][PATCH 4/4] tools: minimize object lifetimes Kent Gibson
2022-04-02 12:47 ` [libgpiod v2][PATCH 0/4] core: add gpiod_request_lines Bartosz Golaszewski
2022-04-04  9:54   ` Kent Gibson [this message]

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=20220404095437.GA24083@sol \
    --to=warthog618@gmail.com \
    --cc=brgl@bgdev.pl \
    --cc=linux-gpio@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).