summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/operation.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2015-12-04 21:30:09 +0530
committerGreg Kroah-Hartman <gregkh@google.com>2015-12-04 16:23:36 -0800
commit2f3db927cdf7627aa5359ff46c80ab72f7971980 (patch)
tree62cb682c89f4981053412bc149b9fef27750f50a /drivers/staging/greybus/operation.c
parent4aac6c5a144921448237d2a2bff50d4fba0b0faf (diff)
greybus: don't use %h and %hh for printing short and char variables
Because the width of our fields is already known, we can use %0Nx (for hex) to print N bytes and %u (for unsigned decimal), instead of using %h and %hh, which isn't that readable. This patch makes following changes: - s/%hx/%04x - s/%04hx/%04x - s/%hhx/%02x - s/%02hhx/%02x - s/%hhu/%u - s/%hu/%u - s/%x/%02x for u8 value (only at a single place) Suggested-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/operation.c')
-rw-r--r--drivers/staging/greybus/operation.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/greybus/operation.c b/drivers/staging/greybus/operation.c
index 01ad08bc85d0..ae3ada0b54e3 100644
--- a/drivers/staging/greybus/operation.c
+++ b/drivers/staging/greybus/operation.c
@@ -229,7 +229,7 @@ static void gb_operation_request_handle(struct gb_operation *operation)
status = protocol->request_recv(operation->type, operation);
} else {
dev_err(&connection->hd->dev,
- "%s: unexpected incoming request of type 0x%02hhx\n",
+ "%s: unexpected incoming request of type 0x%02x\n",
connection->name, operation->type);
status = -EPROTONOSUPPORT;
@@ -238,7 +238,7 @@ static void gb_operation_request_handle(struct gb_operation *operation)
ret = gb_operation_response_send(operation, status);
if (ret) {
dev_err(&connection->hd->dev,
- "%s: failed to send response %d for type 0x%02hhx: %d\n",
+ "%s: failed to send response %d for type 0x%02x: %d\n",
connection->name, status, operation->type, ret);
return;
}
@@ -797,7 +797,7 @@ void greybus_message_sent(struct gb_host_device *hd,
if (message == operation->response) {
if (status) {
dev_err(&connection->hd->dev,
- "%s: error sending response 0x%02hhx: %d\n",
+ "%s: error sending response 0x%02x: %d\n",
connection->name, operation->type, status);
}
gb_operation_put_active(operation);
@@ -868,7 +868,7 @@ static void gb_connection_recv_response(struct gb_connection *connection,
operation = gb_operation_find_outgoing(connection, operation_id);
if (!operation) {
dev_err(&connection->hd->dev,
- "%s: unexpected response id 0x%04hx received\n",
+ "%s: unexpected response id 0x%04x received\n",
connection->name, operation_id);
return;
}
@@ -877,7 +877,7 @@ static void gb_connection_recv_response(struct gb_connection *connection,
message_size = sizeof(*message->header) + message->payload_size;
if (!errno && size != message_size) {
dev_err(&connection->hd->dev,
- "%s: malformed response 0x%02hhx received (%zu != %zu)\n",
+ "%s: malformed response 0x%02x received (%zu != %zu)\n",
connection->name, message->header->type, size,
message_size);
errno = -EMSGSIZE;
@@ -926,7 +926,7 @@ void gb_connection_recv(struct gb_connection *connection,
msg_size = le16_to_cpu(header.size);
if (size < msg_size) {
dev_err(dev,
- "%s: incomplete message 0x%04hx of type 0x%02hhx received (%zu < %zu)\n",
+ "%s: incomplete message 0x%04x of type 0x%02x received (%zu < %zu)\n",
connection->name, le16_to_cpu(header.operation_id),
header.type, size, msg_size);
return; /* XXX Should still complete operation */
@@ -1036,7 +1036,7 @@ int gb_operation_sync_timeout(struct gb_connection *connection, int type,
ret = gb_operation_request_send_sync_timeout(operation, timeout);
if (ret) {
dev_err(&connection->hd->dev,
- "%s: synchronous operation of type 0x%02hhx failed: %d\n",
+ "%s: synchronous operation of type 0x%02x failed: %d\n",
connection->name, type, ret);
} else {
if (response_size) {