mbox series

[libgpiod,00/14] treewide: start shaving off cruft for v2.0

Message ID 20201210132315.5785-1-brgl@bgdev.pl
Headers show
Series treewide: start shaving off cruft for v2.0 | expand

Message

Bartosz Golaszewski Dec. 10, 2020, 1:23 p.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

The following series removes a lot of interfaces that were deemed overkill
in libgpiod and the removal of which was suggested to me before proceeding
with the new API.

This leaves a couple holes in the library but we'll follow them up with
more improvements all over the tree. We'll create a new object called
gpiod_request for dealing with line requests of arbitrary size. We'll
probably remove the the bulk objects from bindings and eventually we'll
switch to using the v2 kernel uAPI.

Andy - a note for you: I know you're always very thorough in your reviews
but in this case let's consider this series preparing a construction zone
for the new API. Please don't nitpick too much. :)

Bartosz Golaszewski (14):
  bindings: cxx: check for error from gpiod_line_bulk_new()
  build: drop the message about tests having been built successfully
  core: export gpiod_is_gpiochip_device()
  bulk: drop the limit on the max number of lines
  core: drop line iterators
  treewide: kill opening chips by label
  API: move gpiod_line_get_chip() to line attributes section
  core: kill gpiod_line_close_chip()
  core: kill gpiod_line_get()
  treewide: kill global line lookup
  treewide: kill find_lines()
  core: rework gpiod_chip_find_line()
  build: add a configure switch for building examples
  core: kill chip iterators

 bindings/cxx/Makefile.am                |   8 +-
 bindings/cxx/chip.cpp                   |  47 +--
 bindings/cxx/examples/Makefile.am       |   4 +-
 bindings/cxx/examples/gpiodetectcxx.cpp |  13 +-
 bindings/cxx/examples/gpiofindcxx.cpp   |  18 +-
 bindings/cxx/examples/gpioinfocxx.cpp   |  43 ++-
 bindings/cxx/gpiod.hpp                  | 147 +-------
 bindings/cxx/iter.cpp                   |  95 +----
 bindings/cxx/line.cpp                   |  15 -
 bindings/cxx/line_bulk.cpp              |  24 +-
 bindings/cxx/tests/tests-chip.cpp       |  62 ++--
 bindings/cxx/tests/tests-iter.cpp       |  37 --
 bindings/cxx/tests/tests-line.cpp       |  19 -
 bindings/python/Makefile.am             |  10 +-
 bindings/python/examples/gpiodetect.py  |  12 +-
 bindings/python/examples/gpiofind.py    |  15 +-
 bindings/python/examples/gpioinfo.py    |  33 +-
 bindings/python/gpiodmodule.c           | 473 +++++++-----------------
 bindings/python/tests/gpiod_py_test.py  | 100 +----
 configure.ac                            |  12 +
 include/gpiod.h                         | 258 ++-----------
 lib/Makefile.am                         |   2 +-
 lib/core.c                              |  12 +-
 lib/helpers.c                           | 176 +++------
 lib/iter.c                              | 171 ---------
 tests/Makefile.am                       |  13 -
 tests/gpiod-test.h                      |   4 -
 tests/tests-bulk.c                      |   9 -
 tests/tests-chip.c                      |  97 +----
 tests/tests-iter.c                      | 123 ------
 tests/tests-line.c                      |  52 ---
 tools/gpiodetect.c                      |  29 +-
 tools/gpiofind.c                        |  34 +-
 tools/gpioinfo.c                        |  41 +-
 tools/gpiomon.c                         |   5 +-
 tools/tools-common.c                    |  15 +
 tools/tools-common.h                    |   3 +
 37 files changed, 557 insertions(+), 1674 deletions(-)
 delete mode 100644 lib/iter.c
 delete mode 100644 tests/tests-iter.c

Comments

