netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Joe Damato <jdamato@fastly.com>,
	Stanislav Fomichev <stfomichev@gmail.com>,
	netdev@vger.kernel.org, pabeni@redhat.com, edumazet@google.com,
	kuba@kernel.org, mkarsten@uwaterloo.ca,
	"David S. Miller" <davem@davemloft.net>,
	Shuah Khan <shuah@kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK"
	<linux-kselftest@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] selftests: net: cleanup busy_poller.c
Date: Thu, 5 Dec 2024 09:51:33 +0000	[thread overview]
Message-ID: <20241205095133.GA3382@kernel.org> (raw)
In-Reply-To: <Z08zacl_IhADP0FZ@LQ3V64L9R2>

On Tue, Dec 03, 2024 at 08:35:53AM -0800, Joe Damato wrote:
> On Tue, Dec 03, 2024 at 08:26:11AM -0800, Joe Damato wrote:
> > On Mon, Dec 02, 2024 at 09:14:58PM -0800, Stanislav Fomichev wrote:
> > > On 12/03, Joe Damato wrote:
> > > > Fix various integer type conversions by using strtoull and a temporary
> > > > variable which is bounds checked before being casted into the
> > > > appropriate cfg_* variable for use by the test program.
> > > > 
> > > > While here, free the strdup'd cfg string for overall hygenie.
> > > 
> > > Thank you for fixing this! I also saw them this morning after a net-next
> > > pull and was about to post... I also see the following (LLVM=1):
> > > 
> > > busy_poller.c:237:6: warning: variable 'napi_id' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> > >   237 |         if (napi_list->obj._present.id)
> > >       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
> > > busy_poller.c:243:38: note: uninitialized use occurs here
> > >   243 |         netdev_napi_set_req_set_id(set_req, napi_id);
> > >       |                                             ^~~~~~~
> > > busy_poller.c:237:2: note: remove the 'if' if its condition is always true
> > >   237 |         if (napi_list->obj._present.id)
> > >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >   238 |                 napi_id = napi_list->obj.id;
> > >       |                                            ~
> > >   239 |         else
> > >       |         ~~~~
> > >   240 |                 error(1, 0, "napi ID not present?");
> > >       |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > busy_poller.c:226:18: note: initialize the variable 'napi_id' to silence this warning
> > >   226 |         uint32_t napi_id;
> > >       |                         ^
> > >       |                          = 0
> > > 1 warning generated.
> > > 
> > > Presumably the compiler can't connect that fact that (!preset.id) ->
> > > error. So maybe initialize napi_id to 0 to suppress it as well?
> > 
> > Thanks for the report! Can I ask what compiler and version you are
> > using so that I can test before reposting?
> 
> Err, sorry. Haven't had coffee yet. I see you mentioned LLVM=1
> above. When I use that I also get the same error.
> 
> FWIW: I'm using clang version 10.0.0-4ubuntu1 (which as far as I
> can tell is pretty old). I'll see if I can get a newer version just
> to make sure no other warnings appear.

Hi Joe,

If you are still looking for recent LLVM toolchains, I suggest taking
a look at https://mirrors.edge.kernel.org/pub/tools/llvm/

      reply	other threads:[~2024-12-05  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-03  1:28 [PATCH net-next] selftests: net: cleanup busy_poller.c Joe Damato
2024-12-03  5:14 ` Stanislav Fomichev
2024-12-03 16:26   ` Joe Damato
2024-12-03 16:35     ` Joe Damato
2024-12-05  9:51       ` Simon Horman [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=20241205095133.GA3382@kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jdamato@fastly.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=mkarsten@uwaterloo.ca \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    --cc=stfomichev@gmail.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;
as well as URLs for NNTP newsgroup(s).