Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp45135pxb; Thu, 30 Sep 2021 00:18:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyt5jLw5U+V6J3iCtb5VrujZJ95ufdEWpnYRGX8pXm5v9YBVY0suSypvgcdzKTtiAOVHC+n X-Received: by 2002:a50:e101:: with SMTP id h1mr5267540edl.245.1632986334716; Thu, 30 Sep 2021 00:18:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632986334; cv=none; d=google.com; s=arc-20160816; b=UxmD3ZJVnbpbVb3g3csDLSAyvwkD7FhLL1P0rPjxigKxKpJT5tJovW5xtPLOv35G9c z+Pq36+s6crStnMOIrNe/n1Orzt5zn9dCks+aZ/o6N8/u3ne82YeE5mfKTwMF6gLjyuN FsZsQPVLf9v3IIpKfszu5chng9RBJ4fZRYUT3jiVW1yihtJp84FwFcGAfOXWECUzC4l8 OWma2y/vqUn/299E1/czaWPd0rIFh3y6sJfqWNno23RtOLeIh3MbmNNSpL1bECUZkQ0M Rv8Y5yVYfOuCnyI01ICqZA7A6xfKDx33qQtK8KdqTCH4VBbMt2Bw8sU2yoUN5Yxp+hHI Coxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:to:from; bh=3CnVP7Bv2HStve1bl+guWbmALkS6qLLdUkKIfjxYLds=; b=WV+KvhjIQTV8reXAe4WsHQgvM48bK7NISEsRvYY6omEfizuAyVSNw8ksO0wGF/dyut zBhiFdvNsjNCBeg+HUtWVy4xoEG83xMv1iQ4mG8XnkEYlpiL5dI2XcgkoPJiNhxL6QSU gDZHiJBHsmDntwpfj2VNPQSXRwRIRL4LrptXVcDNz7AMjZjbNCYiX/bsWe9l7Dp7b0Nf 0Rd8qjmZzf769q+tBnUkNWiTMyxnscgxdB2igTg2UuVehXfbB/VAyT5rIfZ35Gm4JmgD SvUv/bT1Pmnqf/HdaDwFISNaN5gitP+1l5UWwNY5HjIhPkXchOM3LqhQEtazX7pQPUDA rkHQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n15si641401edy.392.2021.09.30.00.18.29; Thu, 30 Sep 2021 00:18:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348579AbhI3HSY (ORCPT + 99 others); Thu, 30 Sep 2021 03:18:24 -0400 Received: from mx313.baidu.com ([180.101.52.140]:34331 "EHLO njjs-sys-mailin08.njjs.baidu.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1348531AbhI3HSX (ORCPT ); Thu, 30 Sep 2021 03:18:23 -0400 Received: from bjhw-sys-rpm015653cc5.bjhw.baidu.com (bjhw-sys-rpm015653cc5.bjhw.baidu.com [10.227.53.39]) by njjs-sys-mailin08.njjs.baidu.com (Postfix) with ESMTP id 334E760C004A; Thu, 30 Sep 2021 15:16:36 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by bjhw-sys-rpm015653cc5.bjhw.baidu.com (Postfix) with ESMTP id 17FFED9932; Thu, 30 Sep 2021 15:16:36 +0800 (CST) From: Li RongQing To: linux-kernel@vger.kernel.org, michel@lespinasse.org Subject: [PATCH] rbtree: Remove unneeded check condition in rb_find_first Date: Thu, 30 Sep 2021 15:16:36 +0800 Message-Id: <1632986196-20074-1-git-send-email-lirongqing@baidu.com> X-Mailer: git-send-email 1.7.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } } -- 1.7.1