summaryrefslogtreecommitdiff
path: root/drivers/staging/greybus/fw-download.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2016-08-11 13:27:23 -0700
committerGreg Kroah-Hartman <gregkh@google.com>2016-08-12 17:38:19 +0200
commitb2abeaa10d5711e7730bb07120dd60ae27d7b930 (patch)
tree5bca52c2b995b9c07638ac83a6090c15f646ae8d /drivers/staging/greybus/fw-download.c
parent769cb83704db127119d063b55091f782007368e7 (diff)
greybus: firmware: s/_LEN/_SIZE
Alex Elder pointed out that the macros also count the trailing NULL ('\0') character and so it should be using SIZE instead of LEN. This patch makes that change. Reported-by: Alex Elder <alex.elder@linaro.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/fw-download.c')
-rw-r--r--drivers/staging/greybus/fw-download.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/greybus/fw-download.c b/drivers/staging/greybus/fw-download.c
index 96c11aac4096..1c63256b96a6 100644
--- a/drivers/staging/greybus/fw-download.c
+++ b/drivers/staging/greybus/fw-download.c
@@ -23,7 +23,7 @@ struct fw_request {
u8 firmware_id;
bool disabled;
bool timedout;
- char name[FW_NAME_LEN];
+ char name[FW_NAME_SIZE];
const struct firmware *fw;
struct list_head node;
@@ -239,7 +239,7 @@ static int fw_download_find_firmware(struct gb_operation *op)
tag = (const char *)request->firmware_tag;
/* firmware_tag should be null-terminated */
- if (strnlen(tag, GB_FIRMWARE_TAG_MAX_LEN) == GB_FIRMWARE_TAG_MAX_LEN) {
+ if (strnlen(tag, GB_FIRMWARE_TAG_MAX_SIZE) == GB_FIRMWARE_TAG_MAX_SIZE) {
dev_err(fw_download->parent,
"firmware-tag is not null-terminated\n");
return -EINVAL;