From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Kees Cook <keescook@chromium.org>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Kalle Valo <kvalo@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org
Subject: Re: [PATCH 6/6][next] airo: Avoid clashing function prototypes
Date: Wed, 19 Oct 2022 00:58:50 -0500 [thread overview]
Message-ID: <f134c4ff-aac0-eb79-871e-73cff18a57c8@embeddedor.com> (raw)
In-Reply-To: <202210171950.B5F2676D7F@keescook>
On 10/17/22 21:53, Kees Cook wrote:
> On Mon, Oct 17, 2022 at 03:36:20PM -0500, Gustavo A. R. Silva wrote:
>> [...]
>> @@ -6312,16 +6326,16 @@ static int airo_get_mode(struct net_device *dev,
>> /* If not managed, assume it's ad-hoc */
>> switch (local->config.opmode & MODE_CFG_MASK) {
>> case MODE_STA_ESS:
>> - *uwrq = IW_MODE_INFRA;
>> + uwrq->mode = IW_MODE_INFRA;
>> break;
>> case MODE_AP:
>> - *uwrq = IW_MODE_MASTER;
>> + uwrq->mode = IW_MODE_MASTER;
>> break;
>> case MODE_AP_RPTR:
>> - *uwrq = IW_MODE_REPEAT;
>> + uwrq->mode = IW_MODE_REPEAT;
>> break;
>> default:
>> - *uwrq = IW_MODE_ADHOC;
>> + uwrq->mode = IW_MODE_ADHOC;
>> }
>>
>> return 0;
>
> Sometimes you use the union directly, sometimes not. What was your
> heuristic for that?
Oh it is just that I had previously used a new variable in function airo_set_mode(),
and then I immediately ran into this similar scenario (function airo_get_mode) and
I said "wait a second, why don't I directly use the union, instead? :thinking_face:"
and I did, and moved on. :P
>
> Regardless, looks good!
>
> Reviewed-by: Kees Cook <keescook@chromium.org>
>
Thanks for this!
BTW, I already have a new series (this time a 4-patch series, instead of 6), with
the latest fixes, here:
https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git/log/?h=6.1-rc1-Wcast-function-type-strict
I think we could quickly review it tomorrow before I send it out. :)
--
Gustavo
prev parent reply other threads:[~2022-10-19 5:59 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-17 20:32 [PATCH 0/6][next] Avoid clashing function prototypes Gustavo A. R. Silva
2022-10-17 20:33 ` [PATCH 1/6][next] orinoco: " Gustavo A. R. Silva
2022-10-18 2:26 ` Kees Cook
2022-10-17 20:34 ` [PATCH 2/6][next] cfg80211: " Gustavo A. R. Silva
2022-10-18 2:41 ` Kees Cook
2022-10-18 19:31 ` Gustavo A. R. Silva
2022-10-17 20:34 ` [PATCH 3/6][next] ipw2x00: Remove unnecessary cast to iw_handler in ipw_wx_handlers Gustavo A. R. Silva
2022-10-18 2:43 ` Kees Cook
2022-10-17 20:35 ` [PATCH 4/6][next] hostap: Avoid clashing function prototypes Gustavo A. R. Silva
2022-10-18 2:48 ` Kees Cook
2022-10-17 20:35 ` [PATCH 5/6][next] zd1201: " Gustavo A. R. Silva
2022-10-18 2:49 ` Kees Cook
2022-10-17 20:36 ` [PATCH 6/6][next] airo: " Gustavo A. R. Silva
2022-10-18 2:53 ` Kees Cook
2022-10-19 5:58 ` Gustavo A. R. Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f134c4ff-aac0-eb79-871e-73cff18a57c8@embeddedor.com \
--to=gustavo@embeddedor.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavoars@kernel.org \
--cc=keescook@chromium.org \
--cc=kuba@kernel.org \
--cc=kvalo@kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox