linux/include/trace/events
Geert Uytterhoeven e0914e5a05 neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section
commit 2915240edd upstream.

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: fc651001d2 ("neighbor: Add tracepoint to __neigh_create")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Simon Horman <horms@kernel.org> # build-tested
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-10-25 12:03:07 +02:00
..
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
damon.h
devfreq.h
devlink.h
dlm.h
dma_fence.h
erofs.h
error_report.h
ext4.h
f2fs.h
fib.h ipv6: Remove in6addr_any alternatives. 2023-09-19 12:28:10 +02:00
fib6.h ipv6: Remove in6addr_any alternatives. 2023-09-19 12:28:10 +02:00
filelock.h
filemap.h
fs_dax.h
fs.h
fscache.h
fsi_master_aspeed.h
fsi_master_ast_cf.h
fsi_master_gpio.h
fsi.h
gpio.h
gpu_mem.h
habanalabs.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 jbd2: remove journal_clean_one_cp_list() 2023-08-30 16:10:58 +02:00
kmem.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 neighbor: tracing: Move pin6 inside CONFIG_IPV6=y section 2023-10-25 12:03:07 +02:00
net_probe_common.h
net.h net: fix net_dev_start_xmit trace event vs skb_transport_offset() 2023-07-19 16:22:05 +02:00
netfs.h
netlink.h
nfs.h
nilfs2.h
nmi.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
rdma.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_base.h
sunrpc.h
sunvnet.h
swiotlb.h
syscalls.h
target.h
task.h
tcp.h tcp: add missing family to tcp_set_ca_state() tracepoint 2023-08-16 18:27:27 +02:00
tegra_apb_dma.h
thermal_power_allocator.h
thermal_pressure.h
thermal.h
thp.h
timer.h tracing/timer: Add missing hrtimer modes to decode_hrtimer_mode(). 2023-07-19 16:20:59 +02:00
tlb.h
udp.h
ufs.h
v4l2.h
vb2.h
vmscan.h
vsock_virtio_transport_common.h
watchdog.h
wbt.h
workqueue.h
writeback.h
xdp.h
xen.h