Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp2292515ybf; Mon, 2 Mar 2020 05:53:28 -0800 (PST) X-Google-Smtp-Source: ADFU+vun9ffirL8/5ypWH9DkkpJtwk78RaIZo3/I6LME7GktRXl3X8MiqzoPYpKzD2f/U7Uw9wB2 X-Received: by 2002:a05:6830:1017:: with SMTP id a23mr4377190otp.324.1583157207906; Mon, 02 Mar 2020 05:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583157207; cv=none; d=google.com; s=arc-20160816; b=D4lL/YsTDYb+ACyeJoefGCGZbBmYRVgFsS/h9Gql6nSq8PCuCJ4jPYFu1PI+7OqIJe Md6T4uF4Ou/bvQCYcn/iVNbTMDguoHPUabS1zwefHXXFdWI04zdN657wREzs264xexjK MwRDl3kLW0aibKO/UqzUdUzKkf7n/oP7V3tMkuGeq1Kt54h2YGNaBxjXOqz3yMQOyccR 2fXL8CKLIZD40G+fCd8i6/FIWsqAMECOAZUBcmNPzDVkL8J6qJIBVnI2IocT9LURKZ2b BkEdYz6270azAImTQxWTsp5wskJIjFubVhfJ+I+YNTHnQIp+QeXXJl+V8o2tXRz3r5LQ k6/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=R2BZu+imcykNACPLPvIynfptCCeFQHdJvvg/T84qCP8=; b=vmu1VqKdCEr8bU0tHzM43ZaDMpGi6PpAX70KtWt0LG2wbekHlY87ts5i91aa0BOdSX pzz84nTsFhmnIim9vF5ZGGLr81aLPB6nq4TUUPXxuAZeAf+9svvecU5P4gVPjt+WYV1i nwPH+U/+oe3Jn1ABGuDrTOD/CuielLxXcnZ08uqaNFIyiTctjHYkdqYuu/lQPE0Q/Fqw /zTRrd4SJjvqxfcGHX/5bmXsEf2sIEXbjDvQpq1TuopyEQIxpu+bw5bhdhmiVh5b9cJp F/zQrF9aSarA18hYeqllFh7FZ64QLFbsNx81WHGVhekwTvX2tRleHapBV/auoHerUnQR jwag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mmLGIQqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si6220135otc.308.2020.03.02.05.53.15; Mon, 02 Mar 2020 05:53:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=mmLGIQqL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727242AbgCBNvk (ORCPT + 99 others); Mon, 2 Mar 2020 08:51:40 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:38754 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726969AbgCBNvk (ORCPT ); Mon, 2 Mar 2020 08:51:40 -0500 Received: by mail-wm1-f68.google.com with SMTP id u9so4857841wml.3 for ; Mon, 02 Mar 2020 05:51:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=R2BZu+imcykNACPLPvIynfptCCeFQHdJvvg/T84qCP8=; b=mmLGIQqLs40/1JctkJUW6fbnrI0wxyktW/MCLs1VqwiTzd4SDvBGmvOxVfPkG5rZh5 uJOIAYDexjxz0yNhBvg09cLZfbwPNB0bBkJHNv+3WEvizQvZfuZ3AU4SRlzG1g5mk2B6 6llx37T3S+hlKdpV+y2jbBUJ79l3tlddWzm2s2FedCGfwWzUs47UvEOu5PBCppwg5+xW ac+OsYujE/Xtu1/oDlh3eYFUeABe6ORlhnB3CGOPTXr3M6HT0acqwrAzGalKO74ZEZj4 gRVXWMijclJLyTIZqs4CpiEVANmMCGVLWD1imqMswpQ8LNtWQ4dgW9ezZEmblkQfjK8s WFTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=R2BZu+imcykNACPLPvIynfptCCeFQHdJvvg/T84qCP8=; b=hrFKGrnjikI5qqpSdHoH934GxPVp2ED1sBJgLTjzG9lrAAt8kmoo6hrksMnBE7qxX6 xdOr/ieiCEhXZR8p7CaAD9t7jp2YIEjvIdq51YqnLTuOvlmxqmLrXDgvAWGgsG1q1vTP +A7CWzuPObNklaSl0pjwvl3dFo5S4bCm2JXMIjawX6CsSW7zOjtICcXRIQ3+FOQbLrXa ERln3r8QP3Dy6p8xyRuJkX4y9ALDpYX2BisaTR58ZWLQj1owmR+yTENPW6klwDv55832 l8i8jnblL8jpVcPdQFfeS/WHa/pTNCEi06J12553TL6JpKr9XXtxQqRXq/liWy6hoti5 BN0w== X-Gm-Message-State: ANhLgQ2T8L4W9e+TKtDPed9Ww07VperSb8lahU3y4S6KMhVkjQKyILJ9 ooltZmp3g7vfWSFJCJANVfw= X-Received: by 2002:a05:600c:351:: with SMTP id u17mr6467430wmd.22.1583157098661; Mon, 02 Mar 2020 05:51:38 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id l17sm7530089wmi.10.2020.03.02.05.51.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 02 Mar 2020 05:51:37 -0800 (PST) Date: Mon, 2 Mar 2020 13:51:37 +0000 From: Wei Yang To: mateusznosek0@gmail.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: Re: [PATCH] mm/mm_init.c: Clean code. Use BUILD_BUG_ON when comparing compile time constant Message-ID: <20200302135137.lm5syk7r2thohs54@master> Reply-To: Wei Yang References: <20200228224617.11343-1-mateusznosek0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200228224617.11343-1-mateusznosek0@gmail.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 28, 2020 at 11:46:17PM +0100, mateusznosek0@gmail.com wrote: >From: Mateusz Nosek > >MAX_ZONELISTS is compile time constant, >so it should be compared using BUILD_BUG_ON not BUG_ON. > >Signed-off-by: Mateusz Nosek Sounds you are right. Reviewed-by: Wei Yang >--- > mm/mm_init.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/mm/mm_init.c b/mm/mm_init.c >index 5c918388de99..7da6991d9435 100644 >--- a/mm/mm_init.c >+++ b/mm/mm_init.c >@@ -37,7 +37,7 @@ void __init mminit_verify_zonelist(void) > struct zonelist *zonelist; > int i, listid, zoneid; > >- BUG_ON(MAX_ZONELISTS > 2); >+ BUILD_BUG_ON(MAX_ZONELISTS > 2); > for (i = 0; i < MAX_ZONELISTS * MAX_NR_ZONES; i++) { > > /* Identify the zone and nodelist */ >-- >2.17.1 -- Wei Yang Help you, Help me