diff mbox series

remoteproc: use %d format string to print return error code

Message ID 20211102120805.27137-1-mark-pk.tsai@mediatek.com (mailing list archive)
State Superseded
Headers show
Series remoteproc: use %d format string to print return error code | expand

Commit Message

Mark-PK Tsai (蔡沛剛) Nov. 2, 2021, 12:08 p.m. UTC
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(-)

Comments

Russell King (Oracle) Nov. 2, 2021, 12:11 p.m. UTC | #1
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!
Mark-PK Tsai (蔡沛剛) Nov. 2, 2021, 2:04 p.m. UTC | #2
> 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.
diff mbox series

Patch

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);
 	}