Patch "sunrpc: suppress warnings for unused procfs functions" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    sunrpc: suppress warnings for unused procfs functions

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sunrpc-suppress-warnings-for-unused-procfs-functions.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d85cb2eee17af738e1ba719ef712541c12a16ebd
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Tue Feb 25 15:52:21 2025 +0100

    sunrpc: suppress warnings for unused procfs functions
    
    [ 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 <jlayton@xxxxxxxxxx>
    Acked-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Signed-off-by: Anna Schumaker <anna.schumaker@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 8c9597b9a3f2e..95aab48d32e67 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -1659,12 +1659,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)
@@ -1692,12 +1694,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)
 {




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux