Skip to content

treewide: another bunch of cleanups for v2.0

Bartosz Golaszewski linux-gpio 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6treewide: simplify line lookupbindings/cxx/chip.cpp bindings/cxx/examples/gpiofindcxx.cpp bindings/cxx/gpiod.hpp +8 more+66 -1540 replies
2/6tests: remove line bulk test casesbindings/cxx/tests/tests-line.cpp bindings/python/tests/gpiod_py_test.py tests/Makefile.am +1 more+0 -2040 replies
3/6core: switch to reference counting for gpio chip objectsbindings/cxx/chip.cpp bindings/python/gpiodmodule.c include/gpiod.h +8 more+35 -140 replies
4/6treewide: remove is_requested() and is_free()bindings/cxx/gpiod.hpp bindings/cxx/line.cpp bindings/cxx/tests/tests-line.cpp +4 more+7 -1110 replies
5/6treewide: kill line updatingbindings/cxx/gpiod.hpp bindings/cxx/line.cpp bindings/cxx/tests/tests-line.cpp +4 more+7 -770 replies
6/6core: hide the GPIOD_API symbolbindings/cxx/Makefile.am bindings/cxx/chip.cpp bindings/cxx/gpiod.hpp +10 more+441 -4093 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [libgpiod][PATCH 0/6] treewide: another bunch of cleanups for v2.0

From: Bartosz Golaszewski <[email protected]>

Kent suggested I send the patches for v2.0 API in smaller batches for earlier review instead of dropping a huge patch bomb that will require more work from my side and may later be negatively reviewed so here's a hopefully the last part of cleanups that can go into master already before first patches with the new C API will drop.

The idea for the new C API is this: all objects are opaque and refcounted. This is why the chip was converted to reference counting. Lines were removed and their functionality split into line_info and line_request, this is why I'm reworking line lookup to return the HW offset within a chip and not the line object. Other patches are mostly cleanups and cruft shave-off.

Bartosz Golaszewski (6):
treewide: simplify line lookup
tests: remove line bulk test cases
core: switch to reference counting for gpio chip objects
treewide: remove is_requested() and is_free()
treewide: kill line updating
core: hide the GPIOD_API symbol

 bindings/cxx/Makefile.am               |   2 +-
 bindings/cxx/chip.cpp                  |  54 +++---
 bindings/cxx/examples/gpiofindcxx.cpp  |   7 +-
 bindings/cxx/gpiod.hpp                 | 249 ++++++++++++-------------
 bindings/cxx/internal.hpp              |   9 +
 bindings/cxx/iter.cpp                  |  18 +-
 bindings/cxx/line.cpp                  |  86 ++++-----
 bindings/cxx/line_bulk.cpp             |  78 ++++----
 bindings/cxx/tests/tests-chip.cpp      |   6 +-
 bindings/cxx/tests/tests-line.cpp      |  57 ------
 bindings/python/examples/gpiofind.py   |   7 +-
 bindings/python/gpiodmodule.c          | 101 ++--------
 bindings/python/tests/gpiod_py_test.py |  49 +----
 include/gpiod.h                        | 229 +++++++++--------------
 lib/Makefile.am                        |   2 +-
 lib/core.c                             | 195 ++++++++++---------
 lib/helpers.c                          | 155 ++++++---------
 lib/internal.h                         |  11 ++
 lib/misc.c                             |   4 +-
 tests/Makefile.am                      |   1 -
 tests/gpiod-test.h                     |   2 +-
 tests/tests-bulk.c                     | 145 --------------
 tests/tests-chip.c                     |  17 +-
 tools/gpiodetect.c                     |   2 +-
 tools/gpiofind.c                       |  11 +-
 tools/gpioget.c                        |   2 +-
 tools/gpioinfo.c                       |   4 +-
 tools/gpiomon.c                        |   2 +-
 tools/gpioset.c                        |   2 +-
 29 files changed, 547 insertions(+), 960 deletions(-)
 create mode 100644 bindings/cxx/internal.hpp
 create mode 100644 lib/internal.h
 delete mode 100644 tests/tests-bulk.c
Signature · 1 line
2.30.1