Skip to content

"cleanup" variable attribute follow-up

Bastien Nocera linux-bluetooth 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6shared/util: Fix warnings when cleaning up NULL pointerssrc/shared/util.h+1 -12 replies
2/6shared/util: Better type-checking in _steal_* commandssrc/shared/util.h+8 -130 replies
3/6doc: Recommend using _cleanup_ and friendsdoc/maintainer-guidelines.rst+6 -00 replies
4/6main: Use _cleanup_() to simplify configuration parsingsrc/main.c+38 -700 replies
5/6client: Use _cleanup_fd_ to simplify urandom accessclient/mgmt.c+1 -40 replies
6/6btattach: Use _cleanup_fd_ to simplify error pathstools/btattach.c+6 -120 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [BlueZ 0/6] "cleanup" variable attribute follow-up

Follow-up to the partially applied "Add helper for "cleanup" variable attribute" patchset.

This new version:
- fixes the crasher seen starting up bluetoothd
- fixes the warnings seen starting up bluetoothd, seen when free'ing NULL variables
- reimplements the _steal_ functions as macros to better type-check at compile-time
- mentions _steal_ macros in the style docs.

The original patchset also caught a bug in the meson port where the config file path wasn't made absolute, so bluetoothd couldn't find the config file when starting up, so I never saw those warnings and crashes. This bug is now fixed in the meson port branch.

Bastien Nocera (6):
shared/util: Fix warnings when cleaning up NULL pointers shared/util: Better type-checking in _steal_* commands
doc: Recommend using _cleanup_ and friends
main: Use _cleanup_() to simplify configuration parsing
client: Use _cleanup_fd_ to simplify urandom access
btattach: Use _cleanup_fd_ to simplify error paths

 client/mgmt.c                 |   5 +-
 doc/maintainer-guidelines.rst |   6 ++
 src/main.c                    | 108 ++++++++++++----------------------
 src/shared/util.h             |  23 +++-----
 tools/btattach.c              |  18 ++----
 5 files changed, 60 insertions(+), 100 deletions(-)
Signature · 1 line
2.54.0