Skip to contentSkip to conversation

Bluetooth: hci_event: Fix build warning with C=1

PATCH Applied Luiz Augusto von Dentz 3 participants 4 messages Aug 3, 2022 – Aug 4, 2022

Subsystems (2)
lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/2 Bluetooth: hci_event: Fix build warning with C=1

From: Luiz Augusto von Dentz <[email protected]>

This fixes the following warning when build with make C=1:

net/bluetooth/hci_event.c:337:15: warning: restricted __le16 degrades to integer

Fixes a93661203641e ("Bluetooth: Process result of HCI Delete Stored Link Key command")
---
 net/bluetooth/hci_event.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
net/bluetooth/hci_event.c +5 -2
index 9ab359b15f57..395c6479456f 100644
@@ -328,14 +328,17 @@ static u8 hci_cc_delete_stored_link_key(struct hci_dev *hdev, void *data,
 					struct sk_buff *skb)
 {
 	struct hci_rp_delete_stored_link_key *rp = data;
+	u16 num_keys;
 
 	bt_dev_dbg(hdev, "status 0x%2.2x", rp->status);
 
 	if (rp->status)
 		return rp->status;
 
-	if (rp->num_keys <= hdev->stored_num_keys)
-		hdev->stored_num_keys -= le16_to_cpu(rp->num_keys);
+	num_keys = le16_to_cpu(rp->num_keys);
+
+	if (num_keys <= hdev->stored_num_keys)
+		hdev->stored_num_keys -= num_keys;
 	else
 		hdev->stored_num_keys = 0;
 
Signature · 1 line
2.37.1
author maintainer
#1 lore raw

PATCH 2/2 Bluetooth: MGMT: Fixes build warnings with C=1

From: Luiz Augusto von Dentz <[email protected]>

This fixes the following warning when building with make C=1:

net/bluetooth/mgmt.c:3821:29: warning: restricted __le16 degrades to integer net/bluetooth/mgmt.c:4625:9: warning: cast to restricted __le32

Fixes 600a87490ff98 ("Bluetooth: Implementation of MGMT_OP_SET_BLOCKED_KEYS.")
Fixes 4c54bf2b093bb ("Bluetooth: Add get/set device flags mgmt op")
---
 net/bluetooth/mgmt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
net/bluetooth/mgmt.c +2 -3
index 11eb6e538518..cf393d7c6e87 100644
@@ -3818,7 +3818,7 @@ static int set_blocked_keys(struct sock *sk, struct hci_dev *hdev, void *data,
 
 	hci_blocked_keys_clear(hdev);
 
-	for (i = 0; i < keys->key_count; ++i) {
+	for (i = 0; i < key_count; ++i) {
 		struct blocked_key *b = kzalloc(sizeof(*b), GFP_KERNEL);
 
 		if (!b) {
@@ -4623,8 +4623,7 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,
 	u32 current_flags = __le32_to_cpu(cp->current_flags);
 
 	bt_dev_dbg(hdev, "Set device flags %pMR (type 0x%x) = 0x%x",
-		   &cp->addr.bdaddr, cp->addr.type,
-		   __le32_to_cpu(current_flags));
+		   &cp->addr.bdaddr, cp->addr.type, current_flags);
 
 	// We should take hci_dev_lock() early, I think.. conn_flags can change
 	supported_flags = hdev->conn_flags;
Signature · 1 line
2.37.1
#2 lore raw
In reply to Luiz Augusto von Dentz

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=665193

---Test result---

Test Summary:

CheckPatch                    PASS      3.50 seconds
GitLint                       PASS      2.08 seconds
SubjectPrefix                 PASS      1.75 seconds
BuildKernel                   PASS      33.59 seconds
BuildKernel32                 PASS      29.33 seconds
Incremental Build with patchesPASS      48.03 seconds
TestRunner: Setup             PASS      476.72 seconds
TestRunner: l2cap-tester      PASS      16.95 seconds
TestRunner: bnep-tester       PASS      6.26 seconds
TestRunner: mgmt-tester       PASS      98.97 seconds
TestRunner: rfcomm-tester     PASS      9.69 seconds
TestRunner: sco-tester        PASS      9.33 seconds
TestRunner: smp-tester        PASS      9.41 seconds
TestRunner: userchan-tester   PASS      6.45 seconds

---
Regards,
Linux Bluetooth

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

Hello:

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

Quoted 10 lines · On Wed, 3 Aug 2022 14:55:26 -0700 you wrote:

From: Luiz Augusto von Dentz <[email protected]>

This fixes the following warning when build with make C=1:

net/bluetooth/hci_event.c:337:15: warning: restricted __le16 degrades to integer

Fixes a93661203641e ("Bluetooth: Process result of HCI Delete Stored Link Key command")

[...]

Here is the summary with links:
- [1/2] Bluetooth: hci_event: Fix build warning with C=1

    https://git.kernel.org/bluetooth/bluetooth-next/c/72fe393b4e25
  - [2/2] Bluetooth: MGMT: Fixes build warnings with C=1
    https://git.kernel.org/bluetooth/bluetooth-next/c/9f74dd92c262

You are awesome, thank you!

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