Andy Shevchenko Dec. 10, 2020, 1:56 p.m. UTC | #1
On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> The following series removes a lot of interfaces that were deemed overkill
> in libgpiod and the removal of which was suggested to me before proceeding
> with the new API.
> 
> This leaves a couple holes in the library but we'll follow them up with
> more improvements all over the tree. We'll create a new object called
> gpiod_request for dealing with line requests of arbitrary size. We'll
> probably remove the the bulk objects from bindings and eventually we'll
> switch to using the v2 kernel uAPI.
> 
> Andy - a note for you: I know you're always very thorough in your reviews
> but in this case let's consider this series preparing a construction zone
> for the new API. Please don't nitpick too much. :)

I don't know what you are talking about. The series looks nice, esp. taking
into account statistics! FWIW,

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

One side note, though. Are you already plan to support autotools-2.70?

> Bartosz Golaszewski (14):
>   bindings: cxx: check for error from gpiod_line_bulk_new()
>   build: drop the message about tests having been built successfully
>   core: export gpiod_is_gpiochip_device()
>   bulk: drop the limit on the max number of lines
>   core: drop line iterators
>   treewide: kill opening chips by label
>   API: move gpiod_line_get_chip() to line attributes section
>   core: kill gpiod_line_close_chip()
>   core: kill gpiod_line_get()
>   treewide: kill global line lookup
>   treewide: kill find_lines()
>   core: rework gpiod_chip_find_line()
>   build: add a configure switch for building examples
>   core: kill chip iterators
> 
>  bindings/cxx/Makefile.am                |   8 +-
>  bindings/cxx/chip.cpp                   |  47 +--
>  bindings/cxx/examples/Makefile.am       |   4 +-
>  bindings/cxx/examples/gpiodetectcxx.cpp |  13 +-
>  bindings/cxx/examples/gpiofindcxx.cpp   |  18 +-
>  bindings/cxx/examples/gpioinfocxx.cpp   |  43 ++-
>  bindings/cxx/gpiod.hpp                  | 147 +-------
>  bindings/cxx/iter.cpp                   |  95 +----
>  bindings/cxx/line.cpp                   |  15 -
>  bindings/cxx/line_bulk.cpp              |  24 +-
>  bindings/cxx/tests/tests-chip.cpp       |  62 ++--
>  bindings/cxx/tests/tests-iter.cpp       |  37 --
>  bindings/cxx/tests/tests-line.cpp       |  19 -
>  bindings/python/Makefile.am             |  10 +-
>  bindings/python/examples/gpiodetect.py  |  12 +-
>  bindings/python/examples/gpiofind.py    |  15 +-
>  bindings/python/examples/gpioinfo.py    |  33 +-
>  bindings/python/gpiodmodule.c           | 473 +++++++-----------------
>  bindings/python/tests/gpiod_py_test.py  | 100 +----
>  configure.ac                            |  12 +
>  include/gpiod.h                         | 258 ++-----------
>  lib/Makefile.am                         |   2 +-
>  lib/core.c                              |  12 +-
>  lib/helpers.c                           | 176 +++------
>  lib/iter.c                              | 171 ---------
>  tests/Makefile.am                       |  13 -
>  tests/gpiod-test.h                      |   4 -
>  tests/tests-bulk.c                      |   9 -
>  tests/tests-chip.c                      |  97 +----
>  tests/tests-iter.c                      | 123 ------
>  tests/tests-line.c                      |  52 ---
>  tools/gpiodetect.c                      |  29 +-
>  tools/gpiofind.c                        |  34 +-
>  tools/gpioinfo.c                        |  41 +-
>  tools/gpiomon.c                         |   5 +-
>  tools/tools-common.c                    |  15 +
>  tools/tools-common.h                    |   3 +
>  37 files changed, 557 insertions(+), 1674 deletions(-)
>  delete mode 100644 lib/iter.c
>  delete mode 100644 tests/tests-iter.c
> 
> -- 
> 2.29.1
>
Bartosz Golaszewski Dec. 11, 2020, 8:38 a.m. UTC | #2
On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>

> On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:

> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

> >

> > The following series removes a lot of interfaces that were deemed overkill

> > in libgpiod and the removal of which was suggested to me before proceeding

> > with the new API.

> >

> > This leaves a couple holes in the library but we'll follow them up with

> > more improvements all over the tree. We'll create a new object called

