diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2015-12-04 21:30:09 +0530 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2015-12-04 16:23:36 -0800 |
commit | 2f3db927cdf7627aa5359ff46c80ab72f7971980 (patch) | |
tree | 62cb682c89f4981053412bc149b9fef27750f50a /drivers/staging/greybus/manifest.c | |
parent | 4aac6c5a144921448237d2a2bff50d4fba0b0faf (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/manifest.c')
-rw-r--r-- | drivers/staging/greybus/manifest.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/greybus/manifest.c b/drivers/staging/greybus/manifest.c index ea5ff8682e69..72400e38b392 100644 --- a/drivers/staging/greybus/manifest.c +++ b/drivers/staging/greybus/manifest.c @@ -140,7 +140,7 @@ static int identify_descriptor(struct gb_interface *intf, break; case GREYBUS_TYPE_INVALID: default: - pr_err("invalid descriptor type (%hhu)\n", desc_header->type); + pr_err("invalid descriptor type (%u)\n", desc_header->type); return -EINVAL; } @@ -440,14 +440,14 @@ bool gb_manifest_parse(struct gb_interface *intf, void *data, size_t size) header = &manifest->header; manifest_size = le16_to_cpu(header->size); if (manifest_size != size) { - pr_err("manifest size mismatch (%zu != %hu)\n", + pr_err("manifest size mismatch (%zu != %u)\n", size, manifest_size); return false; } /* Validate major/minor number */ if (header->version_major > GREYBUS_VERSION_MAJOR) { - pr_err("manifest version too new (%hhu.%hhu > %hhu.%hhu)\n", + pr_err("manifest version too new (%u.%u > %u.%u)\n", header->version_major, header->version_minor, GREYBUS_VERSION_MAJOR, GREYBUS_VERSION_MINOR); return false; |