mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 17:44:14 +08:00
greybus: es2: Fix 'make check' warnings with arpc
This is what I got: greybus/es2.c:1130:29: warning: restricted __le16 degrades to integer greybus/es2.c:1140:22: warning: incorrect type in assignment (different base types) greybus/es2.c:1140:22: expected restricted __le16 [usertype] id greybus/es2.c:1140:22: got unsigned short [unsigned] [usertype] <noident> greybus/es2.c:1162:52: warning: incorrect type in argument 8 (different base types) greybus/es2.c:1162:52: expected unsigned short [unsigned] [usertype] size greybus/es2.c:1162:52: got restricted __le16 [usertype] size greybus/es2.c:1164:31: warning: restricted __le16 degrades to integer greybus/es2.c:1253:34: warning: incorrect type in argument 2 (different base types) greybus/es2.c:1253:34: expected unsigned char [unsigned] [usertype] id greybus/es2.c:1253:34: got restricted __le16 [usertype] id Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Alex Elder <elder@linaro.org>
This commit is contained in:
parent
12ce523147
commit
e818027c0b
@ -1127,7 +1127,7 @@ static struct arpc *arpc_find(struct es2_ap_dev *es2, u8 id)
|
||||
struct arpc *rpc;
|
||||
|
||||
list_for_each_entry(rpc, &es2->arpcs, list) {
|
||||
if (rpc->req->id == id)
|
||||
if (le16_to_cpu(rpc->req->id) == id)
|
||||
return rpc;
|
||||
}
|
||||
|
||||
@ -1137,7 +1137,7 @@ static struct arpc *arpc_find(struct es2_ap_dev *es2, u8 id)
|
||||
static void arpc_add(struct es2_ap_dev *es2, struct arpc *rpc)
|
||||
{
|
||||
rpc->active = true;
|
||||
rpc->req->id = (u16)(es2->arpc_id_cycle++);
|
||||
rpc->req->id = cpu_to_le16(es2->arpc_id_cycle++);
|
||||
list_add_tail(&es2->arpcs, &rpc->list);
|
||||
}
|
||||
|
||||
@ -1159,9 +1159,9 @@ static int arpc_send(struct es2_ap_dev *es2, struct arpc *rpc, int timeout)
|
||||
USB_DIR_OUT | USB_TYPE_VENDOR |
|
||||
USB_RECIP_INTERFACE,
|
||||
0, 0,
|
||||
rpc->req, rpc->req->size,
|
||||
rpc->req, le16_to_cpu(rpc->req->size),
|
||||
ES2_TIMEOUT);
|
||||
if (retval != rpc->req->size) {
|
||||
if (retval != le16_to_cpu(rpc->req->size)) {
|
||||
dev_err(&udev->dev,
|
||||
"failed to send ARPC request %d: %d\n",
|
||||
rpc->req->type, retval);
|
||||
@ -1250,7 +1250,7 @@ static void arpc_in_callback(struct urb *urb)
|
||||
|
||||
resp = urb->transfer_buffer;
|
||||
spin_lock_irqsave(&es2->arpc_lock, flags);
|
||||
rpc = arpc_find(es2, resp->id);
|
||||
rpc = arpc_find(es2, le16_to_cpu(resp->id));
|
||||
if (!rpc) {
|
||||
dev_err(dev, "invalid arpc response id received: %d\n",
|
||||
resp->id);
|
||||
|
Loading…
Reference in New Issue
Block a user