From: Jeremy Sowden <jeremy@azazel.net>
To: Julius Niedworok <julius.n@gmx.net>
Cc: Kalle Valo <kvalo@codeaurora.org>,
ga58taw@mytum.de, linux-wireless@vger.kernel.org,
david@redhat.com, nc@net.in.tum.de,
Johannes Berg <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC v2] mac80211: debugfs option to force TX status frames
Date: Wed, 20 Mar 2019 12:13:20 +0000 [thread overview]
Message-ID: <20190320121320.myrxmtfccaoybyih@azazel.net> (raw)
In-Reply-To: <D78A58DC-E38B-4BD8-9D11-A873FFE16602@gmx.net>
[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]
On 2019-03-19, at 16:07:32 +0100, Julius Niedworok wrote:
> On 11.03.2019 15:52, Jeremy Sowden wrote:
> > It's the value that matters, not the type. It will only be too big
> > for the buffer if the result of casting local->force_tx_status to
> > int is less than -9 or greeater than 99.
> >
> > scnprintf(buf, size(buf), "%lld\n",
> > (long long)local->force_tx_status)
> >
> > would also be fine if the value were in range. Note also that
> > scnprintf will not overrun the buffer: it will truncate the string.
>
> Thanks for the clarification :)
You're welcome. :)
> > As it happens, arguments to variadic functions are subject to the
> > "default argument promotions," so if local->force_tx_status is in
> > fact a bool (I can't find the definition), it would be promoted to
> > int and the cast is superfluous.
>
> Yes - the cast is superfluous. We still think it might be useful to
> keep it there to make the point that the value will be casted.
> However, if you prefer to omit the cast, we are happy to take it out.
If I were maintaining this code, I'd probably take it out. However, I
did have to check the documentation to verify that the cast wasn't
required, and I know the more obscure corners of the C standard pretty
well, so it may cause less confusion to keep it.
J.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2019-03-20 12:13 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 9:40 [PATCH RFC] mac80211: Use IFF_ECHO to force delivery of tx_status frames Julius Niedworok
2019-02-26 11:04 ` Oliver Hartkopp
2019-02-26 13:13 ` Julius Niedworok
2019-02-26 13:33 ` Johannes Berg
2019-02-28 9:05 ` Julius Niedworok
2019-03-01 8:32 ` Johannes Berg
2019-03-02 15:16 ` Julius Niedworok
2019-03-06 20:02 ` [PATCH RFC v2] mac80211: debugfs option to force TX status frames Julius Niedworok
2019-03-07 15:42 ` Kalle Valo
2019-03-07 19:30 ` ga58taw
2019-03-11 14:03 ` Kalle Valo
2019-03-11 14:52 ` Jeremy Sowden
2019-03-19 15:07 ` Julius Niedworok
2019-03-20 12:13 ` Jeremy Sowden [this message]
2019-03-28 20:01 ` [PATCH v3] " Julius Niedworok
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=20190320121320.myrxmtfccaoybyih@azazel.net \
--to=jeremy@azazel.net \
--cc=davem@davemloft.net \
--cc=david@redhat.com \
--cc=ga58taw@mytum.de \
--cc=johannes@sipsolutions.net \
--cc=julius.n@gmx.net \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nc@net.in.tum.de \
--cc=netdev@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