Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3305347pxj; Tue, 1 Jun 2021 02:07:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxA9ONGlqRrTiauIhn7z7wr7trGcZ1DrGflU9yTgpNSKbAZvd8J+xFCcqnBsRZXVl6lJn7s X-Received: by 2002:aa7:c9c5:: with SMTP id i5mr20700439edt.160.1622538423184; Tue, 01 Jun 2021 02:07:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622538423; cv=none; d=google.com; s=arc-20160816; b=c17zo+fVYzMZypqCUv2vdMnqMtR1FqmiVG/k5yQURdX4zP7aXljQ8HGEkNstOuEPwf Q4iEgNneX0WgMLecRTW5xwK6gVYFYanyBOdvLn0ZVhOSp/M26iTOvaWMsCtLoeNlwG0I zMLVOR0Mzs1pnxWFdyUE/DOMDpMhSBn9BSwcfh9YkSxiA7gJsoXxA+eeAZofkk7X+fG/ J6Mpe6Wt1j3Rc5ukFbEdZ6cOCP9XE5TSwG85XBk9MArkS2OUq43NBGLDZGfheeqFGc5e 2NFI52+qfJjO9VpeatMSQCCrJ3kTJAveTqEMT7lLE3eaSe2MwGkZlEfEHcOX1EvVeCGw Gp4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:to:subject:message-id :date:from:in-reply-to:references:mime-version:dkim-signature; bh=TC49diZ8yvtNeRfoDHho9BsiKWB6WeW1SJE0j6cAKdU=; b=nwBrxIf6iIY68izA2fsMUjh9sOphd2Um+Bj9ItjAELMRfQlzairisMxdt8nn/PbX5F /2bcQg5uPhMS97ajoOk0GJAuFnIGOqHFF+J51DT1qDTrq7RI3dAaYNJqf2mn+jTOjAz/ tAS4jQXSvKJaIDO26txX0T1kzUc1Gfk6eCmCRwpmG3XHcePe25dgK7j0LX9D442Mnc55 ZtHz3u4zCanZwL4lvqhr1OiSM8WbB2iU6sGnAsJTQgc8suBKMRXBRjxGIl3YR/eOYoDu BLPmBjd+MxRsdwramEtQlspv8M0YHxVnZX3MK7atGpKyM92bkEHNIKVgD6F9pE1Oekc0 7xfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dYX25Y4I; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si19156906ejb.0.2021.06.01.02.06.39; Tue, 01 Jun 2021 02:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dYX25Y4I; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233342AbhFAJIJ (ORCPT + 99 others); Tue, 1 Jun 2021 05:08:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48478 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233336AbhFAJIH (ORCPT ); Tue, 1 Jun 2021 05:08:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622538385; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TC49diZ8yvtNeRfoDHho9BsiKWB6WeW1SJE0j6cAKdU=; b=dYX25Y4Iqimh5oLvTA6qBEDPuntB3jBavsXxjHvSlcaU1blU8u2/SbmeDglxWPuUvHwMD3 ML+MbARBY+wKoTMBaf0Y2OJNLc/MSBOk197GMxcmBd1lFyUmMn3bcuBSxcbRpL2lUDZyMf ekd0tzoSY6UNY8fF8R324/SjWK/eKH4= Received: from mail-il1-f197.google.com (mail-il1-f197.google.com [209.85.166.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-436-dMn7G792Pbm8ZTXO8-vCVw-1; Tue, 01 Jun 2021 05:06:22 -0400 X-MC-Unique: dMn7G792Pbm8ZTXO8-vCVw-1 Received: by mail-il1-f197.google.com with SMTP id n18-20020a92d9d20000b02901d7b2ca03e6so8305457ilq.1 for ; Tue, 01 Jun 2021 02:06:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=TC49diZ8yvtNeRfoDHho9BsiKWB6WeW1SJE0j6cAKdU=; b=ZN6qbz6Al+LAp4ogncEYkvOmWXHlrn2NOC+nVwIZfOKJreQWWvRvW+oxP6k2sknP2F Emjp4zJK+qnriC/QINJTPkABMqV3VEWjdr33sa70KFvJyBaQ6xFWO2uh39kmN5k1ZsSV KUyiWtwrWQC0W3jflMQrq2k6c9JS8XweVFA3FcET5K6R0toB0rc+0oraDkWeYTq1KqKz 6eCnqkLpK92LnXuyTychOMZnAilvl4+E5SJHN1wikeMJ44+vnHnOiOSKFZn0lwdy5gWo WCfXG9I4tAFWpX2rL9damG21wjiTk516ocG23cHFnkc+KbXFauvI8hFMY1ed2CyCRj2T W6Uw== X-Gm-Message-State: AOAM530AYh0JUJSBR25MHIZrsCbFD3FMKH92yKfVImeeJOG9+T9yh+WL nBEfpRNRcG426BnsJAKYnKkWRx41b7xs9BpmCW8iJRbiKxEUIOq+hq6t002OuZcQvcEKy5OFUVL q3+t1cMEG4CEeM9Knpj93ckOjZg9H4dqQpqSBFvCByRY= X-Received: by 2002:a02:384b:: with SMTP id v11mr11232995jae.90.1622538382158; Tue, 01 Jun 2021 02:06:22 -0700 (PDT) X-Received: by 2002:a02:384b:: with SMTP id v11mr11232977jae.90.1622538382042; Tue, 01 Jun 2021 02:06:22 -0700 (PDT) MIME-Version: 1.0 References: <20210511070257.7843-1-ihuguet@redhat.com> In-Reply-To: <20210511070257.7843-1-ihuguet@redhat.com> From: =?UTF-8?B?w43DsWlnbyBIdWd1ZXQ=?= Date: Tue, 1 Jun 2021 11:06:11 +0200 Message-ID: Subject: Re: [PATCH] BRCM80211: improve readability on addresses copy To: Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , Kalle Valo , "David S. Miller" , Jakub Kicinski , linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, SHA-cyfmac-dev-list@infineon.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, May 11, 2021 at 9:04 AM =C3=8D=C3=B1igo Huguet = wrote: > > A static analyzer identified as a potential bug the copy of > 12 bytes from a 6 bytes array to a 6 bytes array. Both > arrays are 6 bytes addresses. > > Although not being a real bug, it is not immediately clear > why is done this way: next 6 bytes address, contiguous to > the first one, must also be copied to next contiguous 6 bytes > address of the destination. > > Copying each one separately will make both static analyzers > and reviewers happier. > > Signed-off-by: =C3=8D=C3=B1igo Huguet > --- > drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c b/dr= ivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c > index 763e0ec583d7..26de1bd7fee9 100644 > --- a/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmsmac/main.c > @@ -6607,7 +6607,8 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, = struct ieee80211_hw *hw, > rts->frame_control =3D cpu_to_le16(IEEE80211_FTYP= E_CTL | > IEEE80211_STYPE_= RTS); > > - memcpy(&rts->ra, &h->addr1, 2 * ETH_ALEN); > + memcpy(&rts->ra, &h->addr1, ETH_ALEN); > + memcpy(&rts->ta, &h->addr2, ETH_ALEN); > } > > /* mainrate > -- > 2.31.1 > Hello, About 3 weeks ago I sent this patch, just with a small style change proposal. Any feedback would be appreciated. Thanks! --=20 =C3=8D=C3=B1igo Huguet