From patchwork Fri Jul 7 06:05:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qiang Liu X-Patchwork-Id: 13304452 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3860EB64D9 for ; Fri, 7 Jul 2023 06:05:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15FAD8D0002; Fri, 7 Jul 2023 02:05:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 10F998D0001; Fri, 7 Jul 2023 02:05:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F3FD18D0002; Fri, 7 Jul 2023 02:05:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E57F38D0001 for ; Fri, 7 Jul 2023 02:05:29 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 79871120CB9 for ; Fri, 7 Jul 2023 06:05:29 +0000 (UTC) X-FDA: 80983778778.19.ACA4C7E Received: from chinatelecom.cn (smtpnm6-01.21cn.com [182.42.159.233]) by imf05.hostedemail.com (Postfix) with ESMTP id 51C9010000B for ; Fri, 7 Jul 2023 06:05:24 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of liuq131@chinatelecom.cn designates 182.42.159.233 as permitted sender) smtp.mailfrom=liuq131@chinatelecom.cn; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688709927; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=DbZq0M9WfK0zleGtD2AzL/nMi8N4VuAFV6G73+6lCQI=; b=Mnj088HZilHshTDzvuPvDR7yUafA6TDI/SwJrI2etRcPG3RUUZVQD6jgKPlDqg2rGEflU4 c/FJQc5dwUKUI7cNeSuJLv8PQGBBQwwGxpPjyEYWSoZ3BdgzzQ1W/9dJogafnAdvOuQe7K UtXn7CejFhU7Fo/9UH2xmzLvrQ4WM7o= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688709927; a=rsa-sha256; cv=none; b=bp5QBVpo2iU8CNPB5aK/8hTCQNicL/y7Ezhw4m1VrGmaUrPP1q0WhJGrW9tBNrm+TOAiWC g3SsV1bFyAZAsLP6voLqw3/YguJ5iWxELmKE4rnkU+5mOvnXvpSbiaZEAOwk+/P24aycHn KXwZJ+KhiBeoyb6IYiiRr7xHTSqefpU= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of liuq131@chinatelecom.cn designates 182.42.159.233 as permitted sender) smtp.mailfrom=liuq131@chinatelecom.cn; dmarc=none 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 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 X-Stat-Signature: kxehebjegonpkbcjouyjznoxzma851y9 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 51C9010000B X-Rspam-User: X-HE-Tag: 1688709924-645675 X-HE-Meta: U2FsdGVkX19rEJEkxj8Q6uhpQ3+zUH87w98AXAzxI5UCvGRRtv2lyy+U+3BW3zEDsOoNLP+NqIPhgqVhZaV3KEGLiQOC6FoTfVFFiORqHmI90iMU5aPIWRry+52C9QAg3eGWSTwhrBUIxt+iqByB3bHaMbm3Vw2+/t2d2WRUKU0v5k8/CMYREwOvLUym6lxl4u+J1b7Yxq8W3L5LWeQjLz3KQxCpqMTQ6mUvhwGfra8KFZoYTqvEQIW8gSobybsKT2p3FkJVQjqxds0vQ9JKPGYgNYh1ZZ9F6Cv2HG/NHp7quCMqL//BQBNVw+0yVbVL/lzGZiiKxzAlmqvWft0abLHwbj8TAyZhkpUFA8rtSMFkGGcbI2Qsu0Ytxt99Mq+5bZDpda2Wvp0+mfTMiiO6YzawO+Ysn9nq4ITzJqNNt3tQF5CZX07N6PoD+7SIKEhAj8MWVbJhr12Zy5aC4Xnyc0PLJp6sBLxweeSbQt8RCW42F08YZRxJLOS4czYdhHbAmt6sgml9Af0YNN6BXdQlCwWutUO69BHPOnCBbSATwQw3ud4S+lFjxtW5uEr8IPc8MKugLgMXzBaxLT4/+BPUTYvkjx3F7VWg40HX15aCKU6wL0hoMnUk/h33RsyG+qaaqtaXJM68rPWm0Dk1t+tK9GNUnnz7xzAITS2bbUUZLmC0CliZBqh/T6cr5IL3kY7FdU/DMw4o9avFSzVpekck0k1ab8fmlfGslENx4pr4YxSxJjSpP5R0FIYr3VZ+4iW+TojYnjvgSK5NI5xGwxE7kenr2uDvF8QFy05jASVKDxqF8a16+Jcp/dzgrRt9k6encWwneace2WFpE5At1dOWBd5iN57eGsvBAfCkffh/2lboThAbWsGjX+36GdwPUl4P+4UeVKaLMWKhQHw0prb9pMAd4z8leNaiszHKshFVSz7sw+xBEBq5LH38Rfzf7T5cD4+z2HroJrqU+YbOjrC IjgrJLS/ 6vb4DGTUUwHVgTwDQ61Cn9/5XZEJHPTN1FEkLUek3uO1vvefvXQ8DysEL1pdnz2RGbVBSTcjCzQnEcf3FLdV1lNmZARRLkJia/NhJPA1Z1K0n/DO4wqEOdO2pNYLfWZYhg62KupuBuVabXWLc/oGA7a8b9Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.358280, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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)