lkml.org 
[lkml]   [2021]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2] remoteproc: use %pe format string to print return error code
Hi Mark,

On Tue, 2 Nov 2021 at 08:15, Mark-PK Tsai <mark-pk.tsai@mediatek.com> wrote:
>
> Use %pe format string to print return error code which
> make the error message easier to understand.
>
> Signed-off-by: Mark-PK Tsai <mark-pk.tsai@mediatek.com>
> ---
> drivers/remoteproc/remoteproc_core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 502b6604b757..2242da320368 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -575,8 +575,8 @@ static int rproc_handle_vdev(struct rproc *rproc, void *ptr,
> dma_get_mask(rproc->dev.parent));
> if (ret) {
> dev_warn(dev,
> - "Failed to set DMA mask %llx. Trying to continue... %x\n",
> - dma_get_mask(rproc->dev.parent), ret);
> + "Failed to set DMA mask %llx. Trying to continue... (%pe)\n",
> + dma_get_mask(rproc->dev.parent), ERR_PTR(ret));

Macro ERR_PTR() is used to convert error codes to pointer type when
returning from a function - I fail to see how doing so in a dev_warn()
context can make the message easier to understand. Can you provide an
example?

Thanks,
Mathieu

> }
>
> /* parse the vrings */
> --
> 2.18.0
>

\
 
 \ /
  Last update: 2021-11-11 19:19    [W:0.090 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site