staging: rtl8188eu: don't cast to void* when calling memset()
authorLuca Ceresoli <luca@lucaceresoli.net>
Wed, 2 Dec 2015 21:54:01 +0000 (22:54 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 8 Feb 2016 02:58:31 +0000 (18:58 -0800)
The first argument to memset() is (void *), the explicit typecasts are
not needed. They just make code less readable.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/core/rtw_ap.c
drivers/staging/rtl8188eu/core/rtw_efuse.c
drivers/staging/rtl8188eu/core/rtw_security.c

index e5d29fe..79d326a 100644 (file)
@@ -569,7 +569,7 @@ static void update_bmc_sta(struct adapter *padapter)
 
                psta->ieee8021x_blocked = 0;
 
-               memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
+               memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats));
 
                /* prepare for add_RATid */
                supportRateNum = rtw_get_rateset_len((u8 *)&pcur_network->SupportedRates);
@@ -692,7 +692,7 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
 
        /* todo: init other variables */
 
-       memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats));
+       memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats));
 
        spin_lock_bh(&psta->lock);
        psta->state |= _FW_LINKED;
index 169bb69..fd8cf47 100644 (file)
@@ -394,7 +394,7 @@ u8 Efuse_WordEnableDataWrite(struct adapter *pAdapter, u16 efuse_addr, u8 word_e
        u8 badworden = 0x0F;
        u8 tmpdata[8];
 
-       memset((void *)tmpdata, 0xff, PGPKT_DATA_SIZE);
+       memset(tmpdata, 0xff, PGPKT_DATA_SIZE);
 
        if (!(word_en & BIT(0))) {
                tmpaddr = start_addr;
@@ -500,8 +500,8 @@ int Efuse_PgPacketRead(struct adapter *pAdapter, u8 offset, u8 *data)
        if (offset > max_section)
                return false;
 
-       memset((void *)data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
-       memset((void *)tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
+       memset(data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
+       memset(tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE);
 
        /*  <Roger_TODO> Efuse has been pre-programmed dummy 5Bytes at the end of Efuse by CP. */
        /*  Skip dummy parts to prevent unexpected data read from Efuse. */
@@ -572,7 +572,7 @@ static bool hal_EfuseFixHeaderProcess(struct adapter *pAdapter, u8 efuseType, st
        u16     efuse_addr = *pAddr;
        u32     PgWriteSuccess = 0;
 
-       memset((void *)originaldata, 0xff, 8);
+       memset(originaldata, 0xff, 8);
 
        if (Efuse_PgPacketRead(pAdapter, pFixPkt->offset, originaldata)) {
                /* check if data exist */
index 22839d5..b781ccf 100644 (file)
@@ -1081,13 +1081,13 @@ static int aes_cipher(u8 *key, uint hdrlen, u8 *pframe, uint plen)
 
        frsubtype >>= 4;
 
-       memset((void *)mic_iv, 0, 16);
-       memset((void *)mic_header1, 0, 16);
-       memset((void *)mic_header2, 0, 16);
-       memset((void *)ctr_preload, 0, 16);
-       memset((void *)chain_buffer, 0, 16);
-       memset((void *)aes_out, 0, 16);
-       memset((void *)padded_buffer, 0, 16);
+       memset(mic_iv, 0, 16);
+       memset(mic_header1, 0, 16);
+       memset(mic_header2, 0, 16);
+       memset(ctr_preload, 0, 16);
+       memset(chain_buffer, 0, 16);
+       memset(aes_out, 0, 16);
+       memset(padded_buffer, 0, 16);
 
        if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen ==  WLAN_HDR_A3_QOS_LEN))
                a4_exists = 0;
@@ -1279,13 +1279,13 @@ static int aes_decipher(u8 *key, uint   hdrlen,
        uint    frsubtype  = GetFrameSubType(pframe);
        frsubtype >>= 4;
 
-       memset((void *)mic_iv, 0, 16);
-       memset((void *)mic_header1, 0, 16);
-       memset((void *)mic_header2, 0, 16);
-       memset((void *)ctr_preload, 0, 16);
-       memset((void *)chain_buffer, 0, 16);
-       memset((void *)aes_out, 0, 16);
-       memset((void *)padded_buffer, 0, 16);
+       memset(mic_iv, 0, 16);
+       memset(mic_header1, 0, 16);
+       memset(mic_header2, 0, 16);
+       memset(ctr_preload, 0, 16);
+       memset(chain_buffer, 0, 16);
+       memset(aes_out, 0, 16);
+       memset(padded_buffer, 0, 16);
 
        /* start to decrypt the payload */