Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753323AbbKHG5c (ORCPT ); Sun, 8 Nov 2015 01:57:32 -0500 Received: from mail-lb0-f170.google.com ([209.85.217.170]:34192 "EHLO mail-lb0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752468AbbKHG5a (ORCPT ); Sun, 8 Nov 2015 01:57:30 -0500 Date: Sun, 8 Nov 2015 13:45:27 +0700 From: Ivan Safonov To: devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , Vaishali Thakkar , Jakub Sitnicki , Anish Bhatt , Joe Perches , Ivan Safonov , Nicholas Mc Guire , Alexey Khoroshilov , =?iso-8859-1?Q?R=E9my?= Oudompheng , Sudip Mukherjee , Shraddha Barke , linux-kernel@vger.kernel.org Subject: [PATCH 06/12] staging: rtl8188eu: use memset instead of for loop Message-ID: <20151108064527.GA1145@alpha.sfu-kras.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1049 Lines: 36 memset clearer than the for loop. Signed-off-by: Ivan Safonov --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/