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