diff options
author | Viresh Kumar | 2016-08-11 22:27:23 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2016-08-12 17:38:19 +0200 |
commit | b2abeaa10d5711e7730bb07120dd60ae27d7b930 (patch) | |
tree | 5bca52c2b995b9c07638ac83a6090c15f646ae8d /drivers/staging/greybus/Documentation | |
parent | greybus: firmware: Remove extra parenthesis (diff) | |
download | kernel-qcow2-linux-b2abeaa10d5711e7730bb07120dd60ae27d7b930.tar.gz kernel-qcow2-linux-b2abeaa10d5711e7730bb07120dd60ae27d7b930.tar.xz kernel-qcow2-linux-b2abeaa10d5711e7730bb07120dd60ae27d7b930.zip |
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/Documentation')
-rw-r--r-- | drivers/staging/greybus/Documentation/firmware/firmware-management | 8 | ||||
-rw-r--r-- | drivers/staging/greybus/Documentation/firmware/firmware.c | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/staging/greybus/Documentation/firmware/firmware-management b/drivers/staging/greybus/Documentation/firmware/firmware-management index ced41d244005..7918257e5b3b 100644 --- a/drivers/staging/greybus/Documentation/firmware/firmware-management +++ b/drivers/staging/greybus/Documentation/firmware/firmware-management @@ -104,20 +104,20 @@ Following are the IOCTLs and their data structures available to the user: struct fw_mgmt_ioc_get_intf_version { - __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN]; + __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE]; __u16 major; __u16 minor; } __attribute__ ((__packed__)); struct fw_mgmt_ioc_get_backend_version { - __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_LEN]; + __u8 firmware_tag[GB_FIRMWARE_U_TAG_MAX_SIZE]; __u16 major; __u16 minor; __u8 status; } __attribute__ ((__packed__)); struct fw_mgmt_ioc_intf_load_and_validate { - __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN]; + __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE]; __u8 load_method; __u8 status; __u16 major; @@ -125,7 +125,7 @@ struct fw_mgmt_ioc_intf_load_and_validate { } __packed; struct fw_mgmt_ioc_backend_fw_update { - __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_LEN]; + __u8 firmware_tag[GB_FIRMWARE_TAG_MAX_SIZE]; __u8 status; } __packed; diff --git a/drivers/staging/greybus/Documentation/firmware/firmware.c b/drivers/staging/greybus/Documentation/firmware/firmware.c index 5170886f8afb..ff9382401030 100644 --- a/drivers/staging/greybus/Documentation/firmware/firmware.c +++ b/drivers/staging/greybus/Documentation/firmware/firmware.c @@ -108,7 +108,7 @@ static int update_intf_firmware(int fd) intf_load.minor = 0; strncpy((char *)&intf_load.firmware_tag, firmware_tag, - GB_FIRMWARE_U_TAG_MAX_LEN); + GB_FIRMWARE_U_TAG_MAX_SIZE); ret = ioctl(fd, FW_MGMT_IOC_INTF_LOAD_AND_VALIDATE, &intf_load); if (ret < 0) { @@ -146,7 +146,7 @@ static int update_backend_firmware(int fd) printf("Getting Backend Firmware Version\n"); strncpy((char *)&backend_fw_info.firmware_tag, firmware_tag, - GB_FIRMWARE_U_TAG_MAX_LEN); + GB_FIRMWARE_U_TAG_MAX_SIZE); retry_fw_version: ret = ioctl(fd, FW_MGMT_IOC_GET_BACKEND_FW, &backend_fw_info); @@ -174,7 +174,7 @@ retry_fw_version: printf("Updating Backend Firmware\n"); strncpy((char *)&backend_update.firmware_tag, firmware_tag, - GB_FIRMWARE_U_TAG_MAX_LEN); + GB_FIRMWARE_U_TAG_MAX_SIZE); retry_fw_update: backend_update.status = 0; |