mirror of
https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux
synced 2025-09-14 08:36:46 +10:00
When CONFIG_IPV6=n, and building with W=1:
In file included from include/trace/define_trace.h:102,
from include/trace/events/neigh.h:255,
from net/core/net-traces.c:51:
include/trace/events/neigh.h: In function ‘trace_event_raw_event_neigh_create’:
include/trace/events/neigh.h:42:34: error: variable ‘pin6’ set but not used [-Werror=unused-but-set-variable]
42 | struct in6_addr *pin6;
| ^~~~
include/trace/trace_events.h:402:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
402 | { assign; } \
| ^~~~~~
include/trace/trace_events.h:44:30: note: in expansion of macro ‘PARAMS’
44 | PARAMS(assign), \
| ^~~~~~
include/trace/events/neigh.h:23:1: note: in expansion of macro ‘TRACE_EVENT’
23 | TRACE_EVENT(neigh_create,
| ^~~~~~~~~~~
include/trace/events/neigh.h:41:9: note: in expansion of macro ‘TP_fast_assign’
41 | TP_fast_assign(
| ^~~~~~~~~~~~~~
In file included from include/trace/define_trace.h:103,
from include/trace/events/neigh.h:255,
from net/core/net-traces.c:51:
include/trace/events/neigh.h: In function ‘perf_trace_neigh_create’:
include/trace/events/neigh.h:42:34: error: variable ‘pin6’ set but not used [-Werror=unused-but-set-variable]
42 | struct in6_addr *pin6;
| ^~~~
include/trace/perf.h:51:11: note: in definition of macro ‘DECLARE_EVENT_CLASS’
51 | { assign; } \
| ^~~~~~
include/trace/trace_events.h:44:30: note: in expansion of macro ‘PARAMS’
44 | PARAMS(assign), \
| ^~~~~~
include/trace/events/neigh.h:23:1: note: in expansion of macro ‘TRACE_EVENT’
23 | TRACE_EVENT(neigh_create,
| ^~~~~~~~~~~
include/trace/events/neigh.h:41:9: note: in expansion of macro ‘TP_fast_assign’
41 | TP_fast_assign(
| ^~~~~~~~~~~~~~
Indeed, the variable pin6 is declared and initialized unconditionally,
while it is only used and needlessly re-initialized when support for
IPv6 is enabled.
Fix this by dropping the unused variable initialization, and moving the
variable declaration inside the existing section protected by a check
for CONFIG_IPV6.
Fixes:
|
||
---|---|---|
.. | ||
9p.h | ||
afs.h | ||
alarmtimer.h | ||
asoc.h | ||
avc.h | ||
bcache.h | ||
block.h | ||
bpf_test_run.h | ||
bridge.h | ||
btrfs.h | ||
cachefiles.h | ||
cgroup.h | ||
clk.h | ||
cma.h | ||
compaction.h | ||
context_tracking.h | ||
cpuhp.h | ||
csd.h | ||
damon.h | ||
devfreq.h | ||
devlink.h | ||
dlm.h | ||
dma_fence.h | ||
erofs.h | ||
error_report.h | ||
ext4.h | ||
f2fs.h | ||
fib6.h | ||
fib.h | ||
filelock.h | ||
filemap.h | ||
fs_dax.h | ||
fscache.h | ||
fsi_master_aspeed.h | ||
fsi_master_ast_cf.h | ||
fsi_master_gpio.h | ||
fsi_master_i2cr.h | ||
fsi.h | ||
gpio.h | ||
gpu_mem.h | ||
habanalabs.h | ||
handshake.h | ||
host1x.h | ||
huge_memory.h | ||
hwmon.h | ||
i2c_slave.h | ||
i2c.h | ||
ib_mad.h | ||
ib_umad.h | ||
initcall.h | ||
intel_ifs.h | ||
intel_ish.h | ||
intel-sst.h | ||
io_uring.h | ||
iocost.h | ||
iommu.h | ||
ipi.h | ||
irq_matrix.h | ||
irq.h | ||
iscsi.h | ||
jbd2.h | ||
kmem.h | ||
ksm.h | ||
kvm.h | ||
kyber.h | ||
libata.h | ||
lock.h | ||
maple_tree.h | ||
mce.h | ||
mctp.h | ||
mdio.h | ||
migrate.h | ||
mlxsw.h | ||
mmap_lock.h | ||
mmap.h | ||
mmc.h | ||
mmflags.h | ||
module.h | ||
mptcp.h | ||
napi.h | ||
nbd.h | ||
neigh.h | ||
net_probe_common.h | ||
net.h | ||
netfs.h | ||
netlink.h | ||
nilfs2.h | ||
nmi.h | ||
notifier.h | ||
objagg.h | ||
oom.h | ||
osnoise.h | ||
page_isolation.h | ||
page_pool.h | ||
page_ref.h | ||
pagemap.h | ||
percpu.h | ||
power_cpu_migrate.h | ||
power.h | ||
preemptirq.h | ||
printk.h | ||
pwc.h | ||
pwm.h | ||
qdisc.h | ||
qla.h | ||
qrtr.h | ||
rcu.h | ||
rdma_core.h | ||
regulator.h | ||
rpcgss.h | ||
rpcrdma.h | ||
rpm.h | ||
rseq.h | ||
rtc.h | ||
rv.h | ||
rwmmio.h | ||
rxrpc.h | ||
sched.h | ||
scmi.h | ||
scsi.h | ||
sctp.h | ||
signal.h | ||
siox.h | ||
skb.h | ||
smbus.h | ||
sock.h | ||
sof_intel.h | ||
sof.h | ||
spi.h | ||
spmi.h | ||
sunrpc.h | ||
sunvnet.h | ||
swiotlb.h | ||
syscalls.h | ||
target.h | ||
task.h | ||
tcp.h | ||
tegra_apb_dma.h | ||
thermal_pressure.h | ||
thp.h | ||
timer.h | ||
tlb.h | ||
udp.h | ||
ufs.h | ||
v4l2.h | ||
vb2.h | ||
vmalloc.h | ||
vmscan.h | ||
vsock_virtio_transport_common.h | ||
watchdog.h | ||
wbt.h | ||
workqueue.h | ||
writeback.h | ||
xdp.h | ||
xen.h |