> > gpiod_request for dealing with line requests of arbitrary size. We'll

> > probably remove the the bulk objects from bindings and eventually we'll

> > switch to using the v2 kernel uAPI.

> >

> > Andy - a note for you: I know you're always very thorough in your reviews

> > but in this case let's consider this series preparing a construction zone

> > for the new API. Please don't nitpick too much. :)

>

> I don't know what you are talking about. The series looks nice, esp. taking

> into account statistics! FWIW,

>

> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

>

> One side note, though. Are you already plan to support autotools-2.70?

>


Isn't it already supported? 2.69 is the minimum version, 2.70 should just work.

Bartosz
Andy Shevchenko Dec. 11, 2020, 2:31 p.m. UTC | #3
On Fri, Dec 11, 2020 at 09:38:44AM +0100, Bartosz Golaszewski wrote:
> On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko

> <andriy.shevchenko@linux.intel.com> wrote:

> >

> > On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:

> > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

> > >

> > > The following series removes a lot of interfaces that were deemed overkill

> > > in libgpiod and the removal of which was suggested to me before proceeding

> > > with the new API.

> > >

> > > This leaves a couple holes in the library but we'll follow them up with

> > > more improvements all over the tree. We'll create a new object called

> > > gpiod_request for dealing with line requests of arbitrary size. We'll

> > > probably remove the the bulk objects from bindings and eventually we'll

> > > switch to using the v2 kernel uAPI.

> > >

> > > Andy - a note for you: I know you're always very thorough in your reviews

> > > but in this case let's consider this series preparing a construction zone

> > > for the new API. Please don't nitpick too much. :)

> >

> > I don't know what you are talking about. The series looks nice, esp. taking

> > into account statistics! FWIW,

> >

> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> >

> > One side note, though. Are you already plan to support autotools-2.70?

> >

> 

> Isn't it already supported? 2.69 is the minimum version, 2.70 should just work.


Have you read an article on LWN about changes [1]? There are a lot of
incompatibilities (note between 2.69 and 2.70 _8_ years passed).

[1]: https://lwn.net/Articles/839395/

-- 
With Best Regards,
Andy Shevchenko
Bartosz Golaszewski Dec. 11, 2020, 2:33 p.m. UTC | #4
On Fri, Dec 11, 2020 at 3:30 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>

> On Fri, Dec 11, 2020 at 09:38:44AM +0100, Bartosz Golaszewski wrote:

> > On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko

> > <andriy.shevchenko@linux.intel.com> wrote:

> > >

> > > On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:

> > > > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

> > > >

> > > > The following series removes a lot of interfaces that were deemed overkill

> > > > in libgpiod and the removal of which was suggested to me before proceeding

> > > > with the new API.

> > > >

> > > > This leaves a couple holes in the library but we'll follow them up with

> > > > more improvements all over the tree. We'll create a new object called

> > > > gpiod_request for dealing with line requests of arbitrary size. We'll

> > > > probably remove the the bulk objects from bindings and eventually we'll

> > > > switch to using the v2 kernel uAPI.

> > > >

> > > > Andy - a note for you: I know you're always very thorough in your reviews

> > > > but in this case let's consider this series preparing a construction zone

> > > > for the new API. Please don't nitpick too much. :)

> > >

> > > I don't know what you are talking about. The series looks nice, esp. taking

> > > into account statistics! FWIW,

> > >

> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> > >

> > > One side note, though. Are you already plan to support autotools-2.70?

> > >

> >

> > Isn't it already supported? 2.69 is the minimum version, 2.70 should just work.

>

> Have you read an article on LWN about changes [1]? There are a lot of

> incompatibilities (note between 2.69 and 2.70 _8_ years passed).

>

> [1]: https://lwn.net/Articles/839395/

>

> --

> With Best Regards,

> Andy Shevchenko

>

>


How will distros handle the incompatibilities? I don't think all
projects - many no longer even supported - will suddenly switch to new
autoconf.

Bartosz
Andy Shevchenko Dec. 11, 2020, 2:58 p.m. UTC | #5
On Fri, Dec 11, 2020 at 03:33:41PM +0100, Bartosz Golaszewski wrote:
> On Fri, Dec 11, 2020 at 3:30 PM Andy Shevchenko

