From eff7240445f763af5d933a395779f9452f78ba88 Mon Sep 17 00:00:00 2001 From: Mieczyslaw Nalewaj Date: Wed, 7 Jan 2026 01:38:03 +0100 Subject: [PATCH] generic: 6.18: silence unused-variable warnings This patch silences compiler warnings about unused variables by explicitly casting them to void where appropriate. Signed-off-by: Mieczyslaw Nalewaj Link: https://github.com/openwrt/openwrt/pull/21078 Signed-off-by: Robert Marko --- ...950-silence-unused-variable-warnings.patch | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 target/linux/generic/hack-6.18/950-silence-unused-variable-warnings.patch diff --git a/target/linux/generic/hack-6.18/950-silence-unused-variable-warnings.patch b/target/linux/generic/hack-6.18/950-silence-unused-variable-warnings.patch new file mode 100644 index 0000000000..e544ef5cad --- /dev/null +++ b/target/linux/generic/hack-6.18/950-silence-unused-variable-warnings.patch @@ -0,0 +1,47 @@ +From: Mieczyslaw Nalewaj +Date: Wed, 07 Jan 2026 01:30:15 +0100 +Subject: [PATCH] Silence unused-variable warnings in ipv6.h and tcp_input.c + +This patch silences compiler warnings about unused variables by explicitly +casting them to void where appropriate. + +Signed-off-by: Mieczyslaw Nalewaj +--- + include/net/ipv6.h | 6 ++++++ + net/ipv4/tcp_input.c | 7 +++++++ + 2 files changed, 13 insertions(+) + +--- a/include/net/ipv6.h ++++ b/include/net/ipv6.h +@@ -248,6 +248,8 @@ extern int sysctl_mld_qrv; + struct inet6_dev *_idev = (idev); \ + unsigned long _field = (field); \ + unsigned long _val = (val); \ ++ (void)_field; \ ++ (void)_val; \ + if (likely(_idev != NULL)) \ + mod##SNMP_ADD_STATS((_idev)->stats.statname, _field, _val); \ + mod##SNMP_ADD_STATS((net)->mib.statname##_statistics, _field, _val);\ +@@ -257,6 +259,7 @@ extern int sysctl_mld_qrv; + ({ \ + struct inet6_dev *_idev = (idev); \ + unsigned long _val = (val); \ ++ (void)_val; \ + if (likely(_idev != NULL)) \ + mod##SNMP_UPD_PO_STATS((_idev)->stats.statname, field, _val); \ + mod##SNMP_UPD_PO_STATS((net)->mib.statname##_statistics, field, _val);\ +--- a/net/ipv4/tcp_input.c ++++ b/net/ipv4/tcp_input.c +@@ -3967,6 +3967,12 @@ static u32 tcp_newly_delivered(struct so + struct tcp_sock *tp = tcp_sk(sk); + u32 delivered; + ++ /* ecn_count is only used when FLAG_ECE is set; in some build/config ++ * paths it may be unused and cause a compiler warning. Silence it ++ * explicitly here. ++ */ ++ (void)ecn_count; ++ + delivered = tp->delivered - prior_delivered; + NET_ADD_STATS(net, LINUX_MIB_TCPDELIVERED, delivered); +