Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31500278rwd; Thu, 6 Jul 2023 23:40:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEhSUI/WWyWR+Njdg57pxHQC9t8NU0YyDkf2XOK9iNP48op6k9q9mYuzF5yg34Myye5+dx6 X-Received: by 2002:a92:db45:0:b0:33e:7c8d:3cc with SMTP id w5-20020a92db45000000b0033e7c8d03ccmr3907824ilq.22.1688712036696; Thu, 06 Jul 2023 23:40:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688712036; cv=none; d=google.com; s=arc-20160816; b=FeUkmhimLM3Fid67JA4z9jTATReK02VnB/zrB3+Nox6wSsdfcOaQt4FVclf5+af1hI ld6+KKL5dkMdvcT2L6UFs3L74fN62bdJ1uo7Epylv59qGHMWER8/7ACIe62DwT2lXUVS GtiNBGSermINd48dP9zGfyQ1LtIKt88rI1aOhw9VJAGm6U25kdIBLohEcH0gsQ3ICRCd cRZOIjTJHHkQdsjKfTxTEWCZUqrLxYR2/mLxYxzFZev7VbUTEJmSMb4rYPV6QmuR8ukA 93KGtp2dWpS9E6iImE2n6YG+yKuWh/VSghP5VlXJ4Z3j2EEjhR1M26lxIZE4RR3YFUG3 NxXQ== 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 :message-id:date:subject:cc:to:from:sender:hmm_source_type :hmm_attache_num:hmm_source_ip; bh=DbZq0M9WfK0zleGtD2AzL/nMi8N4VuAFV6G73+6lCQI=; fh=1Fw5yMZ+1tswwXUntrCQce1mZyuqCncshiBtfpfdBEg=; b=aIM0y1eKQrincvXwx/yyGh2Zm4DEvSe3EelJqW65gitxMzNKXNwau4G+MSh81zsxd5 J9aghCtEzy/AQIiIRXHOl3Z3uxhXRoSkzprMPJm7qG+oWSyQ/8CYtkTeIg4mwuwU7FtB M9J86lFtnqtxbV5JpME7jSzmg+gtg1empTb3ZsO+bmJRMx6AelcgjcUbRwM1lUWG0+Lu FaIvjTAdnwIRfOGzQuwYLV8ZcfYvCAU8q9DGpvQtW5Nf84D5N68TePUJOzqEATrn0udr hrqtdGS2L+ZsvpHKYYgrs3hIgLS/CCbWDi0po06iazB2NtIECYhQwEMIGNT0DJpQkMbr SJnA== ARC-Authentication-Results: i=1; mx.google.com; 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 a38-20020a631a26000000b005577fd7efa2si3106504pga.444.2023.07.06.23.40.24; Thu, 06 Jul 2023 23:40:36 -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; 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 S232412AbjGGGQ1 (ORCPT + 99 others); Fri, 7 Jul 2023 02:16:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjGGGQ0 (ORCPT ); Fri, 7 Jul 2023 02:16:26 -0400 X-Greylist: delayed 660 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 06 Jul 2023 23:16:24 PDT Received: from chinatelecom.cn (smtpnm6-01.21cn.com [182.42.159.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 155C11737 for ; Thu, 6 Jul 2023 23:16:23 -0700 (PDT) HMM_SOURCE_IP: 192.168.137.232:16264.1587224530 HMM_ATTACHE_NUM: 0000 HMM_SOURCE_TYPE: SMTP Received: from clientip-36.111.64.85 (unknown [192.168.137.232]) by chinatelecom.cn (HERMES) with SMTP id C6CFC10013632; Fri, 7 Jul 2023 14:05:07 +0800 (CST) X-189-SAVE-TO-SEND: +liuq131@chinatelecom.cn Received: from ([36.111.64.85]) by gateway-ssl-dep-d8bd95c49-j4mlb with ESMTP id c87cf4383e7346e3a79c67b0e0606676 for akpm@linux-foundation.org; Fri, 07 Jul 2023 14:05:17 CST X-Transaction-ID: c87cf4383e7346e3a79c67b0e0606676 X-Real-From: liuq131@chinatelecom.cn X-Receive-IP: 36.111.64.85 X-MEDUSA-Status: 0 Sender: liuq131@chinatelecom.cn From: liuq To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, liuq Subject: [PATCH] mm/sparse: remove redundant judgments from macro for_each_present_section_nr Date: Fri, 7 Jul 2023 14:05:01 +0800 Message-Id: <20230707060501.29184-1-liuq131@chinatelecom.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 The next_present_section_nr function has already ensured that 'section_nr<=__highest_present_section_nr', so this conditional judgment is removed. Signed-off-by: liuq --- mm/sparse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 297a8b772e8d..77d91e565045 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -172,8 +172,7 @@ static void __section_mark_present(struct mem_section *ms, #define for_each_present_section_nr(start, section_nr) \ for (section_nr = next_present_section_nr(start-1); \ - ((section_nr != -1) && \ - (section_nr <= __highest_present_section_nr)); \ + section_nr != -1; \ section_nr = next_present_section_nr(section_nr)) static inline unsigned long first_present_section_nr(void) -- 2.27.0