Remove redundant memset.
Subsystems (2)
cover Remove redundant memset.
The memory area set by the call to memset is immediately overwritten by the subsequent call to memcpy. Hence, remove the redundant memset.This patchset removes that memset in all staging drivers using the following sematic patch:
@@
expression e1,e2,e3,e4;
@@
- memset(e1,e2,e3);memcpy(e1,e4,e3);
Navya Sri Nizamkari (3):
staging: rtl8188eu: Remove memset.
staging: rtl8188eu: Remove memset.
staging: media: Remove redundant memset.
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 1 - drivers/staging/media/davinci_vpfe/dm365_resizer.c | 1 - drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 1 - 3 files changed, 3 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/3 staging: rtl8188eu: Remove memset.
The memory area set by the call to memset is immediately overwritten by the subsequent call to memcpy. Hence, remove that redundant memset.
--- drivers/staging/rtl8188eu/os_dep/mlme_linux.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/rtl8188eu/os_dep/mlme_linux.c +0 -1
@@ -60,7 +60,6 @@ void rtw_reset_securitypriv(struct adapter *adapter)/* We have to backup the PMK information for WiFi PMK Caching test item. */ /* Backup the btkip_countermeasure information. */ /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ -memset (&backup_pmkid[0 ],0x00 ,sizeof (struct rt_pmkid_list ) *NUM_PMKID_CACHE );memcpy (&backup_pmkid[0 ], &adapter->securitypriv.PMKIDList[0 ],sizeof (struct rt_pmkid_list ) *NUM_PMKID_CACHE ); backup_index = adapter->securitypriv.PMKIDIndex; backup_counter = adapter->securitypriv.btkip_countermeasure;
Signature · 1 line
1.9.1
PATCH 2/3 staging: media: Remove memset.
In reply to Navya Sri NizamkariThe memory area set by the call to memset is immediately overwritten by the subsequent call to memcpy. Hence, remove that redundant memset.
--- drivers/staging/media/davinci_vpfe/dm365_resizer.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/media/davinci_vpfe/dm365_resizer.c +0 -1
@@ -907,7 +907,6 @@ resizer_set_defualt_configuration(struct vpfe_resizer_device *resizer) .out_chr_pos = VPFE_IPIPE_YUV422_CHR_POS_COSITE, }, }; -memset (&resizer->config,0 ,sizeof (struct resizer_params ));memcpy (&resizer->config, &rsz_default_config,sizeof (struct resizer_params )); }
Signature · 1 line
1.9.1
PATCH 3/3 staging: media: Remove redundant memset.
In reply to Navya Sri NizamkariThe memory area set by the call to memset is immediately overwritten by the subsequent call to memcpy. Hence, remove that redundant memset.
--- drivers/staging/media/davinci_vpfe/dm365_ipipeif.c | 1 - 1 file changed, 1 deletion(-)
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +0 -1
@@ -747,7 +747,6 @@ static void ipipeif_set_default_config(struct vpfe_ipipeif_device *ipipeif) .clip = 4095, }, }; -memset (&ipipeif->config,0 ,sizeof (struct ipipeif_params ));memcpy (&ipipeif->config, &ipipeif_defaults,sizeof (struct ipipeif_params )); }
Signature · 1 line
1.9.1