lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20151108071206.GA1545@alpha.sfu-kras.ru>
Date:	Sun, 8 Nov 2015 14:12:06 +0700
From:	Ivan Safonov <insafonov@...il.com>
To:	devel@...verdev.osuosl.org
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Vaishali Thakkar <vthakkar1994@...il.com>,
	Jakub Sitnicki <jsitnicki@...il.com>,
	Anish Bhatt <anish@...ech.edu>, Joe Perches <joe@...ches.com>,
	Ivan Safonov <insafonov@...il.com>,
	Nicholas Mc Guire <der.herr@...r.at>,
	Alexey Khoroshilov <khoroshilov@...ras.ru>,
	Rémy Oudompheng <remyoudompheng@...il.com>,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	Shraddha Barke <shraddha.6596@...il.com>,
	linux-kernel@...r.kernel.org
Subject: [PATCH v2 06/12] staging: rtl8188eu: use memset instead of for loop

memset clearer than the for loop.

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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