提交 bd8460fa 编写于 作者: I Ioana Radulescu 提交者: David S. Miller

dpaa2-eth: Use PTR_ERR_OR_ZERO where appropriate

Use PTR_ERR_OR_ZERO instead of PTR_ERR in cases where
zero is a valid input. Reported by smatch.
Signed-off-by: NIoana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 5a20a093
...@@ -1972,7 +1972,7 @@ alloc_channel(struct dpaa2_eth_priv *priv) ...@@ -1972,7 +1972,7 @@ alloc_channel(struct dpaa2_eth_priv *priv)
channel->dpcon = setup_dpcon(priv); channel->dpcon = setup_dpcon(priv);
if (IS_ERR_OR_NULL(channel->dpcon)) { if (IS_ERR_OR_NULL(channel->dpcon)) {
err = PTR_ERR(channel->dpcon); err = PTR_ERR_OR_ZERO(channel->dpcon);
goto err_setup; goto err_setup;
} }
...@@ -2028,7 +2028,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv) ...@@ -2028,7 +2028,7 @@ static int setup_dpio(struct dpaa2_eth_priv *priv)
/* Try to allocate a channel */ /* Try to allocate a channel */
channel = alloc_channel(priv); channel = alloc_channel(priv);
if (IS_ERR_OR_NULL(channel)) { if (IS_ERR_OR_NULL(channel)) {
err = PTR_ERR(channel); err = PTR_ERR_OR_ZERO(channel);
if (err != -EPROBE_DEFER) if (err != -EPROBE_DEFER)
dev_info(dev, dev_info(dev,
"No affine channel for cpu %d and above\n", i); "No affine channel for cpu %d and above\n", i);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册