Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3795021rwd; Sat, 10 Jun 2023 15:17:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7W1LKv/ysMeAishFGsk3Zm+3Dcr5SNqBUrO+EKM24ALEspS0XMeH4MJJDcIo/oUvb+V2CD X-Received: by 2002:a17:902:e747:b0:1ae:626b:4771 with SMTP id p7-20020a170902e74700b001ae626b4771mr3255763plf.36.1686435477530; Sat, 10 Jun 2023 15:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686435477; cv=none; d=google.com; s=arc-20160816; b=hKikYg+tor5SVYoWAVH1Q+XYFoVYW9eW0q40XS7EzvgRPtTATwEgqOEpW0kwF2f+LO MgVjNdg9Cs5dMS1KeqRSYbPnwFfV7W5W6fnaWoU2ReXP0kFQHDBXEtyGnAippd+MaSHr A5npfHD2l8CX9XbZcCVGiaII64WjTvNovZ8jdoxi/2PEWenyxVjoDctE0Q17R3l7Ilr/ 5q5PLCodemvOUIoej7qwOGcxroOKAuqYGWPkpXm2gqgFe0jNZn9rMxqY5NIb/pWlaC40 Ot7k49fNf10jSEoS7DxM4DpuKlHm8izyWdP+GJVTeSEyvgTqjnAMSOwz/0wyifBkFUqM gPEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=vsMzMS6Nwd5syKJ5RlDBrxmikTqikPJE9kXrAEn6XlI=; b=BO+9m6vGvTJCYy5LbwnlvQysNcSODwpCeSZACFEnvZSYnn1P4G0UOrpMPHa0dKWjLz 9qXsilPhNThN4NKHC7ZVKY+Dq5j1uFtB66LZka+O0DxVf7KidFetFjhxn7nrVcrOnNe5 LWmF5o8MdUPKIO1M5/tFxDTC6SeG3Oww7kAIzGGaD/zUura2+l5mHrkpWxffwloofOOp FfvSLQWUXDiSPiWOLYRcLrRuIO5n/epMOYQBgPIuOTEm4ZOL8QPUgM8cqau65xt7XBs8 ah+iNrO2NjckYCB8egSyrrqTThDrn6Yn3kwEPK/FZX71Jf/1NwEyXQKsJxP+5aRyPe+a 4n7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kxN1UvBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a170903124c00b001a6f0e81ec7si5079297plh.237.2023.06.10.15.17.45; Sat, 10 Jun 2023 15:17:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=kxN1UvBn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229579AbjFJWIO (ORCPT + 99 others); Sat, 10 Jun 2023 18:08:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjFJWIM (ORCPT ); Sat, 10 Jun 2023 18:08:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3F9E3A87 for ; Sat, 10 Jun 2023 15:08:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 401D761655 for ; Sat, 10 Jun 2023 22:08:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B9C1C433D2; Sat, 10 Jun 2023 22:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1686434890; bh=MCsFvVy435UaO9a2k6Ch4D0TT3bNe+I9J5W8nx6Qeb8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kxN1UvBnTCZQG40Rtk8MCWrbWMEX/vfsaNnkp7tb4aTwwvgq/moKjS4R3oQ4+v0u9 L+46ZjVNWlrmWdkhMRJRzFFutZkW6pETOoy9rHjRDxoUBkdxzkcLOwG7bRrC3iSlpN dR2fI0Wa6dWu/Wd2hWBsZMwfvGWemLvsZwZTfRTE= Date: Sat, 10 Jun 2023 15:08:09 -0700 From: Andrew Morton To: Lorenzo Stoakes Cc: David Laight , Lu Hongfei , Uladzislau Rezki , Christoph Hellwig , "open list:VMALLOC" , open list , "opensource.kernel@vivo.com" Subject: Re: [PATCH] mm/vmalloc: Replace the ternary conditional operator with min() Message-Id: <20230610150809.babdc5a7919258f066c8637e@linux-foundation.org> In-Reply-To: References: <20230609061309.42453-1-luhongfei@vivo.com> <832d7c69-ffd5-4764-8ffe-3a02bef0efb0@lucifer.local> <3fc87d60-4e81-4f49-95f0-0503ad5cdf35@lucifer.local> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 10 Jun 2023 22:06:35 +0100 Lorenzo Stoakes wrote: > > > OK, as per the pedantic test bot, you'll need to change this to:- > > > > > > num = min_t(size_t, remains, PAGE_SIZE); PAGE_SIZE is a nuisance. It _usually_ creates the need for a cast: hp2:/usr/src/linux-6.4-rc4> grep -r "min(.*PAGE_SIZE" . | wc -l 117 hp2:/usr/src/linux-6.4-rc4> grep -r "min_t(.*PAGE_SIZE" . | wc -l 279 Perhaps it should always have been size_t. I suppose we could do #define PAGE_SIZE_T (size_t)PAGE_SIZE And use that where needed. Mainly because I like the name ;)