linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Sven Eckelmann <sven@narfation.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	John Crispin <john@phrozen.org>
Subject: Re: [RESEND V2 3/4] ath11k: switch to using ieee80211_tx_status_ext()
Date: Wed, 12 Feb 2020 17:55:07 +0200	[thread overview]
Message-ID: <87wo8r7qck.fsf@codeaurora.org> (raw)
In-Reply-To: <4744821.iAptAJfnkX@bentobox> (Sven Eckelmann's message of "Tue, 11 Feb 2020 15:38:22 +0100")

Sven Eckelmann <sven@narfation.org> writes:

> On Tuesday, 11 February 2020 14:10:04 CET Kalle Valo wrote:
> [...]
>> > diff --git a/drivers/net/wireless/ath/ath11k/dp_tx.c b/drivers/net/wireless/ath/ath11k/dp_tx.c
>> > index 7b532bf9acd8..66a6cfd54ad9 100644
>> > --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
>> > +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
>> > @@ -357,9 +357,12 @@ static void ath11k_dp_tx_complete_msdu(struct ath11k *ar,
>> >  				       struct sk_buff *msdu,
>> >  				       struct hal_tx_status *ts)
>> >  {
>> > +	struct ieee80211_tx_status status = { 0 };
>> 
>> This adds a sparse warning:
>> 
>> drivers/net/wireless/ath/ath11k/dp_tx.c:350:47: warning: Using plain
>> integer as NULL pointer
>> 
>> Seems like a false warning, no? But not sure how to shut up the warning,
>> using '{ NULL }' would do that but just feels wrong. Any opinions?
>
> Why is this a false warning? The structure is following:
>
>     struct ieee80211_tx_status {
>     	struct ieee80211_sta *sta;
>     	struct ieee80211_tx_info *info;
>     	struct sk_buff *skb;
>     	struct rate_info *rate;
>     };
>
> And this is a pre-C99 initializer. The equal C99-Initializer would be
>
>     struct ieee80211_tx_status status = {
>     	.sta = NULL,
> 	};
>
> So it is initializing status.sta with 0. But status.sta is a pointer
> and we should use NULL for pointers instead of plain 0. If you want
> to initialize the object on stack to zero but not initialize each 
> member then just use {}.

Ah, of course. Thanks for pointing this out.

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

  parent reply	other threads:[~2020-02-12 15:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-04 15:11 [RESEND V2 1/4] ath11k: drop tx_info from ath11k_sta John Crispin
2020-02-04 15:11 ` [RESEND V2 2/4] ath11k: add HE rate accounting to driver John Crispin
2020-02-04 15:11 ` [RESEND V2 3/4] ath11k: switch to using ieee80211_tx_status_ext() John Crispin
2020-02-11 13:10   ` Kalle Valo
2020-02-11 14:38     ` Sven Eckelmann
2020-02-11 14:43       ` John Crispin
2020-02-12 15:55       ` Kalle Valo [this message]
2020-02-04 15:11 ` [PATCH 4/4] ath11k: add more HE fields into radiotap header John Crispin
2020-02-11 13:27   ` Kalle Valo
2020-02-11 18:30 ` [RESEND V2 1/4] ath11k: drop tx_info from ath11k_sta 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=87wo8r7qck.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=john@phrozen.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sven@narfation.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).