Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp725471pxb; Thu, 30 Sep 2021 16:09:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytcpYgM35H+7VxuawcNTlhUcMa+cZTSqwHjrWO/pan9ld+H7JLVRfRycreJK9mOlAMh4qb X-Received: by 2002:a17:90b:14c1:: with SMTP id jz1mr5848572pjb.111.1633043347807; Thu, 30 Sep 2021 16:09:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633043347; cv=none; d=google.com; s=arc-20160816; b=p9md3TTHc2KLjzd5r2t1NxHJhNhmpPiKdMJyHCGIpUG8iKwhehtCdORKrk838Yhs9I ZTJxTVRW8qzgRITtqr2GpBnyoDLjMbY+fxYXu0GTFbc52USBb9LIDiNUjFJnHjcM9cOC unEqLfzIzg3xxmqpK4wy95fBTnRISJrd3tHwHmVEwjtl2eTGSyiXJG9zbHHvpBvARgn1 uAa8p1a4vjbhsyF+iEL1x7hIaWvaWe2jkBETRerPTazemwvbBd/gPmK/qVDRqem+e8m1 6fF8WgKFkXuEWt2mJ6nNxe1RSgfXtwmb4jFzamk7CTq9Dz6T27+nz9UOzPiUGZNnA1q+ +12w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=c4tAztelNd4I3jqxJmzgttxMzW+0BW3CnTQ/W3W41z4=; b=X8+B33ieUwvIvnV69pI4GOs/0Cn73K2bmESDdm9Wk8L2Rq7483OEcVJ5wp7SKvBr8m oYja8eyt//PcE6KeZvbn7nZ0PbjTFJa6UrODQTHFSRVCIbAz/06mszhmuUqA7Y2JNUCa Skw4CQKlIWG9YthCbvhXxmdDAyDdHV1pXqTXDe3dpU2JzHF5ZxQcxSjWq3Hs4Kp9acIh 37iLYuI8l8GoaBKX6sGaN3jNnSYv6OEHQrhCJgn4rEOEJqCrg5U6sgQVmzcRpH4CHWIA Y7HWthrjLm3/ea0/AA/dlJoVXICzp75o22SnoEHOMstZkfytAvbbzUwSqaIbA0et+dSx g9+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-35-rsa header.b=Lp50lrim; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si5172213plq.240.2021.09.30.16.08.54; Thu, 30 Sep 2021 16:09:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=neutral (no key) header.i=@lespinasse.org; dkim=pass (test mode) header.i=@lespinasse.org header.s=srv-35-rsa header.b=Lp50lrim; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lespinasse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348270AbhI3XH7 (ORCPT + 99 others); Thu, 30 Sep 2021 19:07:59 -0400 Received: from server.lespinasse.org ([63.205.204.226]:52695 "EHLO server.lespinasse.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230167AbhI3XH6 (ORCPT ); Thu, 30 Sep 2021 19:07:58 -0400 X-Greylist: delayed 444 seconds by postgrey-1.27 at vger.kernel.org; Thu, 30 Sep 2021 19:07:58 EDT DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-35-ed; t=1633042731; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=c4tAztelNd4I3jqxJmzgttxMzW+0BW3CnTQ/W3W41z4=; b=tqodSRzZEERZmTZw6/eese8sapZxy9+R60kCui+0BLISkSmjI8UmGKMkxwQSNbo2BS1Wk ONwvzJSu2GwnTb0CA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lespinasse.org; i=@lespinasse.org; q=dns/txt; s=srv-35-rsa; t=1633042731; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to : from; bh=c4tAztelNd4I3jqxJmzgttxMzW+0BW3CnTQ/W3W41z4=; b=Lp50lrimmRiri2Jg+20OmkoUOshtgaSHb1UwN1fEdJv5DhvBvy2gaa1MNbnIry8q8ZFWn XgybYTKzedw25BEFYm1uRXsRSmK31ht9+CDqpbxhnAqjYszSdlSHKgfV88eDxQp9R143hBj CONhHMDxzPPHCj/I9BLb6Ai8jOixc6Dn+I9jHIpxPDYagBaRN09QQG9+UpW6sbNoWmB1m21 zhNLhyleRN18ANCaNRb4nxsiGqh7f+Rx56WIrXk+InbQ6F7Jgv+BLxPpxAHheFz00dcXTe4 BajagHz1I/HJggQmW1cd6Pa28VzbBVsEpKlEyGwUG9L8+DDAX9bZvBtsmEfw== Received: by server.lespinasse.org (Postfix, from userid 1000) id 02CA0160723; Thu, 30 Sep 2021 15:58:51 -0700 (PDT) Date: Thu, 30 Sep 2021 15:58:50 -0700 From: Michel Lespinasse To: Li RongQing Cc: linux-kernel@vger.kernel.org, michel@lespinasse.org Subject: Re: [PATCH] rbtree: Remove unneeded check condition in rb_find_first Message-ID: <20210930225850.GA6434@lespinasse.org> References: <1632986196-20074-1-git-send-email-lirongqing@baidu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1632986196-20074-1-git-send-email-lirongqing@baidu.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 30, 2021 at 03:16:36PM +0800, Li RongQing wrote: > the variable c is int type, so change the following condition > > if (c <= 0) { > > } > else if (c > 0) { > > } > as: > if (c <= 0) { > > } > else { > > } > > Spotted-by: Michel Lespinasse <> > Signed-off-by: Li RongQing > --- > include/linux/rbtree.h | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h > index 235047d..d5ac8f7 100644 > --- a/include/linux/rbtree.h > +++ b/include/linux/rbtree.h > @@ -294,7 +294,7 @@ static inline void rb_replace_node_cached(struct rb_node *victim, > if (!c) > match = node; > node = node->rb_left; > - } else if (c > 0) { > + } else { > node = node->rb_right; > } > } Looks good to me, thanks for the fix. Reviewed-by: Michel Lespinasse -- Michel "walken" Lespinasse