Commit 6cde2904 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] kinect: fix sparse warnings

drivers/media/usb/gspca/kinect.c:151:19: warning: incorrect type in assignment (different base types)
drivers/media/usb/gspca/kinect.c:152:19: warning: incorrect type in assignment (different base types)
drivers/media/usb/gspca/kinect.c:153:19: warning: incorrect type in assignment (different base types)
drivers/media/usb/gspca/kinect.c:191:13: warning: restricted __le16 degrades to integer
drivers/media/usb/gspca/kinect.c:217:16: warning: incorrect type in assignment (different base types)
drivers/media/usb/gspca/kinect.c:218:16: warning: incorrect type in assignment (different base types)

Note that this fixes a real bug where cpu_to_le16 was used instead of the correct
le16_to_cpu.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Acked-by: default avatarAntonio Ospite <ao2@ao2.it>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 18ef20da
...@@ -51,9 +51,9 @@ struct pkt_hdr { ...@@ -51,9 +51,9 @@ struct pkt_hdr {
struct cam_hdr { struct cam_hdr {
uint8_t magic[2]; uint8_t magic[2];
uint16_t len; __le16 len;
uint16_t cmd; __le16 cmd;
uint16_t tag; __le16 tag;
}; };
/* specific webcam descriptor */ /* specific webcam descriptor */
...@@ -188,9 +188,9 @@ static int send_cmd(struct gspca_dev *gspca_dev, uint16_t cmd, void *cmdbuf, ...@@ -188,9 +188,9 @@ static int send_cmd(struct gspca_dev *gspca_dev, uint16_t cmd, void *cmdbuf,
rhdr->tag, chdr->tag); rhdr->tag, chdr->tag);
return -1; return -1;
} }
if (cpu_to_le16(rhdr->len) != (actual_len/2)) { if (le16_to_cpu(rhdr->len) != (actual_len/2)) {
pr_err("send_cmd: Bad len %04x != %04x\n", pr_err("send_cmd: Bad len %04x != %04x\n",
cpu_to_le16(rhdr->len), (int)(actual_len/2)); le16_to_cpu(rhdr->len), (int)(actual_len/2));
return -1; return -1;
} }
...@@ -211,7 +211,7 @@ static int write_register(struct gspca_dev *gspca_dev, uint16_t reg, ...@@ -211,7 +211,7 @@ static int write_register(struct gspca_dev *gspca_dev, uint16_t reg,
uint16_t data) uint16_t data)
{ {
uint16_t reply[2]; uint16_t reply[2];
uint16_t cmd[2]; __le16 cmd[2];
int res; int res;
cmd[0] = cpu_to_le16(reg); cmd[0] = cpu_to_le16(reg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment