Skip to contentSkip to conversation

Bluetooth: constify the struct device_type usage

PATCH Applied Ricardo B. Marliere 3 participants 3 messages Feb 19, 2024 – Feb 20, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Bluetooth: constify the struct device_type usage

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the bt_type and bnep_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime.

---
 net/bluetooth/6lowpan.c   | 2 +-
 net/bluetooth/bnep/core.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/6lowpan.c +1 -1
index 215af9b3b589..5c1b8b5bfe71 100644
@@ -572,7 +572,7 @@ static void netdev_setup(struct net_device *dev)
 	dev->needs_free_netdev	= true;
 }
 
-static struct device_type bt_type = {
+static const struct device_type bt_type = {
 	.name	= "bluetooth",
 };
 
net/bluetooth/bnep/core.c +1 -1
index 5a6a49885ab6..8c3f8d0c0358 100644
@@ -549,7 +549,7 @@ static struct device *bnep_get_device(struct bnep_session *session)
 	return &conn->hcon->dev;
 }
 
-static struct device_type bnep_type = {
+static const struct device_type bnep_type = {
 	.name	= "bluetooth",
 };
 

---
base-commit: 64b5c4c8e79c131fe8f135bab5e5dfaa245c5776
change-id: 20240219-device_cleanup-bluetooth-0a01f6ca4752

Best regards,

Signature · 1 line
Ricardo B. Marliere <[email protected]>
#1 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=827595

---Test result---

Test Summary:

CheckPatch                    PASS      0.76 seconds
GitLint                       PASS      0.27 seconds
SubjectPrefix                 PASS      0.10 seconds
BuildKernel                   PASS      27.76 seconds
CheckAllWarning               PASS      30.93 seconds
CheckSparse                   PASS      36.81 seconds
CheckSmatch                   PASS      97.89 seconds
BuildKernel32                 PASS      27.06 seconds
TestRunnerSetup               PASS      500.32 seconds
TestRunner_l2cap-tester       PASS      17.92 seconds
TestRunner_iso-tester         PASS      28.91 seconds
TestRunner_bnep-tester        PASS      4.78 seconds
TestRunner_mgmt-tester        FAIL      170.40 seconds
TestRunner_rfcomm-tester      PASS      11.40 seconds
TestRunner_sco-tester         PASS      14.95 seconds
TestRunner_ioctl-tester       PASS      7.78 seconds
TestRunner_mesh-tester        PASS      5.91 seconds
TestRunner_smp-tester         PASS      6.84 seconds
TestRunner_userchan-tester    PASS      4.92 seconds
IncrementalBuild              PASS      25.97 seconds

Details
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 492, Passed: 485 (98.6%), Failed: 6, Not Run: 1

Failed Test Cases

LL Privacy - Add Device 4 (2 Devices to AL)          Failed       0.110 seconds
LL Privacy - Add Device 5 (2 Devices to RL)          Failed       0.115 seconds
LL Privacy - Add Device 6 (RL is full)               Failed       0.145 seconds
LL Privacy - Add Device 7 (AL is full)               Failed       0.147 seconds
LL Privacy - Remove Device 1 (Remove from AL)        Timed out    2.495 seconds
LL Privacy - Remove Device 4 (Disable Adv)           Timed out    2.699 seconds

---
Regards,
Linux Bluetooth

#2 lore raw
In reply to Ricardo B. Marliere
This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 9 lines · On Mon, 19 Feb 2024 16:46:57 -0300 you wrote:

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move the bt_type and bnep_type variables to be constant structures as well, placing it into read-only memory which can not be modified at runtime.

[...]

Here is the summary with links:
- Bluetooth: constify the struct device_type usage

    https://git.kernel.org/bluetooth/bluetooth-next/c/8a496378559f

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html