linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 02/12] wifi: ipw2x00: fix array of flexible structures warnings
Date: Mon, 05 Sep 2022 18:38:05 +0300	[thread overview]
Message-ID: <87y1uxde76.fsf@kernel.org> (raw)
In-Reply-To: <20220904212910.645346411660.I471e8fadce54ea262920828f25b8e84545bcd07e@changeid> (Johannes Berg's message of "Sun, 4 Sep 2022 21:29:02 +0200")

Johannes Berg <johannes@sipsolutions.net> writes:

> From: Johannes Berg <johannes.berg@intel.com>
>
> There are a number of these here, fix them by using
> appropriate casts. No binary changes.
>
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>  drivers/net/wireless/intel/ipw2x00/libipw.h    | 13 ++++++-------
>  drivers/net/wireless/intel/ipw2x00/libipw_rx.c | 10 +++++-----
>  2 files changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/wireless/intel/ipw2x00/libipw.h b/drivers/net/wireless/intel/ipw2x00/libipw.h
> index 7964ef7d15f0..bec7bc273748 100644
> --- a/drivers/net/wireless/intel/ipw2x00/libipw.h
> +++ b/drivers/net/wireless/intel/ipw2x00/libipw.h
> @@ -405,7 +405,7 @@ struct libipw_auth {
>  	__le16 transaction;
>  	__le16 status;
>  	/* challenge */
> -	struct libipw_info_element info_element[];
> +	u8 variable[];

Why u8 is better?

> --- a/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
> +++ b/drivers/net/wireless/intel/ipw2x00/libipw_rx.c
> @@ -1329,8 +1329,8 @@ static int libipw_handle_assoc_resp(struct libipw_device *ieee, struct libipw_as
>  	network->wpa_ie_len = 0;
>  	network->rsn_ie_len = 0;
>  
> -	if (libipw_parse_info_param
> -	    (frame->info_element, stats->len - sizeof(*frame), network))
> +	if (libipw_parse_info_param((void *)frame->variable,
> +				    stats->len - sizeof(*frame), network))

To me this look worse as we need to add an extra cast, and casts are
always problematic.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2022-09-05 15:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-04 19:29 [PATCH 01/12] wifi: ipw2100: fix warnings about non-kernel-doc Johannes Berg
2022-09-04 19:29 ` [PATCH 02/12] wifi: ipw2x00: fix array of flexible structures warnings Johannes Berg
2022-09-05 15:38   ` Kalle Valo [this message]
2022-09-22  6:09   ` Kalle Valo
2022-09-04 19:29 ` [PATCH 03/12] wifi: libertas: fix a couple of sparse warnings Johannes Berg
2022-09-04 19:29 ` [PATCH 04/12] wifi: rndis_wlan: fix array of flexible structures warning Johannes Berg
2022-09-05 15:39   ` Kalle Valo
2022-09-04 19:29 ` [PATCH 05/12] wifi: wl18xx: add some missing endian conversions Johannes Berg
2022-09-04 19:29 ` [PATCH 06/12] wifi: mwifiex: mark a variable unused Johannes Berg
2022-09-04 19:29 ` [PATCH 07/12] wifi: mwifiex: fix array of flexible structures warnings Johannes Berg
2022-09-06 22:20   ` Brian Norris
2022-09-07  6:57     ` Johannes Berg
2022-09-09 20:45       ` Brian Norris
2022-09-10 14:40         ` Johannes Berg
2022-09-04 19:29 ` [PATCH 08/12] wifi: mwifiex: fix endian conversion Johannes Berg
2022-09-06 22:22   ` Brian Norris
2022-09-04 19:29 ` [PATCH 09/12] wifi: mwifiex: fix endian annotations in casts Johannes Berg
2022-09-06 22:21   ` Brian Norris
2022-09-04 19:29 ` [PATCH 10/12] wifi: cw1200: remove RCU STA pointer handling in TX Johannes Berg
2022-09-04 19:29 ` [PATCH 11/12] wifi: cw1200: use get_unaligned_le64() Johannes Berg
2022-09-04 19:29 ` [PATCH 12/12] wifi: b43: remove empty switch statement Johannes Berg
2022-09-07  8:03 ` [PATCH 01/12] wifi: ipw2100: fix warnings about non-kernel-doc Kalle Valo

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=87y1uxde76.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).