[PATCH] Bluetooth: virtio_bt: Use virtio_cread16 instead of virtio_cread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <marcel@xxxxxxxxxxxx>
---
 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




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux