* [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer
@ 2021-09-03 7:16 Yang Li
2021-09-03 7:59 ` [-next] " bluez.test.bot
2021-09-10 7:33 ` [PATCH -next] " Marcel Holtmann
0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2021-09-03 7:16 UTC (permalink / raw)
To: marcel; +Cc: johan.hedberg, luiz.dentz, linux-bluetooth, linux-kernel, Yang Li
sizeof() when applied to a pointer typed expression gives the size of
the pointer.
Clean up coccicheck warning:
./drivers/bluetooth/btusb.c:2210:36-42: ERROR: application of sizeof to
pointer
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/bluetooth/btusb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 928cbfa..5bf479e 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -2207,7 +2207,7 @@ static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr)
struct sk_buff *skb;
long ret;
- skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
+ skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(*bdaddr), bdaddr, HCI_INIT_TIMEOUT);
if (IS_ERR(skb)) {
ret = PTR_ERR(skb);
bt_dev_err(hdev, "changing Mediatek device address failed (%ld)",
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [-next] Bluetooth: btusb: Fix the application of sizeof to pointer
2021-09-03 7:16 [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer Yang Li
@ 2021-09-03 7:59 ` bluez.test.bot
2021-09-10 7:33 ` [PATCH -next] " Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2021-09-03 7:59 UTC (permalink / raw)
To: linux-bluetooth, yang.lee
[-- Attachment #1: Type: text/plain, Size: 2630 bytes --]
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=541587
---Test result---
Test Summary:
CheckPatch PASS 0.44 seconds
GitLint PASS 0.10 seconds
BuildKernel PASS 520.32 seconds
TestRunner: Setup PASS 342.62 seconds
TestRunner: l2cap-tester PASS 2.52 seconds
TestRunner: bnep-tester PASS 1.86 seconds
TestRunner: mgmt-tester PASS 30.86 seconds
TestRunner: rfcomm-tester PASS 2.06 seconds
TestRunner: sco-tester PASS 1.98 seconds
TestRunner: smp-tester PASS 2.06 seconds
TestRunner: userchan-tester PASS 1.88 seconds
Details
##############################
Test: CheckPatch - PASS - 0.44 seconds
Run checkpatch.pl script with rule in .checkpatch.conf
##############################
Test: GitLint - PASS - 0.10 seconds
Run gitlint with rule in .gitlint
##############################
Test: BuildKernel - PASS - 520.32 seconds
Build Kernel with minimal configuration supports Bluetooth
##############################
Test: TestRunner: Setup - PASS - 342.62 seconds
Setup environment for running Test Runner
##############################
Test: TestRunner: l2cap-tester - PASS - 2.52 seconds
Run test-runner with l2cap-tester
Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: bnep-tester - PASS - 1.86 seconds
Run test-runner with bnep-tester
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: mgmt-tester - PASS - 30.86 seconds
Run test-runner with mgmt-tester
Total: 452, Passed: 452 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: rfcomm-tester - PASS - 2.06 seconds
Run test-runner with rfcomm-tester
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: sco-tester - PASS - 1.98 seconds
Run test-runner with sco-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: smp-tester - PASS - 2.06 seconds
Run test-runner with smp-tester
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner: userchan-tester - PASS - 1.88 seconds
Run test-runner with userchan-tester
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0
---
Regards,
Linux Bluetooth
[-- Attachment #2: l2cap-tester.log --]
[-- Type: application/octet-stream, Size: 44385 bytes --]
[-- Attachment #3: bnep-tester.log --]
[-- Type: application/octet-stream, Size: 3592 bytes --]
[-- Attachment #4: mgmt-tester.log --]
[-- Type: application/octet-stream, Size: 622560 bytes --]
[-- Attachment #5: rfcomm-tester.log --]
[-- Type: application/octet-stream, Size: 11712 bytes --]
[-- Attachment #6: sco-tester.log --]
[-- Type: application/octet-stream, Size: 9947 bytes --]
[-- Attachment #7: smp-tester.log --]
[-- Type: application/octet-stream, Size: 11858 bytes --]
[-- Attachment #8: userchan-tester.log --]
[-- Type: application/octet-stream, Size: 5489 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer
2021-09-03 7:16 [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer Yang Li
2021-09-03 7:59 ` [-next] " bluez.test.bot
@ 2021-09-10 7:33 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2021-09-10 7:33 UTC (permalink / raw)
To: Yang Li
Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth,
linux-kernel
Hi Yang,
> sizeof() when applied to a pointer typed expression gives the size of
> the pointer.
>
> Clean up coccicheck warning:
> ./drivers/bluetooth/btusb.c:2210:36-42: ERROR: application of sizeof to
> pointer
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/bluetooth/btusb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 928cbfa..5bf479e 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -2207,7 +2207,7 @@ static int btusb_set_bdaddr_mtk(struct hci_dev *hdev, const bdaddr_t *bdaddr)
> struct sk_buff *skb;
> long ret;
>
> - skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(bdaddr), bdaddr, HCI_INIT_TIMEOUT);
> + skb = __hci_cmd_sync(hdev, 0xfc1a, sizeof(*bdaddr), bdaddr, HCI_INIT_TIMEOUT);
lets just do 0xfc1a, 6, bdaddr like the other functions do as well.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-10 7:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-03 7:16 [PATCH -next] Bluetooth: btusb: Fix the application of sizeof to pointer Yang Li
2021-09-03 7:59 ` [-next] " bluez.test.bot
2021-09-10 7:33 ` [PATCH -next] " Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox