Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265189

Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function
Date 2015-11-08 21:30 +0100
Message-ID <qsEL8-4SJ-15@gated-at.bofh.it> (permalink)
References <qss7f-57a-1@gated-at.bofh.it> <qsveN-7gt-3@gated-at.bofh.it> <qswky-7Wb-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Nov 8, 2015 at 1:26 PM, Ivan Safonov <insafonov@gmail.com> wrote:
> On 11/08/2015 05:11 PM, Andy Shevchenko wrote:
>>
>> On Sun, Nov 8, 2015 at 8:37 AM, Ivan Safonov <insafonov@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
--
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/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 02/12] staging: rtl8188eu: return value and argument types  changed in _rtl88e_write_fw function Ivan Safonov <insafonov@gmail.com> - 2015-11-08 08:00 +0100
  Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types  changed in _rtl88e_write_fw function Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-08 11:20 +0100
    Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types  changed in _rtl88e_write_fw function Ivan Safonov <insafonov@gmail.com> - 2015-11-08 12:30 +0100
      Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types  changed in _rtl88e_write_fw function Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-08 21:30 +0100
        Re: [PATCH 02/12] staging: rtl8188eu: return value and argument types  changed in _rtl88e_write_fw function Ivan Safonov <insafonov@gmail.com> - 2015-11-10 10:30 +0100

csiph-web