* [PATCH v2 06/12] staging: rtl8188eu: use memset instead of for loop
@ 2015-11-08 7:12 Ivan Safonov
0 siblings, 0 replies; only message in thread
From: Ivan Safonov @ 2015-11-08 7:12 UTC (permalink / raw)
To: devel
Cc: Greg Kroah-Hartman, Vaishali Thakkar, Jakub Sitnicki,
Anish Bhatt, Joe Perches, Ivan Safonov, Nicholas Mc Guire,
Alexey Khoroshilov, Rémy Oudompheng, Sudip Mukherjee,
Shraddha Barke, linux-kernel
memset clearer than the for loop.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
---
drivers/staging/rtl8188eu/hal/fw.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c
index 7f1df4d..298e3e8 100644
--- a/drivers/staging/rtl8188eu/hal/fw.c
+++ b/drivers/staging/rtl8188eu/hal/fw.c
@@ -77,12 +77,12 @@ static void _rtl88e_fw_block_write(struct adapter *adapt,
static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen)
{
- u32 i;
+ u32 remain = round_up(pfwlen, 4) - pfwlen;
- for (i = pfwlen; i < roundup(pfwlen, 4); i++)
- pfwbuf[i] = 0;
+ if (remain)
+ memset(pfwbuf, 0, remain);
- return i;
+ return pfwlen + remain;
}
static void _rtl88e_fw_page_write(struct adapter *adapt,
--
2.4.10
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-11-08 7:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-08 7:12 [PATCH v2 06/12] staging: rtl8188eu: use memset instead of for loop Ivan Safonov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®