remoteproc: qcom: Use PTR_ERR_OR_ZERO() in glink prob
authorVasyl Gomonovych <gomonovych@gmail.com>
Tue, 28 Nov 2017 22:32:40 +0000 (23:32 +0100)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 28 Nov 2017 23:02:27 +0000 (15:02 -0800)
Fix ptr_ret.cocci warnings:
drivers/remoteproc/qcom_common.c:60:8-14: WARNING: PTR_ERR_OR_ZERO can be used

Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR

Generated by: scripts/coccinelle/api/ptr_ret.cocci

Signed-off-by: Vasyl Gomonovych <gomonovych@gmail.com>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
drivers/remoteproc/qcom_common.c

index d487040b528ba0509e58b4fc694e9da5991a23f7..e9b5f2a98c4dbfea4772085099de3e17c5b6d64e 100644 (file)
@@ -57,7 +57,7 @@ static int glink_subdev_probe(struct rproc_subdev *subdev)
 
        glink->edge = qcom_glink_smem_register(glink->dev, glink->node);
 
-       return IS_ERR(glink->edge) ? PTR_ERR(glink->edge) : 0;
+       return PTR_ERR_OR_ZERO(glink->edge);
 }
 
 static void glink_subdev_remove(struct rproc_subdev *subdev)