Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp967159lqt; Tue, 19 Mar 2024 08:59:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXC8mz4mlzTPvEH8FtgRjWpoaypo4NNMK0+rcpwVISlMR6VJWcUGa4yjV+MYqyD7dduS4Mi7KDggQNT2v7RACUffOrex1W9l47N70warw== X-Google-Smtp-Source: AGHT+IGw+vBVz59CPkMfwtUh6jq5cj35s7pc5yER2Pca+afXb2dJJ9UP/MGYcL8UW7n/j2xkJR2k X-Received: by 2002:a9d:684f:0:b0:6e5:c4d:b56b with SMTP id c15-20020a9d684f000000b006e50c4db56bmr18179927oto.23.1710863967350; Tue, 19 Mar 2024 08:59:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710863967; cv=pass; d=google.com; s=arc-20160816; b=kuyJDmyVdeMr/uMv5MMP1YfIUEw/85tueOxhExzt17Jensx1xyoFf49z5yfs9ZDHSe YzKLNgBLQ3i2I45fPL2WgaRP5D092E5YAUPoQRFoCfhzKEHsjkeDG+2aAy2Qw7d3cmev qPEz0E50Wk+5oHrnpTi+fI+4bQCEiQp3xRchiMoMUnRKpm7fHnvjbS9b5FoAviDaDku/ FCfQrJKqs0bUs8yd43Ix/V/RBhz5fNuJhyVemJdDI1LSxYFVeE/Fh+JgAoKgEmtkC24w uGCnx5qjXhlG9Zi6/THmfQ8M+zM6HtH5ceyH7HjgOGmoifIOPK76GP8XdyYb21DkGIfj Hc+Q== 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=Ouz5Tp2AWgO33XyZ8LV/WRAebZU4cotdGkPEacGY5bA=; fh=cpNDaALyj4L1NKeiU5diHaS8mN1Vnl6FCbOlJCtgDnY=; b=aOOM5y9YfxS9XD1B3F7dncXnTo+hBM0Rn78/rLly7oXpFswCL15P1YVbuYrzk7Lj1B AAEyJ+K/INWbZloHkHgWmVbyYoMeB1dxmGkUClmvNhgRAb/dRUuRuXiWIDctZRj80/IS aX8cRw0Ynj8quw3YjHnoOQBz9Bv7M+lTfdKgTbnXpXvLYpjyz6yT4mKLBM+hLp/48JA5 MlMhA4VBjCs5eX/w3g8LH9LWwwO2Fp5FofFlGX5FCYWwdLqbHvJEGZPS0r0i95OJl072 KOrjxFjJPCaqtQLdZBSEWsAstJrfyPLO+5rBL+KHQDH1HPa11QMp43hqIvFVj5XeTc0D yFWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=fG3zPby4; 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-107757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107757-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. [147.75.199.223]) by mx.google.com with ESMTPS id b2-20020a05620a126200b00789e7ef11f9si8831899qkl.586.2024.03.19.08.59.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 08:59:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=fG3zPby4; 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-107757-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107757-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 1345F1C22D72 for ; Tue, 19 Mar 2024 15:59:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F149981AC4; Tue, 19 Mar 2024 15:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="fG3zPby4" Received: from out162-62-57-49.mail.qq.com (out162-62-57-49.mail.qq.com [162.62.57.49]) (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 D186981751 for ; Tue, 19 Mar 2024 15:58:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.62.57.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710863938; cv=none; b=MSJv0hNcZqlansqDLvJNNy5oFBny2T4pd+JK74YXf7+9WkZIXRylq6107/pkn2SLqkqty7IgxhgYlQYUsFh3Ivj9dNAEW+9SmcEblUe6wxWcyapWKWMunORD9Bisf8U/ou5ulFaPfjmbmXXkAFDNy8oDb58v03+csoSWHdcvjSw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710863938; c=relaxed/simple; bh=7UKzrWG8Ihaae65NIIDTFYHHZUF/qzUeTBE7PxmmGmE=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=uVQR1mmSQgY3Fd+9sI2jlcB0A0eUfD1yZftXKnxkZXhjxEN0fgoPjcYE3nDgpjnzrGhaReJmGOvzzOgswd76XU9WsOHZQUEeOIguXOAMZZlrMqgPianu/INuVJHNl2lveezSQSxmBjAfaroQOICGu6PFweg7/zg187eZtuSkGJc= 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=fG3zPby4; arc=none smtp.client-ip=162.62.57.49 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=1710863932; bh=Ouz5Tp2AWgO33XyZ8LV/WRAebZU4cotdGkPEacGY5bA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fG3zPby40Dx0eIfOFhoP2fVP8yZ3LnHmqKwqWfZo/ko96ZYh9m0c+qs/ecj8GD9Dk 0bmhdpOMfVA0jwgwo0RPslZ0UcJEzQp3qGX+nystCSIsCiH5DPXyW1HZs8XECgtzK/ l2AdhuhUEteVBsComjWzypr8WAxffh4KIjqD4GyI= 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: xmsmtpt1710863909tff4xyr5i Message-ID: X-QQ-XMAILINFO: M4JyzWMRFsOyhWPvwEsMdXIpXG1TLEWG5CFL3qGzs/CMyvJHlUojFWcCHhN04k S32NgkTKBdzuuuTE/4uHeTkPEt2ITOLJqee3udNpI5WGbV3mPZF0RxAnTkM3uA2pAFjQmUl1YgMD X43WThIpc8vgJbJqpekBLYTH7CBQkaPYQscTjF7pw+MT32C5nF33s+z88svO4YbAPTQGIapRzhVq KUyMcSJPoHPdiq8uQsMxSc0dDc8wMouy5X37h5FgNcAUZsMSjo/IOLBZAC2p8CU8QjoQtX+tTMss 0+S1FBW8vjsGuilg9G6fn2v/av/oIb5VsjfSRHfcJ2hjLCgzsTCGo6AJk3geHw8kFnTpK03Cvzx5 97bjjB6fCL20Bd5ohOF+yvJ7b28Ji5epFOQIV1j1cDN0KdHCTFxfn/KpLhFPArKETmtfQQMx7JFz xtuYKmUR7OIepRoIaTgBcH3gocRoXedXPlUfTA74tijq7vZsJNhyuk3ZzjA7WP9cmlbT4AVbDtFd MFKYn6fS+Xz/89bsRQTs1w5OWJGYIFRR51P3Ft57w3VYvIWw7eOilbvXfTYUkML7EU39qSYa/m5E sop5y/4eeF2wjw3W/rhhyLV39KQbhvxfkcdWtOtKZfKgj60v8FzdGU7uqxT6LwCmP0SO1ClcqDbn KinvEc+oXvL+7w/A3CscCObbvbcy5/+sJbZspONzEBunyk5mLXeYYJvXl5Wt6egcCpFAJ0XV17iA WwxEr0IqUba+FYUnNdhBKXt/zqxJmnk6kPNTDFWlACbEYPqMhXHu241EXb6YVeYEwaAYWKXqXKY/ +Ks723h6Oxfzx4bYqeiwmMAsBoCwV6F6BzpLkUMX8Uodch6/IvMYCY4ls3niOhxu9fN97uH+fvk0 cpAy9EYmu/Ll8QseUhJkhMyTppOTY0xOFwOcD5RSwfq1mMh4mEBRtSgXaj7NsUqTYM1MbH+a/onx d9n0TLL4FBfXdnBhHwqkpovn6PaLkMy5zBgNiGumJpjVh5m8p5oAb+W6Iy0pjGD+CIMilj9DRukG PS1HF48S5Vnk/mhkrgTKLPhTbBG+4KNR05F2lz0FcX1rNO8AnoFNH97Y6rn+zCcyLVuI3DXKxGT2 HvCwhRKtGbkoV50FU= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: wenyang.linux@foxmail.com To: "Eric W . Biederman" , Luis Chamberlain , Kees Cook , Joel Granados , Christian Brauner Cc: Dave Young , Wen Yang , Shuah Khan , linux-kernel@vger.kernel.org Subject: [RESEND PATCH v2 9/9] ucounts: delete these unnecessary static variables ue_zero and ue_int_max Date: Tue, 19 Mar 2024 23:57:50 +0800 X-OQ-MSGID: <8dde20421374b7da2d449896b5612b3a6fa72920.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 (ue_zero and ue_int_max) 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: Shuah Khan Cc: linux-kernel@vger.kernel.org --- kernel/ucount.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/kernel/ucount.c b/kernel/ucount.c index 4aa6166cb856..f1c7a160f361 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -58,17 +58,15 @@ static struct ctl_table_root set_root = { .permissions = set_permissions, }; -static long ue_zero = 0; -static long ue_int_max = INT_MAX; - #define UCOUNT_ENTRY(name) \ { \ .procname = name, \ .maxlen = sizeof(long), \ .mode = 0644, \ .proc_handler = proc_doulongvec_minmax, \ - .extra1 = &ue_zero, \ - .extra2 = &ue_int_max, \ + .min = SYSCTL_NUMERIC_ZERO, \ + .max = SYSCTL_NUMERIC_INT_MAX, \ + .extra_flags = SYSCTL_TABLE_EXTRA_LONG_INIT_MINMAX \ } static struct ctl_table user_table[] = { UCOUNT_ENTRY("max_user_namespaces"), -- 2.25.1