Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2060386imm; Sat, 13 Oct 2018 09:16:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV60rgLt8uqCBORCu44aWqT/pohEh+rDDW9K5XWTeZtDB99400abBMfMX6TaoZKOjGYRnVW0r X-Received: by 2002:a63:6781:: with SMTP id b123-v6mr9850236pgc.151.1539447365505; Sat, 13 Oct 2018 09:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539447365; cv=none; d=google.com; s=arc-20160816; b=KZL8r3g9XRY01j6K0ekOGxxINg0c/hxt78ZF9sJdt7qv3crO3kz85DW+zmTrxLCmFl FaS/Bcq/t0qCERJ6F4akDeYy1MuMcF5yq9T6h7ORjPK23LK4NpdEUkytZzWFFjJWGfdX +DohiFEJ7GMEFZB/yJ14Qx9LzvdJtQVwln3CkPwb70DdyrzFJMDfkzCx+HgZtNDA3HEg KNUTmISQlSQ/KKiMKhGALG2ChQfrpmtaKEFoxW0OKJMiZxomd8jMNPDT3dBMvBtUBRfX QvJxHf9ZAFXXTanzecsBuZ8b8NoUvPDmhBuxihY4t3RdleKkH7y0v6oCVK8RupozVAtp 6bwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=B/LsfvRTvdMeOjoARWDSCtdWujAYnJOdr7Z5zaytTpc=; b=AxcpdHg8KqT27F4wNmF3GVgHnKJ99WkRmE61hzOUtQq56PdsgrPJMlNv95Z4dKKf6e qs+Ez4RR0gbAnNSbrXSdw6QKENAVMU0pvNyoiohixxkv6OooJy5mQdFoHZ0oujZmKWt6 xLOLCW5QgEXpCnnPZhtMHJX84G0ohs5MuDKDk0d6GcNq1kaONf1fG67PNJhFCADNDi6y ilWiQ7vVngM/uSFr/9bbbLLc8rnjC6/F815EZ1sNM9OFv0MownHEkFfPgB1kTpA2tDS8 221cr3VJsaZW+OT9dgrjb8muac6ShnYh3IdKPVXJzBC+P46ygkmodORZZXgLxaTYNP4J 1jKQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5-v6si4598732pgv.38.2018.10.13.09.15.50; Sat, 13 Oct 2018 09:16:05 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726689AbeJMXxO (ORCPT + 99 others); Sat, 13 Oct 2018 19:53:14 -0400 Received: from mail78-59.sinamail.sina.com.cn ([219.142.78.59]:45158 "HELO mail78-59.sinamail.sina.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726362AbeJMXxO (ORCPT ); Sat, 13 Oct 2018 19:53:14 -0400 Received: from unknown (HELO localhost.localdomain.localdomain)([171.223.32.124]) by sina.com with ESMTP id 5BC21A1900001282; Sat, 14 Oct 2018 00:15:27 +0800 (CST) X-Sender: penghao122@sina.com.cn X-Auth-ID: penghao122@sina.com.cn X-SMAIL-MID: 242104394989 From: Peng Hao To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, pasha.tatashin@oracle.com, osalvador@suse.de, linux-kernel@vger.kernel.org, Peng Hao Subject: [PATCH] mm/sparse: remove a check that compare if unsigned variable is negative Date: Sat, 13 Oct 2018 12:15:19 -0400 Message-Id: <1539447319-5383-1-git-send-email-penghao122@sina.com.cn> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peng Hao In all use locations for for_each_present_section_nr, variable section_nr is unsigned. It is unnecessary to test if it is negative. Signed-off-by: Peng Hao --- mm/sparse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 10b07ee..a6f9f22 100644 --- a/mm/sparse.c +++ b/mm/sparse.c @@ -196,8 +196,7 @@ static inline int next_present_section_nr(int section_nr) } #define for_each_present_section_nr(start, section_nr) \ for (section_nr = next_present_section_nr(start-1); \ - ((section_nr >= 0) && \ - (section_nr <= __highest_present_section_nr)); \ + section_nr <= __highest_present_section_nr; \ section_nr = next_present_section_nr(section_nr)) static inline unsigned long first_present_section_nr(void) -- 1.8.3.1