2021-04-07 21:54:03

by Marcel Holtmann

[permalink] [raw]
Subject: [PATCH] Bluetooth: virtio_bt: Use virtio_cread16 instead of virtio_cread

Using virtio_cread leads to a warning on PowerPC architecture:

drivers/bluetooth/virtio_bt.c:303:17: sparse: bad type *
drivers/bluetooth/virtio_bt.c:303:17: sparse: unsigned short *
drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: incompatible types in comparison expression (different base types):
drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: no generic selection for 'unsigned short [addressable] virtio_cread_v'
drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: no generic selection for 'unsigned short virtio_cread_v'

Since the values are defined as 16-bit, just use virtio_cread16 instead.

Fixes: 148a48f61393 ("Bluetooth: Add support for virtio transport driver")
Signed-off-by: Marcel Holtmann <[email protected]>
---
drivers/bluetooth/virtio_bt.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/bluetooth/virtio_bt.c b/drivers/bluetooth/virtio_bt.c
index c804db7e90f8..a90294d3c438 100644
--- a/drivers/bluetooth/virtio_bt.c
+++ b/drivers/bluetooth/virtio_bt.c
@@ -300,7 +300,8 @@ static int virtbt_probe(struct virtio_device *vdev)
if (virtio_has_feature(vdev, VIRTIO_BT_F_VND_HCI)) {
__u16 vendor;

- virtio_cread(vdev, struct virtio_bt_config, vendor, &vendor);
+ vendor = virtio_cread16(vdev, offsetof(struct virtio_bt_config,
+ vendor));

switch (vendor) {
case VIRTIO_BT_CONFIG_VENDOR_ZEPHYR:
@@ -331,12 +332,11 @@ static int virtbt_probe(struct virtio_device *vdev)
}

if (virtio_has_feature(vdev, VIRTIO_BT_F_MSFT_EXT)) {
- __u16 msft_opcode;
+ __u16 opcode;

- virtio_cread(vdev, struct virtio_bt_config,
- msft_opcode, &msft_opcode);
-
- hci_set_msft_opcode(hdev, msft_opcode);
+ opcode = virtio_cread16(vdev, offsetof(struct virtio_bt_config,
+ msft_opcode));
+ hci_set_msft_opcode(hdev, opcode);
}

if (virtio_has_feature(vdev, VIRTIO_BT_F_AOSP_EXT))
--
2.30.2


2021-04-07 21:56:48

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: virtio_bt: Use virtio_cread16 instead of virtio_cread

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

---Test result---

##############################
Test: CheckPatch - FAIL
Bluetooth: virtio_bt: Use virtio_cread16 instead of virtio_cread
WARNING: Unknown commit id '148a48f61393', maybe rebased or not pulled?
#17:
Fixes: 148a48f61393 ("Bluetooth: Add support for virtio transport driver")

total: 0 errors, 1 warnings, 25 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
mechanically convert to the typical style using --fix or --fix-inplace.

"[PATCH] Bluetooth: virtio_bt: Use virtio_cread16 instead of" has style problems, please review.

NOTE: If any of the errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.


##############################
Test: CheckGitLint - FAIL
Bluetooth: virtio_bt: Use virtio_cread16 instead of virtio_cread
7: B1 Line exceeds max length (121>80): "drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: incompatible types in comparison expression (different base types):"
8: B1 Line exceeds max length (124>80): "drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: no generic selection for 'unsigned short [addressable] virtio_cread_v'"
9: B1 Line exceeds max length (110>80): "drivers/bluetooth/virtio_bt.c:303:17: sparse: sparse: no generic selection for 'unsigned short virtio_cread_v'"


##############################
Test: CheckBuildK - PASS


##############################
Test: CheckTestRunner: Setup - PASS


##############################
Test: CheckTestRunner: l2cap-tester - PASS
Total: 40, Passed: 34 (85.0%), Failed: 0, Not Run: 6

##############################
Test: CheckTestRunner: bnep-tester - PASS
Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: mgmt-tester - FAIL
Total: 416, Passed: 394 (94.7%), Failed: 6, Not Run: 16

Failed Test Cases
Set connectable off (LE) - Success 2 Failed 0.020 seconds
Set connectable off (LE) - Success 3 Failed 0.020 seconds
Set connectable off (LE) - Success 4 Failed 0.016 seconds
Add Advertising - Success 13 (ADV_SCAN_IND) Failed 0.020 seconds
Add Advertising - Success 14 (ADV_NONCONN_IND) Failed 0.024 seconds
Add Advertising - Success 17 (Connectable -> off) Failed 0.028 seconds

##############################
Test: CheckTestRunner: rfcomm-tester - PASS
Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: sco-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: smp-tester - PASS
Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0

##############################
Test: CheckTestRunner: userchan-tester - PASS
Total: 3, Passed: 3 (100.0%), Failed: 0, Not Run: 0



---
Regards,
Linux Bluetooth


Attachments:
l2cap-tester.log (42.33 kB)
bnep-tester.log (3.45 kB)
mgmt-tester.log (534.29 kB)
rfcomm-tester.log (11.38 kB)
sco-tester.log (9.65 kB)
smp-tester.log (11.52 kB)
userchan-tester.log (5.30 kB)
Download all attachments