lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 12 Nov 2021 10:13:10 +0800
From:   Mark-PK Tsai <mark-pk.tsai@...iatek.com>
To:     <mathieu.poirier@...aro.org>
CC:     <bjorn.andersson@...aro.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>,
        <linux-remoteproc@...r.kernel.org>, <mark-pk.tsai@...iatek.com>,
        <matthias.bgg@...il.com>, <ohad@...ery.com>,
        <yj.chiang@...iatek.com>
Subject: Re: [PATCH v2] remoteproc: use %pe format string to print return error code

> Hi Mark,
>
>
> >
> > 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@...iatek.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?

Hi,

When dma_coerce_mask_and_coherent() fail, the output log will be as following.

format		log
%x		Trying to continue... fffffffb
%d		Trying to continue... -5
%pe		Trying to continue... -5	(if CONFIG_SYMBOLIC_ERRNAME is not set)
%pe		Trying to continue... -EIO	(if CONFIG_SYMBOLIC_ERRNAME=y)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