netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>,
	oss-drivers@netronome.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nfp: bpf: improve handling for disabled BPF syscall
Date: Sun, 25 Sep 2016 16:52:00 +0100	[thread overview]
Message-ID: <20160925165200.41266650@jkicinski-Precision-T1700> (raw)
In-Reply-To: <20160923202443.4130858-1-arnd@arndb.de>

On Fri, 23 Sep 2016 22:23:59 +0200, Arnd Bergmann wrote:
> I stumbled over a new warning during randconfig testing,
> with CONFIG_BPF_SYSCALL disabled:
> 
> drivers/net/ethernet/netronome/nfp/nfp_net_offload.c: In function 'nfp_net_bpf_offload':
> drivers/net/ethernet/netronome/nfp/nfp_net_offload.c:263:3: error: '*((void *)&res+4)' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> drivers/net/ethernet/netronome/nfp/nfp_net_offload.c:263:3: error: 'res.n_instr' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> As far as I can tell, this is a false positive caused by the compiler
> getting confused about a function that is partially inlined, but it's
> easy to avoid while improving the code:
> 
> The nfp_bpf_jit() stub helper for that configuration is unusual as it
> is defined in a header file but not marked 'static inline'. By moving
> the compile-time check into the caller using the IS_ENABLED() macro,
> we can remove that stub and simplify the nfp_net_bpf_offload_prepare()
> function enough to unconfuse the compiler.
> 
> Fixes: 7533fdc0f77f ("nfp: bpf: add hardware bpf offload")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks Arnd!  static inline definitely missing there but if we can
depend on dead code elimination to remove the symbol that's even cooler!

Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>

  reply	other threads:[~2016-09-25 15:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-23 20:23 [PATCH] nfp: bpf: improve handling for disabled BPF syscall Arnd Bergmann
2016-09-25 15:52 ` Jakub Kicinski [this message]
2016-09-26  6:28 ` David Miller

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=20160925165200.41266650@jkicinski-Precision-T1700 \
    --to=jakub.kicinski@netronome.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=oss-drivers@netronome.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).