From patchwork Thu Mar 19 00:32:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Usman S. Ansari" X-Patchwork-Id: 1257873 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.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.a=rsa-sha256 header.s=20161025 header.b=b+tMxm6m; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48jSXg3jGzz9sRY for ; Thu, 19 Mar 2020 11:32:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F10398777D; Thu, 19 Mar 2020 00:32:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GuKW6j3wry9h; Thu, 19 Mar 2020 00:32:17 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 66D978763C; Thu, 19 Mar 2020 00:32:17 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 5BF5DC18DA; Thu, 19 Mar 2020 00:32:17 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 09719C087F for ; Thu, 19 Mar 2020 00:32:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E262C86901 for ; Thu, 19 Mar 2020 00:32:15 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8legPfqo7BbP for ; Thu, 19 Mar 2020 00:32:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 6204B868FB for ; Thu, 19 Mar 2020 00:32:15 +0000 (UTC) Received: by mail-pf1-f170.google.com with SMTP id x2so394803pfn.9 for ; Wed, 18 Mar 2020 17:32:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=uwZfM2J8o7H8Yx5S7YcTpTi/xmnSRi6ulfnXlGb9yMU=; b=b+tMxm6mAQU2bCgMMo+7AG6r7YRO62M5mtJDQpnj5hvS4ntN/qxBs+Is/lIQFYALDE Hh/W8HfGRnR1eon8Z0yuaMrik115d3JSsovH1S/m7pnYNgtIXGtjd6gyR4ncJw66amRe Dbh9JISgAhThSp4TebEhqApsipQECO7qm4EKkI94zQyvYcBcfb6Y2sIYXhkph+l2UCo7 afHjFf+rsqmzQj52nt3PLtZla4dFEAjlfSBXekEtRyuofstFvL8bM46LVB9e+1S7rI3L YNC+JnX79rcNBkAwHRJQsxAp2oq1XZWx9SZARfcn1kjgfyqKD77pOEpdjOZZqfFX+GhR 1asg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=uwZfM2J8o7H8Yx5S7YcTpTi/xmnSRi6ulfnXlGb9yMU=; b=qaoj6sBhYcDDxJKi4nqrNmdZC77xrItmt5jP+nYKu6hCPx+UDUm/9bAcDllPt88NwF DWMYIw3FzzQ8mwnwOkX6nRJOXvyGcz0gGKcfBlWwIXCnFrVkeVGU9oUwVcARgYBi2zap vnOlsH0nS+9YTzV6eu/jFHf1VFhjFTjKZCw+OB1GUc1jfMy0ZZnWKb2H/pyLQ6Ut9d97 /NXMc7wfZwalKoJ0e6tfXamQo5QDKFr9ksscpj5fLacvTpJQc6lAE2kYYBjEqHlWSut3 L6qBuemx0THbhHhMXR9tAVRsoxf9oSdgFLx8Ntc0cyO+B6qEy5bHxd/0tVx8zwTZD5kh k06A== X-Gm-Message-State: ANhLgQ1cLZEd/eIUUTHnY8E0zFS67FUP9wWzzSS+3sJgcIRkNn7A/Wwy m39BKzRcQM8yzP6WF79Rpn/XWRMKFfy4vmEP6XPM32KJtLY= X-Google-Smtp-Source: ADFU+vuXOacpWFsCMPVgcJMEQzxzLLG4GVYWfMGe4lcRG/Xq8SpCCjhRP4HQ1iF/tf8P8UOdWjsvhVyuUmS+YQ4Sb3c= X-Received: by 2002:a62:507:: with SMTP id 7mr1053924pff.222.1584577934761; Wed, 18 Mar 2020 17:32:14 -0700 (PDT) MIME-Version: 1.0 X-Google-Sender-Delegation: usman.ansari@gmail.com From: Usman Ansari Date: Wed, 18 Mar 2020 17:32:03 -0700 X-Google-Sender-Auth: GvZQm1gM1lo0XSFSNbtmPRYOtrI Message-ID: To: "" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [ovs-dev] [PATCH] hmap.h: Fix Coverity false positive X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Suggested-by: Ben Pfaff Coverity reports a false positive below: Incorrect expression, Assign_where_compare_meant: use of "=" where "==" may have been intended. Fixed it by rewriting '(NODE = NULL)' as '((NODE = NULL), false)'. "make check" passes for this change Coverity reports 80 errors resolved Signed-off-by: Usman Ansari --- include/openvswitch/hmap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) MEMBER)) #define HMAP_FOR_EACH_IN_BUCKET(NODE, MEMBER, HASH, HMAP) \ diff --git a/include/openvswitch/hmap.h b/include/openvswitch/hmap.h index 8aea9c2..f48359f 100644 --- a/include/openvswitch/hmap.h +++ b/include/openvswitch/hmap.h @@ -136,7 +136,7 @@ struct hmap_node *hmap_random_node(const struct hmap *); */ #define HMAP_FOR_EACH_WITH_HASH(NODE, MEMBER, HASH, HMAP) \ for (INIT_CONTAINER(NODE, hmap_first_with_hash(HMAP, HASH), MEMBER); \ - (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || (NODE = NULL); \ + (NODE != OBJECT_CONTAINING(NULL, NODE, MEMBER)) || ((NODE = NULL), false); \ ASSIGN_CONTAINER(NODE, hmap_next_with_hash(&(NODE)->MEMBER), \