From patchwork Thu Mar 21 05:48:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Han Zhou X-Patchwork-Id: 1059807 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="oERxV0H4"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44PwnW3lm4z9sRK for ; Thu, 21 Mar 2019 16:48:30 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D95EFD93; Thu, 21 Mar 2019 05:48:25 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id B9446D8D for ; Thu, 21 Mar 2019 05:48:24 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 7A5F82D5 for ; Thu, 21 Mar 2019 05:48:24 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id k11so3471960pgb.8 for ; Wed, 20 Mar 2019 22:48:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=iTiPiRpFeDFoGi2BqhpqW1/1H0VbyZm/a0kRd8AfF5s=; b=oERxV0H4MkKlThmfMlz569TPOoLZhLmLrHwVYtKmQV3blFOvaGxEYWVVNMYRvrObg/ rxIJNYfW5KSSmG86jYDUjkY47NhKZhGRiLN9KmLWTbfK1ZiwbKDbozoGfFzfKcPjmIYO M3uSfoj8PJKtq0aRYFNHS56NcpWRU3Zx2MnlyMaePRnteCpKWpsyoicVnS0CVgNg4MJ6 xLLACigBF/tLUo5itVGYuP5Fnep1qQrMKniZ839oRWVnk/ofB8VZSt32kTYH+a2gWGJ5 gTgbV100vpzBQxAQkiEAZ67yfeE9+i2tGvgJ3WsXsa1TaH/jN7EMGOSHSImEJnwY8D7l +52g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iTiPiRpFeDFoGi2BqhpqW1/1H0VbyZm/a0kRd8AfF5s=; b=obLBTUd+48MiJYOP8KceeDabffwH/7ET9D1BSfm1sn5shTJhbYX5kYFId1vgWlRx0S zbLGtiXCxRZrT/aPRlo3yW7kat5zFH86kXfcHPB2PnIg2P6nUORVnTh+s4GDP211Y7VU t+Vjx54ECsTl9v0vJc+x7L7Afof71yjjF6txSsRLal6dCPlZJOU+aBEdUxLBZHu5cbrT mVsrbFWXyvlL2kUn+yKGhfRqzId/SGHZnkCPOIlV/oJiCbqF9858u9r70/ESjGllHBIt vbOzqOHHt9vVKlRWvO206m9xdvs2a4C1MYUt5s8O4HFoEzl4jbqNA0Qj6Z01gHegCwwr X2BQ== X-Gm-Message-State: APjAAAV/qyovvp6BYkkOync+K1bQCvyaC0aQx7swqr1AmKAm0fD1RC5X KeKdKoscCb2hKDj2jxmt5fNOvcV5 X-Google-Smtp-Source: APXvYqwtJysBNfHhg/l5o8Lv14+5/u9ycxllxnWgh1L7GmvYQQKmRNfPwJTi6XYJj3VNWLkuwd1GPw== X-Received: by 2002:a63:c242:: with SMTP id l2mr1789785pgg.138.1553147303739; Wed, 20 Mar 2019 22:48:23 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-76-21-108-74.hsd1.ca.comcast.net. [76.21.108.74]) by smtp.gmail.com with ESMTPSA id s6sm12157938pgi.56.2019.03.20.22.48.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Mar 2019 22:48:23 -0700 (PDT) From: Han Zhou X-Google-Original-From: Han Zhou To: dev@openvswitch.org Date: Wed, 20 Mar 2019 22:48:22 -0700 Message-Id: <1553147302-107422-1-git-send-email-hzhou8@ebay.com> X-Mailer: git-send-email 2.1.0 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] ovsdb-idl.c: Remove meaningless MAX(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org From: Han Zhou In the else condition, it is already ensured that index >= idl->min_index. So the MAX() is confusing and misleading here. Signed-off-by: Han Zhou --- lib/ovsdb-idl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ovsdb-idl.c b/lib/ovsdb-idl.c index 29cb80e..5ae86f7 100644 --- a/lib/ovsdb-idl.c +++ b/lib/ovsdb-idl.c @@ -1888,7 +1888,7 @@ ovsdb_idl_check_server_db(struct ovsdb_idl *idl) VLOG_WARN("%s: clustered database server has stale data; " "trying another server", server_name); } else { - idl->min_index = MAX(idl->min_index, index); + idl->min_index = index; ok = true; } } else {