Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp668351rbb; Sat, 24 Feb 2024 20:08:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUFaKoQra+QIf8svELStWLF6mkb0I6XOC76/GXOoOyI1hedugom1G9p2t5uk0lgDACKptoR69+JAjmGcHZ3nyGKBFzJo51zR3+g/VsDxg== X-Google-Smtp-Source: AGHT+IFYYjLmQpMAtdHCB0vltkQioJ+GBiSasFcVb3zH5ZkAlcq6EoZBfGdj6FD0BrThKXL1xNDa X-Received: by 2002:a05:6512:48d:b0:511:878b:806 with SMTP id v13-20020a056512048d00b00511878b0806mr2114787lfq.2.1708834091775; Sat, 24 Feb 2024 20:08:11 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708834091; cv=pass; d=google.com; s=arc-20160816; b=YVYZ3wQXs33TtpoGFgKBeQ2gw+FmXIRAMevRrijmfpmDKXBuQOXbtVrviWZnn3J6xW rYnT//NoJaD0+rL1SrzUMiJCndaWB5ljUlQZdP7UT+680qybaV9+DCVzrSlxQvdX2QbC /v8p/XA9tnr4JFNtXOBoqUIk+WaXbwqIkEWxc9zkv0ijsgBk/KT1Af5PTxByvfzK0MZ5 dSStYM4tq5wDaHsN3dOhnnThjir/WBO8YyXSpRUeyj0wZkQDTAnnY5MOg4elYX/HIkGz TWRIIoK6Bp2CZ3jB5O/XQHcZKEN8+gS+lqgJeYZU9fnPao+W9MLHRyVRUhAJ+l5WZUXv 4N7A== 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=QzjzGYwHl8mJJbJ/GLAvGi7Pny0jhSARgE05jH5zKak=; fh=VClCbdleh3D5sabtQ0BRdkkta2krUeLv9TtunNGfjzw=; b=AGK3+AJBB1Xu1+4pTwBjwUM767FdtZWqXCF8MXMefXjDYw/yLQWd1euX9YblsixbAD jBMx4am8/4UER/Rrd1ACBEd0j/Us+G2y6YIoOEwawDJD4MoAwbncfgjwRM91k4L99H2H WvL9VIoZprxhOCVj3XjhoKEG5znSjiKyIj89d6W1udjDSBT4YfRATgooC6NSSWqwB6TS 097O1ncq35i2C+jW9mtvgNTAVKuinflMO3IfCipgEy44E4fcUY13PqTqZuILxrLIQ5Gf gq86UXhsbCEKBXPGNuSiCVM6wbko/J2EPVr1XMAjyh78TzbLls1a3+tUBYMebUiuZff0 v4QA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=g7oQi2Lo; 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-79972-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79972-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id c7-20020a17090603c700b00a4308d774a0si541620eja.896.2024.02.24.20.08.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 24 Feb 2024 20:08:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-79972-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@foxmail.com header.s=s201512 header.b=g7oQi2Lo; 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-79972-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-79972-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 833C01F21310 for ; Sun, 25 Feb 2024 04:08:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 801438C10; Sun, 25 Feb 2024 04:08:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=foxmail.com header.i=@foxmail.com header.b="g7oQi2Lo" Received: from out203-205-221-210.mail.qq.com (out203-205-221-210.mail.qq.com [203.205.221.210]) (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 D9E808BFB for ; Sun, 25 Feb 2024 04:08:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.210 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708834084; cv=none; b=kmvH3J90Uqro/ogzXWklmcWZhlR6PG5NJx9pxOZyxfE+ZS95vQugt8rebPSh13NOBmO/diMfreOnBMXrDUeG4OimqZxLu1hfNYyNNbi7jYS3GU/9V8fINYb6IKXhKKZb18hRKJ4y+vkl2Gae23Henl+YmMBtKayfuxuZvDbxVZw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708834084; c=relaxed/simple; bh=x/f9hZGAQVRLuG2BwE0elvw8ixnOBltGJfsVT75HSnk=; h=Message-ID:From:To:Cc:Subject:Date:In-Reply-To:References: MIME-Version; b=efhg1OcyoXPvSVXun0nvY2dGKk6FUIojD1cXrPn0abJ8NWgid09SYjrK1C1y0K68/ey5CLEFLsPIwMmFwOltWF04dgSYLtLQ40ajnqU9atTMc2ktx5lPg1bFY7sAtq/4JWgff5JHllGhSNCHkKXrlx/JzZD7cpDPTtJHK4gY4HI= 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=g7oQi2Lo; arc=none smtp.client-ip=203.205.221.210 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=1708834080; bh=QzjzGYwHl8mJJbJ/GLAvGi7Pny0jhSARgE05jH5zKak=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=g7oQi2Lo8n3LChx+C58v2YnIuB78Z/R12XvbbRDjg1mP54HjM7ArkYGcGCBLDdk3N +KiZiHVSrcEgkFBDLqepLY/KmuMCKmMZoVfwwcjv15OlDJrj/CEh+umwNbBSbV8LHu +rklxbdmPLlbH8dYRNySJLgC2OXv1BI5CUszT91U= Received: from localhost.localdomain ([2409:8a60:2a61:ef40:480f:5c56:cca3:1b20]) by newxmesmtplogicsvrszb6-0.qq.com (NewEsmtp) with SMTP id 18993038; Sun, 25 Feb 2024 12:06:09 +0800 X-QQ-mid: xmsmtpt1708834068tyhcili55 Message-ID: X-QQ-XMAILINFO: NKv2G1wnhDBn9jo7Y+wGMHn4Cejd+6lIIpJjif/4BEgTLgOjckXFcGjoDKyz06 6eeI1CQqNbfXL8CQbXRgrGSpgIigpvFhISz974yeFiJ4tkAvBnYtN054XczNv0h6lXBlVfGenCej NYUjMs6RP1parsO18wchR/wriSfnHPGbUKhYC891VybbdEGL2N4K2bq0z21+p6KDJLR6m5iKy0hW PLlvSRXg/01OrD3pPKvCc1+XVW96crg1eLY9vLdUFAWa9bp3U2mRz1Wff+fayfuCQXMaEYo1Gbv5 2dpFD5lZkLllWmtV7Yjh6sx00GamhJSc2vOSsHaouyceRp1cDwAlfkmHSIcNaGX9+yXK+AYmnOdc 2IUFaCEcKGxXcEaFEdWdV5c1JdFXUgV62NaYQQ0FVm5m5nV2JQh5H7TS1K4Ugy4D9pEmlYB5t2kt nhJ8w7ytVjEvGntmN8nRDQ0EJwOY34/TeNagW3AieKV/ytPhIahX6IhceYccKneKcpiYPCYyrgN6 k2hdPVSj3tz8X9lT/NPnUUQlBy0NlUmSiw9tV3RgfAnO1RW121D7C4x3VdIEzbOB4I3ra/wOr7Va nZj1nDb7hD6l2RGMb5NxM6rT3fMFdDfW+BFqU9t6zqbLEbuB9aZBh0HPyOyzml8ILG37F95nCIBh dJGIyMUdtrnn2chinEzdXTWxIEdQf02kn1ZB4Oszf0tVHWJalmovGCIz2aolmIpVb5yGmoRkSccJ ILx+vhS6MWE2cEmngRbJk8aPeOpRLUryk6z/4C/01/hVrpfwIhHfe+Wsn/Q4Oa28zRsQKVLqG455 dJOOFf4w1zQJHk5BmdJ0dBGjQTZzFoQ3eiQbk+crZjDAkZLTu9W4/oZR3M/2L09GKdP95woSQQ6O /2aV7g8laid6ADavbhnqZaMmM0Kd6IG4zqbFWPYrG6D4D0e0yKBE6CV+qtZ0URRyUHjOc1BuEWNU lPubllW3fUEMwCtcRngw/Asj8z6L/2vLb+fZmZIfw9Eeds7dkvI0SPB1YutY6lIVE2H8tYl/QH8m gcBRV9zrVzcLKDsGaUJ3C2nPogoFA= X-QQ-XMRINFO: OD9hHCdaPRBwq3WW+NvGbIU= From: wenyang.linux@foxmail.com To: Luis Chamberlain , Kees Cook , Joel Granados , Christian Brauner , davem@davemloft.net, David Ahern , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Wen Yang , "Eric W. Biederman" , Shuah Khan , linux-kernel@vger.kernel.org Subject: [PATCH 8/8] ucounts: delete these duplicate static variables ue_zero and ue_int_max Date: Sun, 25 Feb 2024 12:05:38 +0800 X-OQ-MSGID: <20240225040538.845899-9-wenyang.linux@foxmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240225040538.845899-1-wenyang.linux@foxmail.com> References: <20240225040538.845899-1-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 Since these static variables (ue_zero and ue_int_max) are only used for boundary checks and will not be changed, remove it and use the ones in our shared const array. Signed-off-by: Wen Yang Cc: Luis Chamberlain Cc: Kees Cook Cc: Joel Granados Cc: Christian Brauner Cc: "Eric W. Biederman" Cc: Shuah Khan Cc: linux-kernel@vger.kernel.org --- kernel/ucount.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/ucount.c b/kernel/ucount.c index 4aa6166cb856..05bbba02ae4f 100644 --- a/kernel/ucount.c +++ b/kernel/ucount.c @@ -58,17 +58,14 @@ 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, \ + .extra1 = SYSCTL_LONG_ZERO, \ + .extra2 = SYSCTL_LONG_S32_MAX, \ } static struct ctl_table user_table[] = { UCOUNT_ENTRY("max_user_namespaces"), -- 2.25.1