From: Sasha Levin Date: Fri, 28 Feb 2025 04:41:25 +0000 (-0500) Subject: Fixes for 5.4 X-Git-Tag: v6.6.81~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a104f2c8fa1132407d973446950e51ceea139c4c;p=thirdparty%2Fkernel%2Fstable-queue.git Fixes for 5.4 Signed-off-by: Sasha Levin --- diff --git a/queue-5.4/series b/queue-5.4/series index 637f42eb55..1664d28698 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -247,3 +247,4 @@ alsa-hda-conexant-add-quirk-for-hp-probook-450-g4-mute-led.patch acct-block-access-to-kernel-internal-filesystems.patch batman-adv-ignore-neighbor-throughput-metrics-in-error-case.patch batman-adv-drop-unmanaged-elp-metric-worker.patch +sunrpc-suppress-warnings-for-unused-procfs-functions.patch diff --git a/queue-5.4/sunrpc-suppress-warnings-for-unused-procfs-functions.patch b/queue-5.4/sunrpc-suppress-warnings-for-unused-procfs-functions.patch new file mode 100644 index 0000000000..19f41fde55 --- /dev/null +++ b/queue-5.4/sunrpc-suppress-warnings-for-unused-procfs-functions.patch @@ -0,0 +1,71 @@ +From 4a4c8b80bbbc2b6a7d6cf8974494c69a12283e6a Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Tue, 25 Feb 2025 15:52:21 +0100 +Subject: sunrpc: suppress warnings for unused procfs functions + +From: Arnd Bergmann + +[ Upstream commit 1f7a4f98c11fbeb18ed21f3b3a497e90a50ad2e0 ] + +There is a warning about unused variables when building with W=1 and no procfs: + +net/sunrpc/cache.c:1660:30: error: 'cache_flush_proc_ops' defined but not used [-Werror=unused-const-variable=] + 1660 | static const struct proc_ops cache_flush_proc_ops = { + | ^~~~~~~~~~~~~~~~~~~~ +net/sunrpc/cache.c:1622:30: error: 'content_proc_ops' defined but not used [-Werror=unused-const-variable=] + 1622 | static const struct proc_ops content_proc_ops = { + | ^~~~~~~~~~~~~~~~ +net/sunrpc/cache.c:1598:30: error: 'cache_channel_proc_ops' defined but not used [-Werror=unused-const-variable=] + 1598 | static const struct proc_ops cache_channel_proc_ops = { + | ^~~~~~~~~~~~~~~~~~~~~~ + +These are used inside of an #ifdef, so replacing that with an +IS_ENABLED() check lets the compiler see how they are used while +still dropping them during dead code elimination. + +Fixes: dbf847ecb631 ("knfsd: allow cache_register to return error on failure") +Reviewed-by: Jeff Layton +Acked-by: Chuck Lever +Signed-off-by: Arnd Bergmann +Signed-off-by: Anna Schumaker +Signed-off-by: Sasha Levin +--- + net/sunrpc/cache.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c +index d050e70138601..2215314dc4c5d 100644 +--- a/net/sunrpc/cache.c ++++ b/net/sunrpc/cache.c +@@ -1652,12 +1652,14 @@ static void remove_cache_proc_entries(struct cache_detail *cd) + } + } + +-#ifdef CONFIG_PROC_FS + static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) + { + struct proc_dir_entry *p; + struct sunrpc_net *sn; + ++ if (!IS_ENABLED(CONFIG_PROC_FS)) ++ return 0; ++ + sn = net_generic(net, sunrpc_net_id); + cd->procfs = proc_mkdir(cd->name, sn->proc_net_rpc); + if (cd->procfs == NULL) +@@ -1685,12 +1687,6 @@ static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) + remove_cache_proc_entries(cd); + return -ENOMEM; + } +-#else /* CONFIG_PROC_FS */ +-static int create_cache_proc_entries(struct cache_detail *cd, struct net *net) +-{ +- return 0; +-} +-#endif + + void __init cache_initialize(void) + { +-- +2.39.5 +