linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: imx_rproc: Simplify some error message
@ 2022-08-05 22:02 Christophe JAILLET
  2022-08-23 19:22 ` Mathieu Poirier
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-08-05 22:02 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Peng Fan,
	Richard Zhu
  Cc: linux-kernel, kernel-janitors, Christophe JAILLET,
	Mathieu Poirier, linux-remoteproc, linux-arm-kernel

dev_err_probe() already prints the error code in a human readable way, so
there is no need to duplicate it as a numerical value at the end of the
message.

While at it, remove 'ret' that is mostly useless.

Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/remoteproc/imx_rproc.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 38383e7de3c1..7cc4fd207e2d 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -646,7 +646,6 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc)
 	struct imx_rproc *priv = rproc->priv;
 	struct device *dev = priv->dev;
 	struct mbox_client *cl;
-	int ret;
 
 	if (!of_get_property(dev->of_node, "mbox-names", NULL))
 		return 0;
@@ -659,18 +658,15 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc)
 	cl->rx_callback = imx_rproc_rx_callback;
 
 	priv->tx_ch = mbox_request_channel_byname(cl, "tx");
-	if (IS_ERR(priv->tx_ch)) {
-		ret = PTR_ERR(priv->tx_ch);
-		return dev_err_probe(cl->dev, ret,
-				     "failed to request tx mailbox channel: %d\n", ret);
-	}
+	if (IS_ERR(priv->tx_ch))
+		return dev_err_probe(cl->dev, PTR_ERR(priv->tx_ch),
+				     "failed to request tx mailbox channel\n");
 
 	priv->rx_ch = mbox_request_channel_byname(cl, "rx");
 	if (IS_ERR(priv->rx_ch)) {
 		mbox_free_channel(priv->tx_ch);
-		ret = PTR_ERR(priv->rx_ch);
-		return dev_err_probe(cl->dev, ret,
-				     "failed to request rx mailbox channel: %d\n", ret);
+		return dev_err_probe(cl->dev, PTR_ERR(priv->rx_ch),
+				     "failed to request rx mailbox channel\n");
 	}
 
 	return 0;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] remoteproc: imx_rproc: Simplify some error message
  2022-08-05 22:02 [PATCH] remoteproc: imx_rproc: Simplify some error message Christophe JAILLET
@ 2022-08-23 19:22 ` Mathieu Poirier
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Poirier @ 2022-08-23 19:22 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Bjorn Andersson, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team, Peng Fan,
	Richard Zhu, linux-kernel, kernel-janitors, Mathieu Poirier,
	linux-remoteproc, linux-arm-kernel

On Sat, Aug 06, 2022 at 12:02:32AM +0200, Christophe JAILLET wrote:
> dev_err_probe() already prints the error code in a human readable way, so
> there is no need to duplicate it as a numerical value at the end of the
> message.
> 
> While at it, remove 'ret' that is mostly useless.
> 
> Fixes: 2df7062002d0 ("remoteproc: imx_proc: enable virtio/mailbox")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>  drivers/remoteproc/imx_rproc.c | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
>

Applied.

Thanks,
Mathieu

> diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
> index 38383e7de3c1..7cc4fd207e2d 100644
> --- a/drivers/remoteproc/imx_rproc.c
> +++ b/drivers/remoteproc/imx_rproc.c
> @@ -646,7 +646,6 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc)
>  	struct imx_rproc *priv = rproc->priv;
>  	struct device *dev = priv->dev;
>  	struct mbox_client *cl;
> -	int ret;
>  
>  	if (!of_get_property(dev->of_node, "mbox-names", NULL))
>  		return 0;
> @@ -659,18 +658,15 @@ static int imx_rproc_xtr_mbox_init(struct rproc *rproc)
>  	cl->rx_callback = imx_rproc_rx_callback;
>  
>  	priv->tx_ch = mbox_request_channel_byname(cl, "tx");
> -	if (IS_ERR(priv->tx_ch)) {
> -		ret = PTR_ERR(priv->tx_ch);
> -		return dev_err_probe(cl->dev, ret,
> -				     "failed to request tx mailbox channel: %d\n", ret);
> -	}
> +	if (IS_ERR(priv->tx_ch))
> +		return dev_err_probe(cl->dev, PTR_ERR(priv->tx_ch),
> +				     "failed to request tx mailbox channel\n");
>  
>  	priv->rx_ch = mbox_request_channel_byname(cl, "rx");
>  	if (IS_ERR(priv->rx_ch)) {
>  		mbox_free_channel(priv->tx_ch);
> -		ret = PTR_ERR(priv->rx_ch);
> -		return dev_err_probe(cl->dev, ret,
> -				     "failed to request rx mailbox channel: %d\n", ret);
> +		return dev_err_probe(cl->dev, PTR_ERR(priv->rx_ch),
> +				     "failed to request rx mailbox channel\n");
>  	}
>  
>  	return 0;
> -- 
> 2.34.1
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2022-08-23 19:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05 22:02 [PATCH] remoteproc: imx_rproc: Simplify some error message Christophe JAILLET
2022-08-23 19:22 ` Mathieu Poirier

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