Skip to content

Bluetooth: enable context analysis

Pauli Virtanen linux-bluetooth 2 versions – Applied

Status from this message: This series was applied to bluetooth/bluetooth-next.git (master)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest5 patches 1 replyApplied 5/5
  2. v1 RFC5 patches 3 repliesSuperseded

Changes in v2 from the cover letter

- Add annotations to RFCOMM
- Enable analysis also for BNEP, RFCOMM, HIDP

Patches in v2 All 5 applied

#Subject and filesSizeRepliesApplied
1/5Bluetooth: af_bluetooth: Add minimal context analysis annotationsnet/bluetooth/af_bluetooth.c+5 -21 replyApplied
2/5Bluetooth: hci_core: Add minimal context analysis annotationsnet/bluetooth/hci_core.c+3 -00 repliesApplied
3/5Bluetooth: L2CAP: Add minimal context analysis annotationsnet/bluetooth/l2cap_sock.c+1 -00 repliesApplied
4/5Bluetooth: RFCOMM: Add minimal context analysis annotationsnet/bluetooth/rfcomm/sock.c+1 -00 repliesApplied
5/5Bluetooth: enable context analysisdrivers/bluetooth/Makefile net/bluetooth/Makefile net/bluetooth/bnep/Makefile +2 more+10 -00 repliesApplied

Reviews trailers per patch

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

Read the v2 thread

Cover letter [PATCH v2 0/5] Bluetooth: enable context analysis

v2:
- Add annotations to RFCOMM
- Enable analysis also for BNEP, RFCOMM, HIDP

***

Set up compiler context analysis that generate compiler warnings on problems that Clang -Wthread-safety can detect:

https://docs.kernel.org/dev-tools/context-analysis.html

Sparse locking analysis support was removed in commit 5b63d0ae94ccfd64dcbdb693d88eb3650eb3c64c, this is its successor.

Clang 22 is required, and likely in future Clang 23 [1] (unreleased, use snapshot eg from
https://mirrors.edge.kernel.org/pub/tools/llvm/files/prerelease/ )

This series enables the analysis and adds minimal annotations to remove all warnings.

In future, it probably is a good idea to make more use of it and add __must_hold, __guarded_by etc annotations.

Kernel test robot appears to be checking for these, but not sure in what trees [2]

BlueZ testbot doesn't check these currently but it's possible to add
https://github.com/bluez/action-ci/pull/4

[1] https://lore.kernel.org/all/177996424926.1039918.344230591161201072.tip-bot2@tip-bot2/
[2] https://lore.kernel.org/all/[email protected]/

Pauli Virtanen (5):
Bluetooth: af_bluetooth: Add minimal context analysis annotations
Bluetooth: hci_core: Add minimal context analysis annotations
Bluetooth: L2CAP: Add minimal context analysis annotations
Bluetooth: RFCOMM: Add minimal context analysis annotations
Bluetooth: enable context analysis

 drivers/bluetooth/Makefile    | 2 ++
 net/bluetooth/Makefile        | 2 ++
 net/bluetooth/af_bluetooth.c  | 7 +++++--
 net/bluetooth/bnep/Makefile   | 2 ++
 net/bluetooth/hci_core.c      | 3 +++
 net/bluetooth/hidp/Makefile   | 2 ++
 net/bluetooth/l2cap_sock.c    | 1 +
 net/bluetooth/rfcomm/Makefile | 2 ++
 net/bluetooth/rfcomm/sock.c   | 1 +
 9 files changed, 20 insertions(+), 2 deletions(-)
Signature · 1 line
2.54.0