LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO()
@ 2018-08-08 12:29 YueHaibing
  2018-08-08 15:08 ` Ido Schimmel
  2018-08-09 21:14 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2018-08-08 12:29 UTC (permalink / raw)
  To: davem, jiri; +Cc: linux-kernel, netdev, idosch, YueHaibing

Fix ptr_ret.cocci warnings:
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c:543:1-3: WARNING: PTR_ERR_OR_ZERO can be used

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
index 8213cb7..ddcd508 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
@@ -540,10 +540,9 @@ int mlxsw_sp_flower_tmplt_create(struct mlxsw_sp *mlxsw_sp,
 					   f->common.chain_index,
 					   MLXSW_SP_ACL_PROFILE_FLOWER,
 					   &rulei.values.elusage);
-	if (IS_ERR(ruleset))
-		return PTR_ERR(ruleset);
+
 	/* keep the reference to the ruleset */
-	return 0;
+	return PTR_ERR_OR_ZERO(ruleset);
 }
 
 void mlxsw_sp_flower_tmplt_destroy(struct mlxsw_sp *mlxsw_sp,
-- 
2.7.0



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

* Re: [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO()
  2018-08-08 12:29 [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO() YueHaibing
@ 2018-08-08 15:08 ` Ido Schimmel
  2018-08-09 21:14 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Ido Schimmel @ 2018-08-08 15:08 UTC (permalink / raw)
  To: YueHaibing; +Cc: davem, jiri, linux-kernel, netdev

On Wed, Aug 08, 2018 at 08:29:08PM +0800, YueHaibing wrote:
> Fix ptr_ret.cocci warnings:
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c:543:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Reviewed-by: Ido Schimmel <idosch@mellanox.com>

Thanks!

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

* Re: [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO()
  2018-08-08 12:29 [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO() YueHaibing
  2018-08-08 15:08 ` Ido Schimmel
@ 2018-08-09 21:14 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2018-08-09 21:14 UTC (permalink / raw)
  To: yuehaibing; +Cc: jiri, linux-kernel, netdev, idosch

From: YueHaibing <yuehaibing@huawei.com>
Date: Wed, 8 Aug 2018 20:29:08 +0800

> Fix ptr_ret.cocci warnings:
>  drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c:543:1-3: WARNING: PTR_ERR_OR_ZERO can be used
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Applied.

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

end of thread, back to index

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-08 12:29 [PATCH net-next] mlxsw: spectrum_flower: use PTR_ERR_OR_ZERO() YueHaibing
2018-08-08 15:08 ` Ido Schimmel
2018-08-09 21:14 ` David Miller

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox