From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 01854421F03 for ; Wed, 21 Jan 2026 06:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768976251; cv=none; b=SJhyeIcKC0dB365QXDYodoaxcim2qm1b1rQGF8lgo0O6wLL3ltcIhExWkiZA9+/OZx8rEtXp3igi2NWuCkhms7D9ynbwqmhCsq7U6m5gvIN0ImO5NpbpK7Yzqi8Hr44ml0n0VD03EdO7uWxAcRtBGrjX/HyigdCVxUtSL7/d9Ag= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768976251; c=relaxed/simple; bh=jHC3Zm1FoOAE0tcOomJpcGkK1zyPdxpo82Nxz8VVfMw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=FkzUt7e7nlJjQoScetMgkQJkaFA6gZcrlr/Ndg+kRaI++RHUX0edxIK8ArykMRCO6AgFVa/Zl+tM/25orBrATTOoA+I2thp/O5FvtPjXisvJos+xt0LOhXhBVrEgjKAHHAp+jtyATjGXVUQw4yp/mMiXpae0zkLz5WvnBBdK2ko= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=wAlL3gZu; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="wAlL3gZu" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VcBL8d2Tx+2ZFZ5f3VAnB2vrhIOAq8GII6J/15sAm3w=; b=wAlL3gZuurnhVR3RZjXKIacc6C DpiVRxRwhsGlnwZyo4oOr7gwAAOmSM1QpcrMhzvtzC2a5dNlB2zSXmOBq+BJPwMTASNR3KTVLGalm QZ6oupbY8Pk6H5cCP8WIL7dB+eq+P09obvWC/g28IRnOa3b3b3yXR0CT4nwf0bymuvFTUFOrBwUk5 WNcNCtx9VR99V9JVHqE16LQiYcQV6kemYKmE7HHk7jfhdUBOlgHkrmYPdx39KDMcfNcFp1W2q2x18 8LTk3FPsYCR9Rnip4hR/L+2BiFiza33+vRZHV4ozeQcDGOyNIwvwSffWvwPPh4TvRoN/+z0W1/F8O hGV7VqQg==; Received: from willy by casper.infradead.org with local (Exim 4.98.2 #2 (Red Hat Linux)) id 1viRWe-0000000FyFn-0Vs4; Wed, 21 Jan 2026 06:17:08 +0000 Date: Wed, 21 Jan 2026 06:17:07 +0000 From: Matthew Wilcox To: zenghongling Cc: muchun.song@linux.dev, osalvador@suse.de, david@kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhongling0719@126.com Subject: Re: [PATCH] mm/hugetlb_vmemmap: Use max() macro to simplify the code Message-ID: References: <20260121015114.560424-1-zenghongling@kylinos.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260121015114.560424-1-zenghongling@kylinos.cn> On Wed, Jan 21, 2026 at 09:51:14AM +0800, zenghongling wrote: > Use the max() macro to simplify the function and improve > its readability. How does this improve readability? I understand what this does in the ternary form. I have to think far harder about it in the max() form. > if (!is_power_of_2(sizeof(struct page))) > return 0; > - return size > 0 ? size : 0; > + return max(size, 0); > }