Message ID | 20190527134646.21804-1-yuehaibing@huawei.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | [net-next] net: mvpp2: cls: Remove unnessesary check in mvpp2_ethtool_cls_rule_ins | expand |
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.
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);
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(-)