]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
sunrpc: Kill RPC_IFDEBUG()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 4 Feb 2026 20:21:50 +0000 (21:21 +0100)
committerChuck Lever <chuck.lever@oracle.com>
Mon, 30 Mar 2026 01:25:09 +0000 (21:25 -0400)
RPC_IFDEBUG() is used in only two places. In one the user of
the definition is guarded by ifdeffery, in the second one
it's implied due to dprintk() usage. Kill the macro and move
the ifdeffery to the regular condition with the variable defined
inside, while in the second case add the same conditional and
move the respective code there.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfsfh.c
include/linux/sunrpc/debug.h
net/sunrpc/xprtrdma/svc_rdma_transport.c

index ed85dd43da18e6d4c4667ff14dc035f2eacff1d6..68b629fbaaeb9b4f1a3521e5765b42e24450c109 100644 (file)
@@ -105,9 +105,12 @@ static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp,
 {
        /* Check if the request originated from a secure port. */
        if (rqstp && !nfsd_originating_port_ok(rqstp, cred, exp)) {
-               RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
-               dprintk("nfsd: request from insecure port %s!\n",
-                       svc_print_addr(rqstp, buf, sizeof(buf)));
+               if (IS_ENABLED(CONFIG_SUNRPC_DEBUG)) {
+                       char buf[RPC_MAX_ADDRBUFLEN];
+
+                       dprintk("nfsd: request from insecure port %s!\n",
+                               svc_print_addr(rqstp, buf, sizeof(buf)));
+               }
                return nfserr_perm;
        }
 
index eb4bd62df3190c77299724f00cd37d0a8e89deb4..93d1a11ffbfb3b5e79abe80c36e77398430b0216 100644 (file)
@@ -49,12 +49,10 @@ do {                                                                        \
        }                                                               \
 } while (0)
 
-# define RPC_IFDEBUG(x)                x
 #else
 # define ifdebug(fac)          if (0)
 # define dfprintk(fac, fmt, ...)       do {} while (0)
 # define dfprintk_rcu(fac, fmt, ...)   do {} while (0)
-# define RPC_IFDEBUG(x)
 #endif
 
 /*
index 9b623849723ed0eb74b827881c6f32d3434c891b..f2d72181a6fe86c7be0a6686053d09efa6563026 100644 (file)
@@ -414,7 +414,6 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
        struct ib_qp_init_attr qp_attr;
        struct ib_device *dev;
        int ret = 0;
-       RPC_IFDEBUG(struct sockaddr *sap);
 
        listen_rdma = container_of(xprt, struct svcxprt_rdma, sc_xprt);
        clear_bit(XPT_CONN, &xprt->xpt_flags);
@@ -560,18 +559,20 @@ static struct svc_xprt *svc_rdma_accept(struct svc_xprt *xprt)
                goto errout;
        }
 
-#if IS_ENABLED(CONFIG_SUNRPC_DEBUG)
-       dprintk("svcrdma: new connection accepted on device %s:\n", dev->name);
-       sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr;
-       dprintk("    local address   : %pIS:%u\n", sap, rpc_get_port(sap));
-       sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
-       dprintk("    remote address  : %pIS:%u\n", sap, rpc_get_port(sap));
-       dprintk("    max_sge         : %d\n", newxprt->sc_max_send_sges);
-       dprintk("    sq_depth        : %d\n", newxprt->sc_sq_depth);
-       dprintk("    rdma_rw_ctxs    : %d\n", ctxts);
-       dprintk("    max_requests    : %d\n", newxprt->sc_max_requests);
-       dprintk("    ord             : %d\n", conn_param.initiator_depth);
-#endif
+       if (IS_ENABLED(CONFIG_SUNRPC_DEBUG)) {
+               struct sockaddr *sap;
+
+               dprintk("svcrdma: new connection accepted on device %s:\n", dev->name);
+               sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr;
+               dprintk("    local address   : %pIS:%u\n", sap, rpc_get_port(sap));
+               sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr;
+               dprintk("    remote address  : %pIS:%u\n", sap, rpc_get_port(sap));
+               dprintk("    max_sge         : %d\n", newxprt->sc_max_send_sges);
+               dprintk("    sq_depth        : %d\n", newxprt->sc_sq_depth);
+               dprintk("    rdma_rw_ctxs    : %d\n", ctxts);
+               dprintk("    max_requests    : %d\n", newxprt->sc_max_requests);
+               dprintk("    ord             : %d\n", conn_param.initiator_depth);
+       }
 
        return &newxprt->sc_xprt;