summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2014-10-27 05:30:15 +0100
committerGreg Kroah-Hartman2014-10-27 05:30:15 +0100
commitf9624ded90d0f4f6077b243d8526da671ba58d25 (patch)
tree6ebf858d63257581fd3aa77b5849bcc670ad83b2 /drivers/staging/greybus/operation.c
parentgreybus: module: don't create duplicate module ids (diff)
downloadkernel-qcow2-linux-f9624ded90d0f4f6077b243d8526da671ba58d25.tar.gz
kernel-qcow2-linux-f9624ded90d0f4f6077b243d8526da671ba58d25.tar.xz
kernel-qcow2-linux-f9624ded90d0f4f6077b243d8526da671ba58d25.zip
greybus: operation: fix some sparse warnings
One of which was "real". Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 5d23d1977297..c94e50965f28 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -274,8 +274,14 @@ static void gb_operation_gbuf_complete(struct gbuf *gbuf)
header = operation->response_payload;
else
header = NULL;
- id = header ? (int)header->id : -1;
- type = header ? (int)header->type : -1;
+
+ if (header) {
+ id = le16_to_cpu(header->id);
+ type = header->type;
+ } else {
+ id = -1;
+ type = -1;
+ }
gb_connection_err(operation->connection,
"operation %d type %d gbuf error %d",
@@ -292,8 +298,9 @@ static void gb_operation_gbuf_complete(struct gbuf *gbuf)
* initialize it here (it'll be overwritten by the incoming
* message).
*/
-struct gbuf *gb_operation_gbuf_create(struct gb_operation *operation,
- u8 type, size_t size, bool data_out)
+static struct gbuf *gb_operation_gbuf_create(struct gb_operation *operation,
+ u8 type, size_t size,
+ bool data_out)
{
struct gb_connection *connection = operation->connection;
struct gb_operation_msg_hdr *header;