Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1442905rdg; Sat, 14 Oct 2023 02:23:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/YgZIs5PXAXj+731fQ7hMcP/M12RAl3vDDIrLy+1FAnpAGeBEg6G/slfbfb0cPQm4sOtI X-Received: by 2002:a05:6a00:2d07:b0:68f:b5a3:5ec6 with SMTP id fa7-20020a056a002d0700b0068fb5a35ec6mr3401954pfb.0.1697275400443; Sat, 14 Oct 2023 02:23:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697275400; cv=none; d=google.com; s=arc-20160816; b=obyLaOYG4gH55K5sVMIw7RtNqC+LfzXGXkgqzyeA/imqU+ZpR4qo4phegyZMrUqYRD Dt5HnDu1rs7vEJOhJboAe3GjKqxMkJvUxyurPkkODrqkUj2oIaQhTbyYMnORGEFAvBTW wjMe0PrJ70TYha3euY+sT7lYEyVZFIcRQNxteq2pgBAvgWqW6SXgb4qedsg4GNDL60WC t+xAyKv7nIUc0BheIU+VU58IdS69gOr54L3VHRfeKq8L+Gh3Rslqaou6/LGvHwcTUzBC nKfH8UlFcgoV+ZF93sgGdAP+ShBqmALXfCShekJQ+Ecj4XKuUfmizD3PJLxOVdnwSU8j hMnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1OiLKGl/521du+G5SUflqLbUSPuMIQ1XfH6bxubrILA=; fh=qO740aTlmpNp6r8w+e8xshi6Yr+TrhpFe3doeD0hvQk=; b=F64gfgzb2hu3yIjrsR+WPNmvw39XC3Bm2+ZjNfMaOU48yFOqMGqyNKvpZ/TopSMBh1 c9Ugn+NmaJnp5ymXcxvXumriuR1wBfHO6LgYrtNPOR41/vUL0ijz9XanEvw5w1JglBdA XDquVOi4g66jmTB7P2HAUnRWhWSoV3Y6vPmGqKPXwAKS2DtpFdLvoU5gyOBtvdkQuXPh Qo0+t98aTtlq3lGzVpPFUcC90qQ6s5Wig49oX31ulOPtaWgP4GEhEoAfw+lwfF/9gFUK JnynVJHFQ1QaM5lx+RnfjtCPKnEUPtkIMonMaAeysLJXpWbslcFPHoQnQiLqxYpT+E3O 1xEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MaNXedSk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id o10-20020a056a001bca00b0068fca4405aasi18150707pfw.338.2023.10.14.02.23.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 02:23:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MaNXedSk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id D16DE8025751; Sat, 14 Oct 2023 02:23:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232937AbjJNJXD (ORCPT + 99 others); Sat, 14 Oct 2023 05:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231377AbjJNJXC (ORCPT ); Sat, 14 Oct 2023 05:23:02 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95E2CAD for ; Sat, 14 Oct 2023 02:23:00 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id a640c23a62f3a-9ba1eb73c27so468580966b.3 for ; Sat, 14 Oct 2023 02:23:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697275379; x=1697880179; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=1OiLKGl/521du+G5SUflqLbUSPuMIQ1XfH6bxubrILA=; b=MaNXedSkWIYZWAU2KEdeZzx+PNg2qWLRuBR31Xt4mlAi6U5llanjzLffaaRkWjwubo pah2B6rdwolY1pdp8hEvG8bpULr8xYtc8w1rEFsVrhKqiqFZYUGZiIchCWwK5CcDnoNN LJUoaQ3mNetbWtQPBk8a1Zeqa0B7lmniTaMGpDa8rOE9tL9l9eN6hNqdjMd3oTQ8QMT1 tFVzNbwunqgNeoJwcDsIgUq8/VyIQ2ztZ1KBK6nwlyZkKnzKyZahz34AroTdaLBYOD+7 BiUig+nfpCv/aQ8evzFeGyGqSp2Ps/kYGYKAhyYVaqNKa1t3/VkSVtlVAzlXjKuB6fcX Nd9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697275379; x=1697880179; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=1OiLKGl/521du+G5SUflqLbUSPuMIQ1XfH6bxubrILA=; b=N54F0gRmLaQ3DkirXizrrsEyaSdLiwJfNtK0avrYh8Z3wkusacWDfa1Mbeo7oE9Lrt a3Bo1LdHM7/MV/m7nt1WFCKs1eCPxQOVCGnf3MoP4ZM+HjywpYf0yBQs0y1KLym9zSp0 C3vzqaPA7ki61gHRay5STLd3b1vcoL4H83wimOY3PZzmsdeooBetZaweJHZy7OKc1q6P +B7S46qERCo2SPP6yIx5o7DLuvh7p4PqnI4wGog9HWgrEBiuvLV7ZbOtfaUUoiewWWAr yTMevtkdfaRtaFI3ZxlFoMidY/vH6jQ8Fqbt+a68zm1aLqpm7dSpG1QRixwdk2CQzJyR ll/g== X-Gm-Message-State: AOJu0Yxg45rYhHJO0gYK5Kv1sw33Gksl1mkl/wlbkf+a7bmOWHH3k2sw ioHWXCJvgr+3dNtwuX3FEg== X-Received: by 2002:a17:906:3288:b0:9a1:fb4c:3b6c with SMTP id 8-20020a170906328800b009a1fb4c3b6cmr25664790ejw.59.1697275378686; Sat, 14 Oct 2023 02:22:58 -0700 (PDT) Received: from p183 ([46.53.253.206]) by smtp.gmail.com with ESMTPSA id gw11-20020a170906f14b00b0098669cc16b2sm678248ejb.83.2023.10.14.02.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Oct 2023 02:22:57 -0700 (PDT) Date: Sat, 14 Oct 2023 12:22:56 +0300 From: Alexey Dobriyan To: David Laight Cc: "akpm@linux-foundation.org" , "linux-kernel@vger.kernel.org" , Al Viro Subject: Re: [PATCH] fs: move and constify sysctl_nr_open_min, sysctl_nr_open_max Message-ID: <261b7728-a9f3-4ceb-8325-b8ad1fae993c@p183> References: <02591c1e-936b-46bf-ad2b-402b33338eee@p183> <9b23bb6bcabe4f419cb8510e99275085@AcuMS.aculab.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <9b23bb6bcabe4f419cb8510e99275085@AcuMS.aculab.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 14 Oct 2023 02:23:18 -0700 (PDT) On Thu, Oct 12, 2023 at 01:54:06PM +0000, David Laight wrote: > From: Alexey Dobriyan > > Sent: 11 October 2023 19:24 > > +/* our min() is unusable in constant expressions ;-/ */ > > +#define __const_min(x, y) ((x) < (y) ? (x) : (y)) > > +static const unsigned int sysctl_nr_open_max = > > + __const_min(INT_MAX, ~(size_t)0/sizeof(void *)) & -BITS_PER_LONG; > > I think you'll find that min() is fine. Mainline min() still can't do static const x = min(1, 2);