[PATCH v2 06/12] staging: rtl8188eu: use memset instead of for loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



memset clearer than the for loop.

Signed-off-by: Ivan Safonov <insafonov@xxxxxxxxx>
---
 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

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux