All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Kishon Vijay Abraham I <kishon@ti.com>
Cc: linux-kernel@vger.kernel.org, Vinod Koul <vkoul@kernel.org>,
	Loc Ho <lho@apm.com>
Subject: [PATCH 3/6] phy: xgene: remove unsigned integer comparison with less than zero
Date: Wed,  8 Jul 2020 18:58:06 +0530	[thread overview]
Message-ID: <20200708132809.265967-3-vkoul@kernel.org> (raw)
In-Reply-To: <20200708132809.265967-1-vkoul@kernel.org>

We get warning with W=1 build:
drivers/phy/phy-xgene.c: In function ‘xgene_phy_xlate’:
drivers/phy/phy-xgene.c:1618:20: warning: comparison of unsigned
expression in ‘< 0’ is always false [-Wtype-limits]
 1618 |  if (args->args[0] < MODE_SATA || args->args[0] >= MODE_MAX) |

args is uint32_t so can never be less than zero, so remove this check

Cc: Loc Ho <lho@apm.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
---
 drivers/phy/phy-xgene.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/phy/phy-xgene.c b/drivers/phy/phy-xgene.c
index 7a33ec12f71b..b88922e7de1d 100644
--- a/drivers/phy/phy-xgene.c
+++ b/drivers/phy/phy-xgene.c
@@ -1615,7 +1615,7 @@ static struct phy *xgene_phy_xlate(struct device *dev,
 
 	if (args->args_count <= 0)
 		return ERR_PTR(-EINVAL);
-	if (args->args[0] < MODE_SATA || args->args[0] >= MODE_MAX)
+	if (args->args[0] >= MODE_MAX)
 		return ERR_PTR(-EINVAL);
 
 	ctx->mode = args->args[0];
-- 
2.26.2


  parent reply	other threads:[~2020-07-08 13:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 13:28 [PATCH 1/6] phy-mvebu-a3700-utmi: correct typo in struct mvebu_a3700_utmi comments Vinod Koul
2020-07-08 13:28 ` [PATCH 2/6] phy: mapphone-mdm6600: Add missing description for some structure fields Vinod Koul
2020-07-08 13:28 ` Vinod Koul [this message]
2020-07-08 13:28 ` [PATCH 4/6] phy: rockchip-typec: use correct format for structure description Vinod Koul
2020-07-08 13:28 ` [PATCH 5/6] phy: exynos5-usbdrd: " Vinod Koul
2020-07-09  7:13   ` Marek Szyprowski
2020-07-08 13:28 ` [PATCH 6/6] phy: stm32: use NULL instead of zero Vinod Koul
2020-07-08 13:35   ` Amelie DELAUNAY
2020-07-13  6:46 ` [PATCH 1/6] phy-mvebu-a3700-utmi: correct typo in struct mvebu_a3700_utmi comments Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200708132809.265967-3-vkoul@kernel.org \
    --to=vkoul@kernel.org \
    --cc=kishon@ti.com \
    --cc=lho@apm.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.