When used on externs SEC() macro will trigger compilation warning about
inapplicable `__attribute__((used))`. That's expected for extern declarations,
so suppress it with the corresponding _Pragma.
Signed-off-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_helpers.h | 11 +--
1 file changed, 9
When used on externs SEC() macro will trigger compilation warning about
inapplicable `__attribute__((used))`. That's expected for extern declarations,
so suppress it with the corresponding _Pragma.
Signed-off-by: Andrii Nakryiko
---
tools/lib/bpf/bpf_helpers.h | 11 +--
1 file changed, 9
On 3/8/21 8:43 PM, Andrii Nakryiko wrote:
Add missing return type to BPF_KPROBE definition. Without it, compiler
generates the following warning:
progs/loop6.c:68:12: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct
Add missing return type to BPF_KPROBE definition. Without it, compiler
generates the following warning:
progs/loop6.c:68:12: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
BPF_KPROBE(trace_virtqueue_add_sgs, void *unused, struct scatterlist **sgs,
^
1 warning gener
On Mon, 30 Nov 2020 09:18:59 +
David Laight wrote:
> From: Stephen Hemminger
> > Sent: 30 November 2020 00:22
> >
> > The code here was doing strncpy() in a way that causes gcc 10
> > warning about possible string overflow. Just use strlcpy() which
> > will null terminate and bound the strin
From: Stephen Hemminger
> Sent: 30 November 2020 00:22
>
> The code here was doing strncpy() in a way that causes gcc 10
> warning about possible string overflow. Just use strlcpy() which
> will null terminate and bound the string as expected.
>
> This has existed since start of git era so no Fix
With gcc-10 it complains about array subscript error.
f_u32.c: In function ‘u32_parse_opt’:
f_u32.c:1113:24: warning: array subscript 0 is outside the bounds of an
interior zero-length array ‘struct tc_u32_key[0]’ [-Wzero-length-bounds]
1113 |hash = sel2.sel.keys[0].val & sel2.sel.keys[0].ma
The code here was doing strncpy() in a way that causes gcc 10
warning about possible string overflow. Just use strlcpy() which
will null terminate and bound the string as expected.
This has existed since start of git era so no Fixes tag.
Signed-off-by: Stephen Hemminger
---
misc/ifstat.c | 2 +-
On 8/18/20 6:39 PM, Andrii Nakryiko wrote:
On Tue, Aug 18, 2020 at 6:23 PM Yonghong Song wrote:
On 8/18/20 2:33 PM, Andrii Nakryiko wrote:
That compilation warning is more annoying, than helpful.
Curious which compiler and which version caused this issue?
I did not hit with gcc 8.2 or
On Tue, Aug 18, 2020 at 6:23 PM Yonghong Song wrote:
>
>
>
> On 8/18/20 2:33 PM, Andrii Nakryiko wrote:
> > That compilation warning is more annoying, than helpful.
>
> Curious which compiler and which version caused this issue?
> I did not hit with gcc 8.2 or latest clang in my environment.
>
St
On 8/18/20 2:33 PM, Andrii Nakryiko wrote:
That compilation warning is more annoying, than helpful.
Curious which compiler and which version caused this issue?
I did not hit with gcc 8.2 or latest clang in my environment.
Signed-off-by: Andrii Nakryiko
---
tools/lib/bpf/Makefile | 2 +-
That compilation warning is more annoying, than helpful.
Signed-off-by: Andrii Nakryiko
---
tools/lib/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index bf8ed134cb8a..95c946e94ca5 100644
--- a/tools/lib/bpf/Makef
That compilation warning is more annoying, than helpful.
Signed-off-by: Andrii Nakryiko
---
tools/lib/bpf/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
index bf8ed134cb8a..95c946e94ca5 100644
--- a/tools/lib/bpf/Makef
Muchun Song wrote:
> Fix compiler warning(as show below) for !CONFIG_KPROBES_ON_FTRACE.
>
> kernel/kprobes.c: In function 'kill_kprobe':
> kernel/kprobes.c:1116:33: warning: statement with no effect
> [-Wunused-value]
> 1116 | #define disa
On Thu, 6 Aug 2020 01:20:46 +0800
Muchun Song wrote:
> Fix compiler warning(as show below) for !CONFIG_KPROBES_ON_FTRACE.
>
> kernel/kprobes.c: In function 'kill_kprobe':
> kernel/kprobes.c:1116:33: warning: statement with no effect
> [-Wunused-value]
> 1116 | #d
Fix compiler warning(as show below) for !CONFIG_KPROBES_ON_FTRACE.
kernel/kprobes.c: In function 'kill_kprobe':
kernel/kprobes.c:1116:33: warning: statement with no effect
[-Wunused-value]
1116 | #define disarm_kprobe_ftrace(p) (-ENODEV)
| ^
kernel
On Tue, Jun 23, 2020 at 04:09:02PM -0700, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski
>
> Fixes two issues with NO_SHARED_LIBS:
> - #include is ifdef'ed out and thus dlclose()
>triggers an undeclared function compiler warning
> - dlreg_add() is unus
> void xtables_fini(void)
> {
> +#ifndef NO_SHARED_LIBS
> dlreg_free();
> +#endif
> }
Note: I also considered just adding an empty 'void dlreg_free(void)
{}' function in the NO_SHARED_LIBS case, but that doesn't seem to be
the prevalent style...
From: Maciej Żenczykowski
Fixes two issues with NO_SHARED_LIBS:
- #include is ifdef'ed out and thus dlclose()
triggers an undeclared function compiler warning
- dlreg_add() is unused and thus triggers an unused
function warning
Test: builds without warnings
Signed-off-by: M
On Mon, May 11, 2020 at 02:34:04PM -0700, Maciej Żenczykowski wrote:
> From: Maciej Żenczykowski
>
> Fixes:
> In file included from libip4tc.c:113:
> In function ‘iptcc_compile_chain’,
> inlined from ‘iptcc_compile_table’ at libiptc.c:1246:13,
> inlined from ‘iptc_commit’ at libip
From: Maciej Żenczykowski
Fixes:
In file included from libip4tc.c:113:
In function ‘iptcc_compile_chain’,
inlined from ‘iptcc_compile_table’ at libiptc.c:1246:13,
inlined from ‘iptc_commit’ at libiptc.c:2575:8,
inlined from ‘iptc_commit’ at libiptc.c:2513:1:
libiptc.c:1172
You can merge them via:
git fetch https://github.com/zenczykowski/ethtool.git fix-warnings
git merge FETCH_HEAD
and I'll follow up this email with the full set.
On 06/26/2019 02:35 AM, Yonghong Song wrote:
> With CONFIG_MODULES=n, the following compiler warning occurs:
> /data/users/yhs/work/net-next/kernel/trace/bpf_trace.c:605:13: warning:
> ‘do_bpf_send_signal’ defined but not used [-Wunused-function]
> static void do_bpf_send_s
> On Jun 25, 2019, at 5:35 PM, Yonghong Song wrote:
>
> With CONFIG_MODULES=n, the following compiler warning occurs:
> /data/users/yhs/work/net-next/kernel/trace/bpf_trace.c:605:13: warning:
> ‘do_bpf_send_signal’ defined but not used [-Wunused-function]
With CONFIG_MODULES=n, the following compiler warning occurs:
/data/users/yhs/work/net-next/kernel/trace/bpf_trace.c:605:13: warning:
‘do_bpf_send_signal’ defined but not used [-Wunused-function]
static void do_bpf_send_signal(struct irq_work *entry)
The __init function
On 05/28/2019 09:02 PM, Alakesh Haloi wrote:
> Add missing header file following compiler warning
>
> prog_tests/flow_dissector.c: In function ‘tx_tap’:
> prog_tests/flow_dissector.c:175:9: warning: implicit declaration of function
> ‘writev’; did you mean ‘write’? [-Wim
hether &idx_fq is assigned
> or not inside the library function xsk_ring_prod__reserve().
>
> Let us assign an initial value 0 to such auto variables to silence
> compiler warning.
>
> Fixes: 248c7f9c0e21 ("samples/bpf: convert xdpsock to use libbpf for AF_XDP
> access")
> Signed-off-by: Yonghong Song
Applied, thanks!
xsk_ring_prod__reserve(&xsk->umem->fq, rcvd, &idx_fq);
> > if (ret) {
> > ...
> > }
> > ... idx_fq ...
> > The compiler warns since it does not know whether &idx_fq is assigned
> > or not inside the library function xsk_ring_p
auto variables to silence
compiler warning.
Fixes: 248c7f9c0e21 ("samples/bpf: convert xdpsock to use libbpf for
AF_XDP access")
Signed-off-by: Yonghong Song
---
samples/bpf/xdpsock_user.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/samples/bpf/xdpsock_user.c
d, &idx_fq);
if (ret) {
...
}
... idx_fq ...
The compiler warns since it does not know whether &idx_fq is assigned
or not inside the library function xsk_ring_prod__reserve().
Let us assign an initial value 0 to such auto variables to silence
compiler warning.
Fixes: 248c
On 05.02.19 03:55, David Ahern wrote:
On 2/4/19 3:43 AM, Koen Vandeputte wrote:
Hi All,
I'm seeing following compiler warning during kernel compilation
(5.0-rc5 and 4.14.96):
net/core/dev.c: In function 'validate_xmit_skb_list':
net/core/dev.c:3405:15: warning:
On 2/4/19 3:43 AM, Koen Vandeputte wrote:
> Hi All,
>
> I'm seeing following compiler warning during kernel compilation
> (5.0-rc5 and 4.14.96):
>
>
> net/core/dev.c: In function 'validate_xmit_skb_list':
> net/core/dev.c:3405:15: warning: 'tail
On 2/4/19 3:55 AM, Koen Vandeputte wrote:
> Hi All,
>
> During compilation of kernel 4.14.96 and 5.0-rc5 I'm seeing following
> warning:
>
> net/ipv4/fib_trie.c: In function 'fib_trie_unmerge':
> net/ipv4/fib_trie.c:1749:8: warning: 'local_tp' may be used
> uninitialized in this function [-Wmaybe
Hi All,
During compilation of kernel 4.14.96 and 5.0-rc5 I'm seeing following
warning:
net/ipv4/fib_trie.c: In function 'fib_trie_unmerge':
net/ipv4/fib_trie.c:1749:8: warning: 'local_tp' may be used
uninitialized in this function [-Wmaybe-uninitialized]
if (fib_insert_alias(lt, local_tp
Hi All,
I'm seeing following compiler warning during kernel compilation
(5.0-rc5 and 4.14.96):
net/core/dev.c: In function 'validate_xmit_skb_list':
net/core/dev.c:3405:15: warning: 'tail' may be used uninitialized in
this function [-Wmaybe-uninitializ
On 01/16/2019 07:43 PM, Peter Oskolkov wrote:
> An older GCC compiler complains:
>
> kernel/bpf/verifier.c: In function 'bpf_check':
> kernel/bpf/verifier.c:4***:13: error: 'prev_offset' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
>} else if (krecord[i].ins
On Wed, Jan 16, 2019 at 10:43:01AM -0800, Peter Oskolkov wrote:
> An older GCC compiler complains:
>
> kernel/bpf/verifier.c: In function 'bpf_check':
> kernel/bpf/verifier.c:4***:13: error: 'prev_offset' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
>} else
An older GCC compiler complains:
kernel/bpf/verifier.c: In function 'bpf_check':
kernel/bpf/verifier.c:4***:13: error: 'prev_offset' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
} else if (krecord[i].insn_offset <= prev_offset) {
^
kernel/bpf/verif
On Wed, Jan 16, 2019 at 08:44:32AM -0800, Peter Oskolkov wrote:
> An older GCC compiler complains:
>
> kernel/bpf/verifier.c: In function 'bpf_check':
> kernel/bpf/verifier.c:4***:13: error: 'prev_offset' may be used uninitialized
> in this function [-Werror=maybe-uninitialized]
>} else
An older GCC compiler complains:
kernel/bpf/verifier.c: In function 'bpf_check':
kernel/bpf/verifier.c:4***:13: error: 'prev_offset' may be used uninitialized
in this function [-Werror=maybe-uninitialized]
} else if (krecord[i].insn_offset <= prev_offset) {
^
kernel/bpf/verif
With certain gcc versions, it was possible to get the warning
"'tx_desc' may be used uninitialized in this function" for the
i40e_xmit_zc. This was not possible, however this commit simplifies
the code path so that this warning is no longer emitted.
Signed-off-by: Magnus Karlsson
---
drivers/net
With certain gcc versions, it was possible to get the warning
"'tx_desc' may be used uninitialized in this function" for the
i40e_xmit_zc. This was not possible, however this commit simplifies
the code path so that this warning is no longer emitted.
Signed-off-by: Magnus Karlsson
---
drivers/net
When strncpy() is called with source and destination strings the same
length, gcc 8 warns that there may be an unterminated string. Using
strlcpy() rather than strncpy() forces a null at the end and quiets the
warning.
Signed-off-by: Larry Finger
---
v2 - No changes.
---
drivers/staging/rtl8712/
When strncpy() is called with source and destination strings the same
length, gcc 8 warns that there may be an unterminated string. This section
is completely reworked to use the known lengths of the strings.
Signed-off-by: Larry Finger
---
v2 - David Laight's comments are implemented.
---
driv
When CONFIG_NET_CLS_ACT=n, tcf_exts_for_each_action()
is a nop, which leaves its parameters unused. Shut up
the compiler warning by casting them to void.
Fixes: 244cd96adb5f ("net_sched: remove list_head from tc_action")
Reported-by: Stephen Rothwell
Signed-off-by: Cong Wang
---
i
From: Larry Finger
> Sent: 20 August 2018 18:51
> When strncpy() is called with source and destination strings the same
> length, gcc 8 warns that there may be an unterminated string. Using
> strlcpy() rather than strncpy() forces a null at the end and quiets the
> warning.
>
> Signed-off-by: Larr
When strncpy() is called with source and destination strings the same
length, gcc 8 warns that there may be an unterminated string. Using
strlcpy() rather than strncpy() forces a null at the end and quiets the
warning.
Signed-off-by: Larry Finger
---
drivers/staging/rtl8712/rtl871x_ioctl_linux.c
When strncpy() is called with source and destination strings the same
length, gcc 8 warns that there may be an unterminated string. Using
strlcpy() rather than strncpy() forces a null at the end and quiets the
warning.
Signed-off-by: Larry Finger
---
drivers/staging/rtl8192e/rtllib_softmac.c | 4
From: Marcelo Ricardo Leitner
Date: Thu, 11 Jan 2018 14:22:06 -0200
> These fall-through are expected.
>
> Signed-off-by: Marcelo Ricardo Leitner
Applied, thank you.
On Fri, Jan 12, 2018 at 12:22 AM, Marcelo Ricardo Leitner
wrote:
> These fall-through are expected.
>
> Signed-off-by: Marcelo Ricardo Leitner
> ---
> net/sctp/ipv6.c | 1 +
> net/sctp/outqueue.c | 4 ++--
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/ipv6.c b/
On Thu, Jan 11, 2018 at 02:22:06PM -0200, Marcelo Ricardo Leitner wrote:
> These fall-through are expected.
>
> Signed-off-by: Marcelo Ricardo Leitner
> ---
> net/sctp/ipv6.c | 1 +
> net/sctp/outqueue.c | 4 ++--
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/sctp/
These fall-through are expected.
Signed-off-by: Marcelo Ricardo Leitner
---
net/sctp/ipv6.c | 1 +
net/sctp/outqueue.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index
3b18085e3b10253f3f81be7a6747b50ef9357db2..5d4c15bf66d262194
GCC version 7.2.1 complains that 'result1' may be used uninitialized in
parse_action_control_slash_spaces(). This should not be possible in
practice, so the actual value 'result1' is initialized with does not
matter.
Signed-off-by: Phil Sutter
---
tc/tc_util.c | 2 +-
1 file changed, 1 insertion
From: Martin KaFai Lau
Date: Fri, 29 Sep 2017 10:52:17 -0700
> This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr.
> It also tags the user_map_ids with '__user' for sparse check.
>
> Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to
> bpf_prog_info")
> Si
On 09/29/2017 07:52 PM, Martin KaFai Lau wrote:
This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr.
It also tags the user_map_ids with '__user' for sparse check.
Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to
bpf_prog_info")
Signed-off-by: Martin KaFai
This patch uses u64_to_user_ptr() to cast info.map_ids to a userspace ptr.
It also tags the user_map_ids with '__user' for sparse check.
Fixes: cb4d2b3f03d8 ("bpf: Add name, load_time, uid and map_ids to
bpf_prog_info")
Signed-off-by: Martin KaFai Lau
---
kernel/bpf/syscall.c | 2 +-
1 file cha
From: Ihar Hrachyshka
Date: Wed, 24 May 2017 15:19:35 -0700
> Commit 7d472a59c0e5ec117220a05de6b370447fb6cb66 ("arp: always override
> existing neigh entries with gratuitous ARP") introduced a compiler
> warning:
>
> net/ipv4/arp.c:880:35: warning: 'addr_type
Commit 7d472a59c0e5ec117220a05de6b370447fb6cb66 ("arp: always override
existing neigh entries with gratuitous ARP") introduced a compiler
warning:
net/ipv4/arp.c:880:35: warning: 'addr_type' may be used uninitialized in
this function [-Wmaybe-uninitialized]
While the co
le pointer type
./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument
is of type ‘__u32 *’
This patch resolves above compiler warning.
Signed-off-by: Tushar Dave
Reviewed-by: chris hyser
---
drivers/net/ethernet/sun/sunbmac.c | 5 +++--
drivers/net/ethernet/sun/s
From: Paul Burton
Date: Fri, 2 Sep 2016 15:22:48 +0100
> cpmac_start_xmit() used the max() macro on skb->len (an unsigned int)
> and ETH_ZLEN (a signed int literal). This led to the following compiler
> warning:
>
> In file included from include/linux/list.h:8:0,
>
cpmac_start_xmit() used the max() macro on skb->len (an unsigned int)
and ETH_ZLEN (a signed int literal). This led to the following compiler
warning:
In file included from include/linux/list.h:8:0,
from include/linux/module.h:9,
from drivers/net/ether
Hello.
On 11/23/2015 10:36 PM, Jeff Kirsher wrote:
From: Jesse Brandeburg
Compiler complained of an unused variable, which the driver was just
using to store the result of a rd32 which is used to clear a register
unconditionally. Just drop the unused variable and re-use one.
I don't see
From: Jesse Brandeburg
Compiler complained of an unused variable, which the driver was just
using to store the result of a rd32 which is used to clear a register
unconditionally. Just drop the unused variable and re-use one.
Signed-off-by: Jesse Brandeburg
Tested-by: Andrew Bowers
Signed-off-
From: Geert Uytterhoeven
Date: Fri, 4 Sep 2015 12:49:32 +0200
> drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
> drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this
> function
>
> While this warning is a false positive, it can be killed easily by
> getting rid
On 09/04/15 at 12:49pm, Geert Uytterhoeven wrote:
> drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
> drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this
> function
>
> While this warning is a false positive, it can be killed easily by
> getting rid of the pointer
On Fri, 4 Sep 2015 12:49:32 +0200, Geert Uytterhoeven wrote:
> drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
> drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this
> function
>
> While this warning is a false positive, it can be killed easily by
> getting rid of
drivers/net/vxlan.c: In function ‘vxlan_udp_encap_recv’:
drivers/net/vxlan.c:1226: warning: ‘info’ may be used uninitialized in this
function
While this warning is a false positive, it can be killed easily by
getting rid of the pointer intermediary and referring directly to the
ip_tunnel_info str
On 11.08.2015 14:42, Vladimir Zapolskiy wrote:
From: Dirk Behme
Remove the compiler warning
net/core/sysctl_net_core.c:26:12: warning: 'one' defined but not used
[-Wunused-variable]
static int one = 1;
introduced by the 3.14.37 stable commit a1d55b36de6bf2 ("net:
From: Dirk Behme
Remove the compiler warning
net/core/sysctl_net_core.c:26:12: warning: 'one' defined but not used
[-Wunused-variable]
static int one = 1;
introduced by the 3.14.37 stable commit a1d55b36de6bf2 ("net: sysctl_net_core:
check SNDBUF and RCVBUF for min leng
pdata char* name => const char* name
Signed-off-by: Robert ABEL
---
include/linux/rfkill-regulator.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/rfkill-regulator.h b/include/linux/rfkill-regulator.h
index aca36bc..594d8e7 100644
--- a/include/linux/rfkill-re
drivers/net/ethernet/sfc/selftest.c: In function ‘efx_iterate_state’:
drivers/net/ethernet/sfc/selftest.c:388:9: warning: passing argument 1 of
‘memcpy’ discards ‘const’ qualifier from pointer target type
[-Wdiscarded-array-qualifiers]
This is because the msg[] member of struct efx_loopback_pay
From: Simon Horman <[EMAIL PROTECTED]>
Date: Wed, 21 Nov 2007 10:38:02 +0900
> On Tue, Nov 20, 2007 at 03:08:42PM +0300, Pavel Emelyanov wrote:
> > This is silly, but I have turned the CONFIG_IP_VS to m,
> > to check the compilation of one (recently sent) fix
> > and set all the CONFIG_IP_VS_PROTO
On Tue, Nov 20, 2007 at 03:08:42PM +0300, Pavel Emelyanov wrote:
> This is silly, but I have turned the CONFIG_IP_VS to m,
> to check the compilation of one (recently sent) fix
> and set all the CONFIG_IP_VS_PROTO_XXX options to n to
> speed up the compilation.
>
> In this configuration the compil
This is silly, but I have turned the CONFIG_IP_VS to m,
to check the compilation of one (recently sent) fix
and set all the CONFIG_IP_VS_PROTO_XXX options to n to
speed up the compilation.
In this configuration the compiler warns me about
CC [M] net/ipv4/ipvs/ip_vs_proto.o
net/ipv4/ipvs/ip_vs_
Fix a compile warning in the s2io driver. It's caused because u64 is
unsigned long on PPC64 not unsigned long long.
Signed-off-by: Michael Ellerman <[EMAIL PROTECTED]>
---
Index: work/drivers/net/s2io.c
===
--- work.orig/drivers/net/
75 matches
Mail list logo