From ac42434b2ad72887cd9b147780b30978f1c7b728 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Sat, 16 May 2020 14:20:37 -0500 Subject: [PATCH] rtl8188eu: Fix gcc 10 warnings Signed-off-by: Larry Finger --- core/rtw_mp.c | 2 +- os_dep/ioctl_linux.c | 90 ++++++++++++++++++++++---------------------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 59c7af2..0445675 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -908,7 +908,7 @@ u32 mp_query_psd(struct adapter *pAdapter, u8 *data) } else { psd_data = rtw_GetPSDData(pAdapter, i); } - sprintf(data, "%s%x ", data, psd_data); + sprintf(data + strlen(data), "%x ", psd_data); i++; } diff --git a/os_dep/ioctl_linux.c b/os_dep/ioctl_linux.c index 00f538c..19ea69c 100644 --- a/os_dep/ioctl_linux.c +++ b/os_dep/ioctl_linux.c @@ -5762,13 +5762,13 @@ static int rtw_mp_efuse_get(struct net_device *dev, sprintf(extra, "\n"); for (i = 0; i < EFUSE_MAP_SIZE; i += 16) { - sprintf(extra, "%s0x%02x\t", extra, i); + sprintf(extra + strlen(extra), "0x%02x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, PROMContent[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", PROMContent[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, PROMContent[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", PROMContent[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "realmap") == 0) { mapLen = EFUSE_MAP_SIZE; @@ -5780,13 +5780,13 @@ static int rtw_mp_efuse_get(struct net_device *dev, sprintf(extra, "\n"); for (i = 0; i < EFUSE_MAP_SIZE; i += 16) { - sprintf(extra, "%s0x%02x\t", extra, i); + sprintf(extra + strlen(extra), "0x%02x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseInitMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "rmap") == 0) { if ((tmp[1] == NULL) || (tmp[2] == NULL)) { @@ -5822,7 +5822,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, *extra = 0; for (i = 0; i < cnts; i++) - sprintf(extra, "%s0x%02X ", extra, data[i]); + sprintf(extra + strlen(extra), "0x%02X ", data[i]); } else if (strcmp(tmp[0], "realraw") == 0) { addr = 0; mapLen = EFUSE_MAX_SIZE; @@ -5834,14 +5834,14 @@ static int rtw_mp_efuse_get(struct net_device *dev, sprintf(extra, "\n"); for (i = 0; i < mapLen; i++) { - sprintf(extra, "%s%02X", extra, rawdata[i]); + sprintf(extra + strlen(extra), "%02X", rawdata[i]); if ((i & 0xF) == 0xF) - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "\n"); else if ((i & 0x7) == 0x7) - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "\t"); else - sprintf(extra, "%s ", extra); + sprintf(extra + strlen(extra), " "); } } else if (strcmp(tmp[0], "mac") == 0) { cnts = 6; @@ -5861,9 +5861,9 @@ static int rtw_mp_efuse_get(struct net_device *dev, *extra = 0; for (i = 0; i < cnts; i++) { - sprintf(extra, "%s%02X", extra, data[i]); + sprintf(extra + strlen(extra), "%02X", data[i]); if (i != (cnts-1)) - sprintf(extra, "%s:", extra); + sprintf(extra + strlen(extra), ":"); } } else if (strcmp(tmp[0], "vidpid") == 0) { cnts = 4; @@ -5882,9 +5882,9 @@ static int rtw_mp_efuse_get(struct net_device *dev, *extra = 0; for (i = 0; i < cnts; i++) { - sprintf(extra, "%s0x%02X", extra, data[i]); + sprintf(extra + strlen(extra), "0x%02X", data[i]); if (i != (cnts-1)) - sprintf(extra, "%s,", extra); + sprintf(extra + strlen(extra), ","); } } else if (strcmp(tmp[0], "ableraw") == 0) { efuse_GetCurrentSize(padapter, &raw_cursize); @@ -5901,13 +5901,13 @@ static int rtw_mp_efuse_get(struct net_device *dev, sprintf(extra, "\n"); for (i = 0; i < 512; i += 16) { /* set 512 because the iwpriv's extra size have limit 0x7FF */ - sprintf(extra, "%s0x%03x\t", extra, i); + sprintf(extra + strlen(extra), "0x%03x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->BTEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->BTEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "btbmap") == 0) { mapLen = EFUSE_BT_MAX_MAP_LEN; @@ -5919,13 +5919,13 @@ static int rtw_mp_efuse_get(struct net_device *dev, sprintf(extra, "\n"); for (i = 512; i < 1024; i += 16) { - sprintf(extra, "%s0x%03x\t", extra, i); + sprintf(extra + strlen(extra), "0x%03x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->BTEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->BTEfuseInitMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->BTEfuseInitMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "btrmap") == 0) { if ((tmp[1] == NULL) || (tmp[2] == NULL)) { @@ -5960,39 +5960,39 @@ static int rtw_mp_efuse_get(struct net_device *dev, *extra = 0; for (i = 0; i < cnts; i++) - sprintf(extra, "%s 0x%02X ", extra, data[i]); + sprintf(extra + strlen(extra), " 0x%02X ", data[i]); } else if (strcmp(tmp[0], "btffake") == 0) { sprintf(extra, "\n"); for (i = 0; i < 512; i += 16) { - sprintf(extra, "%s0x%03x\t", extra, i); + sprintf(extra + strlen(extra), "0x%03x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeBTEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeBTEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "btbfake") == 0) { sprintf(extra, "\n"); for (i = 512; i < 1024; i += 16) { - sprintf(extra, "%s0x%03x\t", extra, i); + sprintf(extra + strlen(extra), "0x%03x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeBTEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeBTEfuseModifiedMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeBTEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else if (strcmp(tmp[0], "wlrfkmap") == 0) { sprintf(extra, "\n"); for (i = 0; i < EFUSE_MAP_SIZE; i += 16) { - sprintf(extra, "%s0x%02x\t", extra, i); + sprintf(extra + strlen(extra), "0x%02x\t", i); for (j = 0; j < 8; j++) - sprintf(extra, "%s%02X ", extra, pEfuseHal->fakeEfuseModifiedMap[i+j]); - sprintf(extra, "%s\t", extra); + sprintf(extra + strlen(extra), "%02X ", pEfuseHal->fakeEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\t"); for (; j < 16; j++) - sprintf(extra, "%s %02X", extra, pEfuseHal->fakeEfuseModifiedMap[i+j]); - sprintf(extra, "%s\n", extra); + sprintf(extra + strlen(extra), " %02X", pEfuseHal->fakeEfuseModifiedMap[i+j]); + sprintf(extra + strlen(extra), "\n"); } } else { sprintf(extra, "Command not found!");