[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20121210085516.GO6568@mwanda>
Date: Mon, 10 Dec 2012 11:55:16 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Cyril Roelandt <tipecaml@...il.com>
Cc: devel@...verdev.osuosl.org, florian.c.schilhabel@...glemail.com,
gregkh@...uxfoundation.org, kernel-janitors@...r.kernel.org,
linux-kernel@...r.kernel.org, yongjun_wei@...ndmicro.com.cn,
marcos.souza.org@...il.com, Larry.Finger@...inger.net
Subject: Re: [PATCH] staging: rtl8712: avoid a useless call to memset().
On Sun, Dec 09, 2012 at 01:31:50AM +0100, Cyril Roelandt wrote:
> On 12/05/2012 08:11 AM, Dan Carpenter wrote:
> >On Wed, Dec 05, 2012 at 02:22:02AM +0100, Cyril Roelandt wrote:
> >>In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that
> >>has just been zeroed by a call to memset().
> >>
> >
> >I look at it like the original code is fine. Your version is also
> >fine but is it worth the churn? Also the curly braces are not
> >needed.
> >
>
> Sorry about the braces.
>
> I just thought the code would be easier to understand this way, but
> it's probably OK to leave it as it currently is too.
>
Ah. I'd buy that. I like readability fixes. The indenting is also
messed up and confusing. It should be:
if (check_fwstate(pmlmepriv, _FW_LINKED | WIFI_ADHOC_MASTER_STATE |
WIFI_AP_STATE))
memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN);
else
memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists