]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
mwifiex: Use a define for firmware version string length
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 3 Nov 2021 20:17:58 +0000 (21:17 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 26 Nov 2021 16:29:37 +0000 (18:29 +0200)
Since the version string we get from the firmware is always 128
characters long, use a define for this size instead of having the number
128 copied all over the place.

Signed-off-by: Jonas Dreßler <verdre@v0yd.nl>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211103201800.13531-2-verdre@v0yd.nl
drivers/net/wireless/marvell/mwifiex/fw.h
drivers/net/wireless/marvell/mwifiex/main.h
drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c

index 2ff23ab259ab38d1049d6c7c6a1e1b9a0f378142..63c25c69ed2b5cf149907594444355d81aae3823 100644 (file)
@@ -2071,9 +2071,11 @@ struct mwifiex_ie_types_robust_coex {
        __le32 mode;
 } __packed;
 
+#define MWIFIEX_VERSION_STR_LENGTH  128
+
 struct host_cmd_ds_version_ext {
        u8 version_str_sel;
-       char version_str[128];
+       char version_str[MWIFIEX_VERSION_STR_LENGTH];
 } __packed;
 
 struct host_cmd_ds_mgmt_frame_reg {
index 90012cbcfd15975000b671ed32730f4c94796a20..65609ea2327e13af39acf990c2fae0ab7e7caf45 100644 (file)
@@ -646,7 +646,7 @@ struct mwifiex_private {
        struct wireless_dev wdev;
        struct mwifiex_chan_freq_power cfp;
        u32 versionstrsel;
-       char version_str[128];
+       char version_str[MWIFIEX_VERSION_STR_LENGTH];
 #ifdef CONFIG_DEBUG_FS
        struct dentry *dfs_dev_dir;
 #endif
index 6b5d35d9e69f380fafdd9851eef3ce394ff80f35..20b69a37f9e1596b34e48ea7e76e6b483edb8e56 100644 (file)
@@ -711,8 +711,9 @@ static int mwifiex_ret_ver_ext(struct mwifiex_private *priv,
        if (version_ext) {
                version_ext->version_str_sel = ver_ext->version_str_sel;
                memcpy(version_ext->version_str, ver_ext->version_str,
-                      sizeof(char) * 128);
-               memcpy(priv->version_str, ver_ext->version_str, 128);
+                      MWIFIEX_VERSION_STR_LENGTH);
+               memcpy(priv->version_str, ver_ext->version_str,
+                      MWIFIEX_VERSION_STR_LENGTH);
        }
        return 0;
 }