All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: rtl8723bs: remove memset before memcpy
@ 2017-08-27 20:13 Himanshu Jha
  2017-08-28  6:19 ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Himanshu Jha @ 2017-08-27 20:13 UTC (permalink / raw)
  To: gregkh
  Cc: insafonov, hdegoede, Larry.Finger, devel, linux-kernel, Himanshu Jha

calling memcpy immediately after memset with the same region of memory
makes memset redundant.

Build successfully.

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
---
 drivers/staging/rtl8723bs/core/rtw_ioctl_set.c | 1 -
 drivers/staging/rtl8723bs/core/rtw_mlme.c      | 2 --
 drivers/staging/rtl8723bs/os_dep/mlme_linux.c  | 2 --
 3 files changed, 5 deletions(-)

diff --git a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
index e0793f8..d815a69 100644
--- a/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
+++ b/drivers/staging/rtl8723bs/core/rtw_ioctl_set.c
@@ -127,7 +127,6 @@ u8 rtw_do_join(struct adapter *padapter)
 
 				pibss = padapter->registrypriv.dev_network.MacAddress;
 
-				memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
 				memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
 
 				rtw_update_registrypriv_dev_network(padapter);
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index 9f44dd0..6b77820 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -922,7 +922,6 @@ void rtw_surveydone_event_callback(struct adapter	*adapter, u8 *pbuf)
 
 					RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("switching to adhoc master\n"));
 
-					memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
 					memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
 
 					rtw_update_registrypriv_dev_network(adapter);
@@ -1774,7 +1773,6 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
 
 			memcpy(pdev_network, &tgt_network->network, get_wlan_bssid_ex_sz(&tgt_network->network));
 
-			memset(&pdev_network->Ssid, 0, sizeof(struct ndis_802_11_ssid));
 			memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
 
 			rtw_update_registrypriv_dev_network(adapter);
diff --git a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
index 46315d1..3e29df0 100644
--- a/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/mlme_linux.c
@@ -91,8 +91,6 @@ void rtw_reset_securitypriv(struct adapter *adapter)
 		/*  Backup the btkip_countermeasure information. */
 		/*  When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */
 
-		memset(&backupPMKIDList[ 0 ], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE);
-
 		memcpy(&backupPMKIDList[ 0 ], &adapter->securitypriv.PMKIDList[ 0 ], sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE);
 		backupPMKIDIndex = adapter->securitypriv.PMKIDIndex;
 		backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: rtl8723bs: remove memset before memcpy
  2017-08-27 20:13 [PATCH] staging: rtl8723bs: remove memset before memcpy Himanshu Jha
@ 2017-08-28  6:19 ` Dan Carpenter
  2017-08-28  7:18   ` Himanshu Jha
       [not found]   ` <20170828064341.GA2506@himanshu-Vostro-3559>
  0 siblings, 2 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-08-28  6:19 UTC (permalink / raw)
  To: Himanshu Jha
  Cc: gregkh, devel, insafonov, linux-kernel, hdegoede, Larry.Finger

On Mon, Aug 28, 2017 at 01:43:31AM +0530, Himanshu Jha wrote:
> calling memcpy immediately after memset with the same region of memory
> makes memset redundant.
> 
> Build successfully.
> 

Thanks for the patch, it looks good.  You don't need to say that it
builds successfully, because we already assume that's true.

> Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> ---

Sometimes I put a comment here under the cut off line if I want people
to know that I haven't tested a patch.

Anyway, don't resend the patch.  It's fine as-is (unless Greg
complains) but it's just for future reference.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging: rtl8723bs: remove memset before memcpy
  2017-08-28  6:19 ` Dan Carpenter
@ 2017-08-28  7:18   ` Himanshu Jha
       [not found]   ` <20170828064341.GA2506@himanshu-Vostro-3559>
  1 sibling, 0 replies; 4+ messages in thread
From: Himanshu Jha @ 2017-08-28  7:18 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: gregkh, devel, insafonov, linux-kernel, hdegoede, Larry.Finger

On Mon, Aug 28, 2017 at 09:19:06AM +0300, Dan Carpenter wrote:
> On Mon, Aug 28, 2017 at 01:43:31AM +0530, Himanshu Jha wrote:
> > calling memcpy immediately after memset with the same region of memory
> > makes memset redundant.
> > 
> > Build successfully.
> > 
> 
> Thanks for the patch, it looks good.  You don't need to say that it
> builds successfully, because we already assume that's true.
> 
> > Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
> > ---
> 
> Sometimes I put a comment here under the cut off line if I want people
> to know that I haven't tested a patch.
> 
> Anyway, don't resend the patch.  It's fine as-is (unless Greg
> complains) but it's just for future reference.

Thanks for the feedback and i will keep that in mind for future patches.
Himanshu Jha
> 
> regards,
> dan carpenter
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Hangs while building the cross function DB
       [not found]   ` <20170828064341.GA2506@himanshu-Vostro-3559>
@ 2017-08-28  7:43     ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-08-28  7:43 UTC (permalink / raw)
  To: Himanshu Jha, smatch

Himanshu Jha had a question about hangs while building the cross
function DB.

Building the cross function DB used to hang my system for half an hour
but I kept tweaking it so now it's barely noticeable.  I have a quad
core with 32GB of RAM.  The problem is that Smatch is reading from the
warns.txt file and writing to smatch_db.sqlite file as fast as possible.
Both files are around 15-20GB.  This IO pattern is very hard on the
default Linux IO schedulers.

The BFQ scheduler is designed to fix these hangs, so your best bet is to
try that.
https://unix.stackexchange.com/questions/375600/how-to-enable-and-use-the-bfq-scheduler

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-28  7:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27 20:13 [PATCH] staging: rtl8723bs: remove memset before memcpy Himanshu Jha
2017-08-28  6:19 ` Dan Carpenter
2017-08-28  7:18   ` Himanshu Jha
     [not found]   ` <20170828064341.GA2506@himanshu-Vostro-3559>
2017-08-28  7:43     ` Hangs while building the cross function DB Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.