> <andriy.shevchenko@linux.intel.com> wrote:

> > On Fri, Dec 11, 2020 at 09:38:44AM +0100, Bartosz Golaszewski wrote:

> > > On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko

> > > <andriy.shevchenko@linux.intel.com> wrote:

> > > > On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:


...

> > > > One side note, though. Are you already plan to support autotools-2.70?

> > >

> > > Isn't it already supported? 2.69 is the minimum version, 2.70 should just work.

> >

> > Have you read an article on LWN about changes [1]? There are a lot of

> > incompatibilities (note between 2.69 and 2.70 _8_ years passed).

> >

> > [1]: https://lwn.net/Articles/839395/

> 

> How will distros handle the incompatibilities? I don't think all

> projects - many no longer even supported - will suddenly switch to new

> autoconf.


It's PITA for distributions. Last time I remember that nice jump from 2.13 to 2.50.
However, 2.69 should be closer to 2.70. I believe the distributions will patch
all broken packages one-by-one. I think there is no need to keep two autoconf
packages together in this case, but who knows, it might be a last resort.

-- 
With Best Regards,
Andy Shevchenko
Bartosz Golaszewski Dec. 11, 2020, 3:06 p.m. UTC | #6
On Fri, Dec 11, 2020 at 3:57 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>

> On Fri, Dec 11, 2020 at 03:33:41PM +0100, Bartosz Golaszewski wrote:

> > On Fri, Dec 11, 2020 at 3:30 PM Andy Shevchenko

> > <andriy.shevchenko@linux.intel.com> wrote:

> > > On Fri, Dec 11, 2020 at 09:38:44AM +0100, Bartosz Golaszewski wrote:

> > > > On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko

> > > > <andriy.shevchenko@linux.intel.com> wrote:

> > > > > On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:

>

> ...

>

> > > > > One side note, though. Are you already plan to support autotools-2.70?

> > > >

> > > > Isn't it already supported? 2.69 is the minimum version, 2.70 should just work.

> > >

> > > Have you read an article on LWN about changes [1]? There are a lot of

> > > incompatibilities (note between 2.69 and 2.70 _8_ years passed).

> > >

> > > [1]: https://lwn.net/Articles/839395/

> >

> > How will distros handle the incompatibilities? I don't think all

> > projects - many no longer even supported - will suddenly switch to new

> > autoconf.

>

> It's PITA for distributions. Last time I remember that nice jump from 2.13 to 2.50.

> However, 2.69 should be closer to 2.70. I believe the distributions will patch

> all broken packages one-by-one. I think there is no need to keep two autoconf

> packages together in this case, but who knows, it might be a last resort.

>

> --

> With Best Regards,

> Andy Shevchenko

>

>


Ok, so responding to your question: I'll upgrade to 2.70 once it's necessary. :)

Bart
Bartosz Golaszewski Dec. 14, 2020, 3:02 p.m. UTC | #7
On Thu, Dec 10, 2020 at 2:55 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>

> On Thu, Dec 10, 2020 at 02:23:01PM +0100, Bartosz Golaszewski wrote:

> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

> >

> > The following series removes a lot of interfaces that were deemed overkill

> > in libgpiod and the removal of which was suggested to me before proceeding

> > with the new API.

> >

> > This leaves a couple holes in the library but we'll follow them up with

> > more improvements all over the tree. We'll create a new object called

> > gpiod_request for dealing with line requests of arbitrary size. We'll

> > probably remove the the bulk objects from bindings and eventually we'll

> > switch to using the v2 kernel uAPI.

> >

> > Andy - a note for you: I know you're always very thorough in your reviews

> > but in this case let's consider this series preparing a construction zone

> > for the new API. Please don't nitpick too much. :)

>

> I don't know what you are talking about. The series looks nice, esp. taking

> into account statistics! FWIW,

>

> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

>


I applied the series so that we can move on. Since we're now getting
per-chip unique lines, we'll probably have to redesign line lookup
again but that's alright.

Bartosz