greybus: fw-download: Create a macro for length of firmware file's name
authorViresh Kumar <viresh.kumar@linaro.org>
Mon, 2 May 2016 05:21:49 +0000 (10:51 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 4 May 2016 00:26:36 +0000 (17:26 -0700)
Create a macro representing the length of the firmware file's name and
use that instead of using magic number in the code.

Suggested-by: Greg Kroah-Hartman <gregkh@google.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/fw-download.c

index 836b02b9d7c64cb5b08a2e0927cc956cd32eae0e..e60abde2d70484dad6883e29b3ecf1a8c212f4fc 100644 (file)
 #include "firmware.h"
 #include "greybus.h"
 
+/* Length of the string in format: ara_%08x_%08x_%08x_%08x_%s.tftf */
+#define FW_NAME_LEN            56
+
 struct fw_request {
        u8                      firmware_id;
-       char                    name[56]; /* ara_%08x_%08x_%08x_%08x_%s.tftf */
+       char                    name[FW_NAME_LEN];
        const struct firmware   *fw;
        struct list_head        node;
 };