From patchwork Wed Jul 31 08:04:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramon Fried X-Patchwork-Id: 1139562 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; 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="YC+iqykL"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 45z5ZQ482Lz9sML for ; Wed, 31 Jul 2019 18:05:16 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 47BDCC21E34; Wed, 31 Jul 2019 08:05:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C4229C21D9A; Wed, 31 Jul 2019 08:05:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 229D1C21D9A; Wed, 31 Jul 2019 08:05:03 +0000 (UTC) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by lists.denx.de (Postfix) with ESMTPS id 6E946C21D8A for ; Wed, 31 Jul 2019 08:05:02 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id o13so31532857pgp.12 for ; Wed, 31 Jul 2019 01:05:02 -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:mime-version :content-transfer-encoding; bh=AT2lOt7Ruiht77gkN5MBFUbhri4fY9iDaDIrbQKX5pE=; b=YC+iqykLCM3Jl80VDfvM3Vh5YaCUHBHXA6AaJ9QAKf6DuQgnHE8eHwS+bE5pLx6lVo cFrZR8qdwQBo/rM7IbrbLVznIcyZV2unj0IH+HtoEN5KUKFeeVe8TkJkZW3PtId4xLp4 Rh+jO+AEr7kNRHqx81v2MxhkhDMdehydwYhve+iRbdlhjE9GL+J+eyGPuqnfZ6z3gfUv x8pqjLR7Qyiwt7SHGAs5Ac9zHkvf16T6tOIeDXPMNWHAjoLGuPUugF8iGFYy3aXhm1/o wujp35z515nxzBEuSlnTfIrfLFOcgaT++n8joEyYOH6sfOpBd3NFSWV8tvJWwFeLALHv uPQg== 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:mime-version :content-transfer-encoding; bh=AT2lOt7Ruiht77gkN5MBFUbhri4fY9iDaDIrbQKX5pE=; b=CZ19ZykSTmnSinpCmIkPHNPE3XvhqRiWd0o1HnAdfApw2IoE9JrbOoVrQCxu0ui5Eo FlunJx7eN8kZ8aqhuDc2nizKjthxdI1jm0pWkFYAPJbX+hvs6EvRwBFtZUgKcmXfcoPp iY8qfrlFTfY5RT1jN0ACzzed59UcvwsxoLAORH+CmHct8+v3cSlx3oXtYCHNYuernABM 9A0lg9/vCJexWmSUmYrdOhQiiRc4DSPg5cbimgbNv8Zk7TShBvdpNJui+4LZdZbIiV3K fPdbBpyDVhIuvlESLZGuDH7We959MSglYW4P75L9ub+TZFfaGo3k3e5tEtOeexyND3MI 33mw== X-Gm-Message-State: APjAAAXUbxK97iNGuzr0IA95aRiMDb4jLQlfRYBegYP5po9pgbQ0MfAg BsHoV+sUvl/dOdY/I4Tx18g= X-Google-Smtp-Source: APXvYqwJUnnPBcmh+iM1BxO+O4/ipTG8caccT0On4DCV0Xu98iE83HVm4fb9N5m9AZcGhFGy3D4ZRw== X-Received: by 2002:a17:90a:36e4:: with SMTP id t91mr1593241pjb.22.1564560300645; Wed, 31 Jul 2019 01:05:00 -0700 (PDT) Received: from rfried-mobl1.iil.intel.com ([192.55.54.40]) by smtp.gmail.com with ESMTPSA id j5sm58742898pgp.59.2019.07.31.01.04.58 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 01:05:00 -0700 (PDT) From: Ramon Fried To: trini@konsulko.com, u-boot@lists.denx.de Date: Wed, 31 Jul 2019 11:04:26 +0300 Message-Id: <20190731080426.13514-1-rfried.dev@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [U-Boot] [PATCH] pci_ep: Fix Coverity warning X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Fix the following Coverity warning: CID 244086: Incorrect expression (BAD_COMPARE) Comparing pointer "ep_bar" against NULL using anything besides == or is likely to be incorrect. Fixes: 914026d25848 ("drivers: pci_ep: Introduce UCLASS_PCI_EP uclass") Signed-off-by: Ramon Fried --- drivers/pci_endpoint/pci_ep-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci_endpoint/pci_ep-uclass.c b/drivers/pci_endpoint/pci_ep-uclass.c index 2f9c70398d..9f53a9a9b9 100644 --- a/drivers/pci_endpoint/pci_ep-uclass.c +++ b/drivers/pci_endpoint/pci_ep-uclass.c @@ -43,7 +43,7 @@ int pci_ep_set_bar(struct udevice *dev, uint func_no, struct pci_bar *ep_bar) int flags = ep_bar->flags; /* Some basic bar validity checks */ - if (ep_bar->barno > BAR_5 || ep_bar < BAR_0) + if (ep_bar->barno > BAR_5 || ep_bar->barno < BAR_0) return -EINVAL; if ((ep_bar->barno == BAR_5 &&