LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins
@ 2019-05-27 13:46 YueHaibing
  2019-05-29  0:10 ` David Miller
  2019-05-29  2:59 ` [PATCH v2 " YueHaibing
  0 siblings, 2 replies; 4+ messages in thread
From: YueHaibing @ 2019-05-27 13:46 UTC (permalink / raw)
  To: davem, maxime.chevallier, antoine.tenart; +Cc: linux-kernel, netdev, YueHaibing

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>
---
 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 a57d17ab91f0..914b93f27469 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_cls.c
@@ -1232,8 +1232,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 >= 4 ||
-	    info->fs.location < 0)
+	if (info->fs.location >= 4)
 		return -EINVAL;
 
 	efs = kzalloc(sizeof(*efs), GFP_KERNEL);
-- 
2.17.1



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins
  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 ` [PATCH v2 " YueHaibing
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-29  0:10 UTC (permalink / raw)
  To: yuehaibing; +Cc: maxime.chevallier, antoine.tenart, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Mon, 27 May 2019 21:46:46 +0800

> 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>

This doesn't apply to net-next.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2 net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins
  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
  2019-05-30 18:47   ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: YueHaibing @ 2019-05-29  2:59 UTC (permalink / raw)
  To: davem, maxime.chevallier, antoine.tenart; +Cc: linux-kernel, netdev, YueHaibing

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2 net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins
  2019-05-29  2:59 ` [PATCH v2 " YueHaibing
@ 2019-05-30 18:47   ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-05-30 18:47 UTC (permalink / raw)
  To: yuehaibing; +Cc: maxime.chevallier, antoine.tenart, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 29 May 2019 10:59:06 +0800

> 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

Applied.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-30 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH v2 " YueHaibing
2019-05-30 18:47   ` David Miller

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).