linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] remoteproc: use %d format string to print return error code
@ 2021-11-02 12:08 Mark-PK Tsai
  2021-11-02 12:11 ` Russell King (Oracle)
  0 siblings, 1 reply; 3+ messages in thread
From: Mark-PK Tsai @ 2021-11-02 12:08 UTC (permalink / raw)
  To: ohad, bjorn.andersson, mathieu.poirier
  Cc: matthias.bgg, linux-remoteproc, linux-kernel, linux-arm-kernel,
	linux-mediatek, mark-pk.tsai, yj.chiang

Use %d 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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 502b6604b757..c5cc7f30f06e 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -575,7 +575,7 @@ 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",
+			 "Failed to set DMA mask %llx. Trying to continue... %d\n",
 			 dma_get_mask(rproc->dev.parent), ret);
 	}
 
-- 
2.18.0


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

* Re: [PATCH] remoteproc: use %d format string to print return error code
  2021-11-02 12:08 [PATCH] remoteproc: use %d format string to print return error code Mark-PK Tsai
@ 2021-11-02 12:11 ` Russell King (Oracle)
  2021-11-02 14:04   ` Mark-PK Tsai
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King (Oracle) @ 2021-11-02 12:11 UTC (permalink / raw)
  To: Mark-PK Tsai
  Cc: ohad, bjorn.andersson, mathieu.poirier, matthias.bgg,
	linux-remoteproc, linux-kernel, linux-arm-kernel, linux-mediatek,
	yj.chiang

On Tue, Nov 02, 2021 at 08:08:05PM +0800, Mark-PK Tsai wrote:
> Use %d format string to print return error code which
> make the error message easier to understand.

Even better, if you use %pe after converting "ret" to a pointer via
ERR_PTR(ret), when the kernel is appropriately configured, the kernel
will give a textual version of the error code, which is even easier!

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

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

* Re: [PATCH] remoteproc: use %d format string to print return error code
  2021-11-02 12:11 ` Russell King (Oracle)
@ 2021-11-02 14:04   ` Mark-PK Tsai
  0 siblings, 0 replies; 3+ messages in thread
From: Mark-PK Tsai @ 2021-11-02 14:04 UTC (permalink / raw)
  To: linux
  Cc: bjorn.andersson, linux-arm-kernel, linux-kernel, linux-mediatek,
	linux-remoteproc, mark-pk.tsai, mathieu.poirier, matthias.bgg,
	ohad, yj.chiang

> On Tue, Nov 02, 2021 at 08:08:05PM +0800, Mark-PK Tsai wrote:
> > Use %d format string to print return error code which
> > make the error message easier to understand.
> 
> Even better, if you use %pe after converting "ret" to a pointer via
> ERR_PTR(ret), when the kernel is appropriately configured, the kernel
> will give a textual version of the error code, which is even easier!

Thanks for the suggestion!
I will use it in v2.

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

end of thread, other threads:[~2021-11-02 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-02 12:08 [PATCH] remoteproc: use %d format string to print return error code Mark-PK Tsai
2021-11-02 12:11 ` Russell King (Oracle)
2021-11-02 14:04   ` Mark-PK Tsai

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