Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp970826lqt; Tue, 19 Mar 2024 09:03:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUdqWqly6vyFCMNrHghoi9vaVGnk2h7tD19o2N3GBfqfi3dftZe8KKgAlb8FyZqRokWLY6Tw3hWSP5ZubEECn0F0b9BDJAvd1pnAmjWDA== X-Google-Smtp-Source: AGHT+IF8qej5m/K4iyLdEvUa52tLUnIJDD0tUrDVQifaR8lEhH+LPEolwewi/3xNWNiFrD4NkVtX X-Received: by 2002:a05:620a:2911:b0:789:f5b8:5324 with SMTP id m17-20020a05620a291100b00789f5b85324mr11044498qkp.44.1710864220242; Tue, 19 Mar 2024 09:03:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710864220; cv=pass; d=google.com; s=arc-20160816; b=tS+FI+/KyGXmhKqnaVj6GDs2LWiqi5P6+tiBggoYVBDZsQ+Nt4BWnWINO+EBP0kLQJ diigLB2UuKAqdLqmlnl0O9WqSvIf3skKkHkU/slh5d2HpO5JYGR1BvC5Rp8l7JXwJDMP YODLSnXjnVGe4t8RQEbiuFq1gDFVi33Rcm5zhkNiauCcF65Zitdm3gV/R0LGNWIq5OZH XypgCyz/V0wL0Pjx5pYZvVsuYCs4JZ4esJ5RM6V0fl/NeI1ylp1ws19lUvJptLTz/RFd x7vbXesrdiFVIs/4scwTn3oc/d0GkXHaVppm53JFqHF+xRQPiwPzWkjIlzSMNc1L9N/6 XDCg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:date :subject:cc:to:from:message-id:dkim-signature; bh=DxyBLVjpfnxukK2thKG7gUTZdlVeeTVCdm35Y9whOV0=; fh=gM7nNeaBbqaMFYlba8LNPtMvsAXYRSA3d8bFZMSBzeo=; b=YrNATQT8S/Oi5Y8F1MdnspoSAvjvF/ET3NmPKESN5jZmuPWI4t/ZImf5IKwczMVa8r zhBv8mnKIlYzaN1cz5bZWoCy63rFDKdwUcDbVTfPTxkqsw9fw+cjqaGYbyYu36WzfsVA Vc5Wa1xtCkVMbVorjMT46CihftdYMSgoqNtUJcIof6Jub4TTjL78M3LAt7NJ8Cl3DrzZ N3IEdLOGkRLZKE6Z8yxnem6Q07qUjv8qAOqSHQy9wyN5aYRxiJLByuq1msPWaZ6wvZJ+ b5j6RFmaJN19v6rCxtoV95RtNz47KoJgYdHqiyDhmgABGpWg81bnleAYy6NxjMwCkMCQ Nsfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="mz/QiRN7"; arc=pass (i=1 spf=pass spfdomain=foxmail.com dkim=pass dkdomain=foxmail.com dmarc=pass fromdomain=foxmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107761-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107761-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f30-20020a05620a20de00b00789e5cadf08si9165720qka.32.2024.03.19.09.03.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 09:03:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107761-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b="mz/QiRN7"; arc=pass (i=1 spf=pass spfdomain=foxmail.com dkim=pass dkdomain=foxmail.com dmarc=pass fromdomain=foxmail.com); spf=pass (google.com: domain of linux-kernel+bounces-107761-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107761-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E37401C22F15 for ; Tue, 19 Mar 2024 16:03:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 03E5F80611; Tue, 19 Mar 2024 16:03:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="mz/QiRN7" Received: from out203-205-221-153.mail.qq.com (out203-205-221-153.mail.qq.com [203.205.221.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5CF57F7F6 for ; Tue, 19 Mar 2024 16:03:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.153 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710864215; cv=none; b=qXyRqVoPsYnpBtLD9W48oimDsFDxjn7H1voxRa56gWaa+IC+Bydgo24n5i8i6relsLhVyRZs1cPG0rPqwFCKxXAqBtM8mwYQKjlA/UcpXx09Q3AxhsbT0B8QtwN5lRzYG5zlJBJ793ClrlDQXZqw0FmLrIk++8j3yCXNru7A1dg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710864215; c=relaxed/simple; bh=zlIWbJfvd/AikIfWNp9cyeVLD3JixwOsMUEl/SMnHHQ=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=oBQWrcY35hkYJz1kQW5pPkoMTYOtHnKDNkYqRATXCelFv13hs1bzPkREB5zMaQxNwJ9KNPzcHbk66MHlZ4EELsHEijJGQ9Rh0c7miJ8T91rZAlddTaIOEvsGcvTwNdqq4CT6TEd/j32vO1ESaF/fQFMoNI0ouTggRsUynY3wqcw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com; spf=pass smtp.mailfrom=foxmail.com; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b=mz/QiRN7; arc=none smtp.client-ip=203.205.221.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=foxmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=foxmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1710863903; bh=DxyBLVjpfnxukK2thKG7gUTZdlVeeTVCdm35Y9whOV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=mz/QiRN7s6y/Lf6Mm6oG51tmrhyHAiPT7h3siBJefm68lHndDrdWDZHyIA+vh7ZqG 1AaWcGap3LYgp10HmYDcZHna9alpHd9YnFsdnEKc8qdnuTbNAo435N2tC9XkE+o3nq 2+cHbJNECPKdoK7q7cXBSknOgkI+V8soYVMO7Nus= Received: from localhost.localdomain ([2409:8a60:2a60:b160:1774:d6f7:f5f5:b6a]) by newxmesmtplogicsvrszc5-0.qq.com (NewEsmtp) with SMTP id E8996A1C; Tue, 19 Mar 2024 23:58:09 +0800 X-QQ-mid: xmsmtpt1710863900t5klrhap6 Message-ID: X-QQ-XMAILINFO: OKkKo7I1HxIeXwUCIYCfOd/G1JlnjD4TgMrZMOYcFdH1tKXQYmhKfBMTcd5lEN 9TdqBn10jBOi3VcLRXl7cvoDgN3o4Yf399DsesGneh816IEc8l6dXMVDuraoin+DvZHThC5qNiem 3XH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, Christian Brauner Cc: Dave Young , Wen Yang , "David S. Miller" , David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 5/9] svcrdma: delete these unnecessary static variables min_ord, max_ord, etc Date: Tue, 19 Mar 2024 23:57:46 +0800 X-OQ-MSGID: <9ff013657a6ed7ad81d7b99c7b0e03d54577f315.1710863674.git.wenyang.linux@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <26c450f6467b4cbaf94cdb10f047abc6ab0c2a5d.1710863674.git.wenyang.linux@foxmail.com> References: <26c450f6467b4cbaf94cdb10f047abc6ab0c2a5d.1710863674.git.wenyang.linux@foxmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Wen Yang Delete unnecessary static variables (min_ord, max_ord, etc.) and encode them directly in the table entry. Signed-off-by: Wen Yang Cc: Eric W. Biederman Cc: Luis Chamberlain Cc: Kees Cook Cc: Joel Granados Cc: Christian Brauner Cc: "David S. Miller" Cc: David Ahern Cc: Eric Dumazet Cc: Jakub Kicinski Cc: Paolo Abeni Cc: linux-kernel@vger.kernel.org --- net/sunrpc/xprtrdma/svc_rdma.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/net/sunrpc/xprtrdma/svc_rdma.c b/net/sunrpc/xprtrdma/svc_rdma.c index f86970733eb0..98cde9c2bf5a 100644 --- a/net/sunrpc/xprtrdma/svc_rdma.c +++ b/net/sunrpc/xprtrdma/svc_rdma.c @@ -53,15 +53,9 @@ /* RPC/RDMA parameters */ unsigned int svcrdma_ord = 16; /* historical default */ -static unsigned int min_ord = 1; -static unsigned int max_ord = 255; unsigned int svcrdma_max_requests = RPCRDMA_MAX_REQUESTS; unsigned int svcrdma_max_bc_requests = RPCRDMA_MAX_BC_REQUESTS; -static unsigned int min_max_requests = 4; -static unsigned int max_max_requests = 16384; unsigned int svcrdma_max_req_size = RPCRDMA_DEF_INLINE_THRESH; -static unsigned int min_max_inline = RPCRDMA_DEF_INLINE_THRESH; -static unsigned int max_max_inline = RPCRDMA_MAX_INLINE_THRESH; static unsigned int svcrdma_stat_unused; static unsigned int zero; @@ -114,8 +108,9 @@ static struct ctl_table svcrdma_parm_table[] = { .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &min_max_requests, - .extra2 = &max_max_requests + .min = SYSCTL_NUMERIC_FOUR, + .max = SYSCTL_NUMERIC_16K, + .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX, }, { .procname = "max_req_size", @@ -123,8 +118,9 @@ static struct ctl_table svcrdma_parm_table[] = { .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &min_max_inline, - .extra2 = &max_max_inline + .min = RPCRDMA_DEF_INLINE_THRESH, + .max = RPCRDMA_MAX_INLINE_THRESH, + .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX, }, { .procname = "max_outbound_read_requests", @@ -132,8 +128,9 @@ static struct ctl_table svcrdma_parm_table[] = { .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .extra1 = &min_ord, - .extra2 = &max_ord, + .min = SYSCTL_NUMERIC_ONE, + .max = SYSCTL_NUMERIC_U8_MAX, + .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX, }, { -- 2.25.1