Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752097AbbKHUYy (ORCPT ); Sun, 8 Nov 2015 15:24:54 -0500 Received: from mail-yk0-f178.google.com ([209.85.160.178]:35740 "EHLO mail-yk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750912AbbKHUYx (ORCPT ); Sun, 8 Nov 2015 15:24:53 -0500 MIME-Version: 1.0 In-Reply-To: <563F315B.2020609@gmail.com> References: <20151108063725.GA1073@alpha.sfu-kras.ru> <563F315B.2020609@gmail.com> Date: Sun, 8 Nov 2015 22:24:52 +0200 Message-ID: Subject: Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function From: Andy Shevchenko To: Ivan Safonov Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , Vaishali Thakkar , Jakub Sitnicki , Anish Bhatt , Joe Perches , Nicholas Mc Guire , Alexey Khoroshilov , =?UTF-8?Q?R=C3=A9my_Oudompheng?= , Sudip Mukherjee , Shraddha Barke , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1463 Lines: 45 On Sun, Nov 8, 2015 at 1:26 PM, Ivan Safonov wrote: > On 11/08/2015 05:11 PM, Andy Shevchenko wrote: >> >> On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov wrote: >>> >>> Ideally the function should not change the variables outside of its body. >>> -static void _rtl88e_fill_dummy(u8 *pfwbuf, u32 *pfwlen) >>> +static u32 _rtl88e_fill_dummy(u8 *pfwbuf, u32 pfwlen) >>> { >>> u32 i; >>> >>> - for (i = *pfwlen; i < roundup(*pfwlen, 4); i++) >>> + for (i = pfwlen; i < roundup(pfwlen, 4); i++) >>> pfwbuf[i] = 0; >> >> memset() ? >> >>> - *pfwlen = i; >>> + return i; >>> } >>> >>> static void _rtl88e_fw_page_write(struct adapter *adapt, >>> @@ -103,7 +103,7 @@ static void _rtl88e_write_fw(struct adapter *adapt, >>> u8 *buffer, u32 size) >>> u32 page_no, remain; >>> u32 page, offset; >>> >>> - _rtl88e_fill_dummy(buf_ptr, &size); >>> + size = _rtl88e_fill_dummy(buf_ptr, size); > memset applied in another patch. Here only replacement of the function type. Since it's used only once it would be nice to replace it by plain memset() in one patch. -- With Best Regards, Andy Shevchenko -- 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/