On Sun, Nov 8, 2015 at 1:26 PM, Ivan Safonov <insafo...@gmail.com> wrote:
> On 11/08/2015 05:11 PM, Andy Shevchenko wrote:
>>
>> On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov <insafo...@gmail.com> 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
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to