From: Dan Carpenter <dan.carpenter@oracle.com>
To: "David S. Miller" <davem@davemloft.net>, Moritz Fischer <mdf@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Alex Williams <alex.williams@ni.com>,
Luis Chamberlain <mcgrof@kernel.org>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH net] net: nixge: Fix a signedness bug in nixge_probe()
Date: Wed, 25 Sep 2019 11:05:24 +0000 [thread overview]
Message-ID: <20190925110524.GP3264@mwanda> (raw)
The "priv->phy_mode" is an enum and in this context GCC will treat it
as an unsigned int so it can never be less than zero.
Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/ni/nixge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c
index 0b384f97d2fd..2761f3a3ae50 100644
--- a/drivers/net/ethernet/ni/nixge.c
+++ b/drivers/net/ethernet/ni/nixge.c
@@ -1347,7 +1347,7 @@ static int nixge_probe(struct platform_device *pdev)
}
priv->phy_mode = of_get_phy_mode(pdev->dev.of_node);
- if (priv->phy_mode < 0) {
+ if ((int)priv->phy_mode < 0) {
netdev_err(ndev, "not find \"phy-mode\" property\n");
err = -EINVAL;
goto unregister_mdio;
--
2.20.1
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "David S. Miller" <davem@davemloft.net>, Moritz Fischer <mdf@kernel.org>
Cc: Andrew Lunn <andrew@lunn.ch>,
Alex Williams <alex.williams@ni.com>,
Luis Chamberlain <mcgrof@kernel.org>,
netdev@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [PATCH net] net: nixge: Fix a signedness bug in nixge_probe()
Date: Wed, 25 Sep 2019 14:05:24 +0300 [thread overview]
Message-ID: <20190925110524.GP3264@mwanda> (raw)
The "priv->phy_mode" is an enum and in this context GCC will treat it
as an unsigned int so it can never be less than zero.
Fixes: 492caffa8a1a ("net: ethernet: nixge: Add support for National Instruments XGE netdev")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
drivers/net/ethernet/ni/nixge.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ni/nixge.c b/drivers/net/ethernet/ni/nixge.c
index 0b384f97d2fd..2761f3a3ae50 100644
--- a/drivers/net/ethernet/ni/nixge.c
+++ b/drivers/net/ethernet/ni/nixge.c
@@ -1347,7 +1347,7 @@ static int nixge_probe(struct platform_device *pdev)
}
priv->phy_mode = of_get_phy_mode(pdev->dev.of_node);
- if (priv->phy_mode < 0) {
+ if ((int)priv->phy_mode < 0) {
netdev_err(ndev, "not find \"phy-mode\" property\n");
err = -EINVAL;
goto unregister_mdio;
--
2.20.1
next reply other threads:[~2019-09-25 11:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 11:05 Dan Carpenter [this message]
2019-09-25 11:05 ` [PATCH net] net: nixge: Fix a signedness bug in nixge_probe() Dan Carpenter
2019-09-27 8:21 ` David Miller
2019-09-27 8:21 ` David Miller
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=20190925110524.GP3264@mwanda \
--to=dan.carpenter@oracle.com \
--cc=alex.williams@ni.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=mdf@kernel.org \
--cc=netdev@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.