From: YueHaibing <yuehaibing@huawei.com>
To: <davem@davemloft.net>, <maxime.chevallier@bootlin.com>,
<antoine.tenart@bootlin.com>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
YueHaibing <yuehaibing@huawei.com>
Subject: [PATCH v2 net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins
Date: Wed, 29 May 2019 10:59:06 +0800 [thread overview]
Message-ID: <20190529025906.17452-1-yuehaibing@huawei.com> (raw)
In-Reply-To: <20190527134646.21804-1-yuehaibing@huawei.com>
Fix smatch warning:
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c:1236
mvpp2_ethtool_cls_rule_ins() warn: unsigned 'info->fs.location' is never less than zero.
'info->fs.location' is u32 type, never less than zero.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: rework patch based net-next
---
drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
index bd19a910dc90..e1c90adb2982 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -1300,8 +1300,7 @@ int mvpp2_ethtool_cls_rule_ins(struct mvpp2_port *port,
struct mvpp2_ethtool_fs *efs, *old_efs;
int ret = 0;
- if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW ||
- info->fs.location < 0)
+ if (info->fs.location >= MVPP2_N_RFS_ENTRIES_PER_FLOW)
return -EINVAL;
efs = kzalloc(sizeof(*efs), GFP_KERNEL);
--
2.20.1
next prev parent reply other threads:[~2019-05-29 3:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-27 13:46 [PATCH net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins YueHaibing
2019-05-29 0:10 ` David Miller
2019-05-29 2:59 ` YueHaibing [this message]
2019-05-30 18:47 ` [PATCH v2 " 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=20190529025906.17452-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=antoine.tenart@bootlin.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.chevallier@bootlin.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).