[PATCH v2 2/3] staging: rtl8188eu: ARRAY_SIZE instead of sizeof/sizeof used

Sudip Mukherjee sudipm.mukherjee at gmail.com
Sat Oct 10 09:49:00 UTC 2015


On Sat, Oct 10, 2015 at 04:31:21PM +0700, Ivan Safonov wrote:
> On 10/10/2015 03:35 PM, Sudip Mukherjee wrote:
> >On Thu, Oct 08, 2015 at 10:21:07PM +0700, Ivan Safonov wrote:
> >>This patch inserts ARRAY_SIZE instead of sizeof(type array[])/sizeof(type).
> >>---
> >>Changes in v2:
> >>   - inserted description to this patch
> >>
> >>Signed-off-by: Ivan Safonov <insafonov at gmail.com>
> >>---
<snip>
> >>@@ -574,8 +574,8 @@ static void rtl_addr_delay(struct adapter *adapt,
> >>  static bool config_bb_with_pgheader(struct adapter *adapt)
> >>  {
> >>-	u32 i = 0;
> >>-	u32 arraylen = sizeof(array_phy_reg_pg_8188e) / sizeof(u32);
> >>+	u32 i;
> >This is an unrelated change and it is not mentioned in the commit log
> >that you are also making them as const.
> >
> >regards
> >sudip
> 
> This variable is used only once in the body of a small function.
> This is so important?

The change is correct but that is not related to what you are doing in
this patch.

> 
> Can I add more code in the patch (the whole function) that such
> moments do not require a special mention?

whatever you are doing in the patch should be mentioned in the commit
message. Like in this patch you made the variables as const but that was
not mentioned in the commit message.

regards
sudip


More information about the devel mailing list