[PATCH] RDMA/ipoib: print symbolic error name instead of error code

Christian Heusel posted 1 patch 1 year, 11 months ago
drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] RDMA/ipoib: print symbolic error name instead of error code
Posted by Christian Heusel 1 year, 11 months ago
Utilize the %pe print specifier to get the symbolic error name as a
string (i.e "-ENOMEM") in the log message instead of the error code to
increase its readablility.

This change was suggested in
https://lore.kernel.org/all/92972476-0b1f-4d0a-9951-af3fc8bc6e65@suswa.mountain/

Signed-off-by: Christian Heusel <christian@heusel.eu>
---
 drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index 5b3154503bf4..b9cb2cc6ebf0 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -287,8 +287,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
 
 	ah = ipoib_create_ah(dev, priv->pd, &av);
 	if (IS_ERR(ah)) {
-		ipoib_warn(priv, "ib_address_create failed %ld\n",
-			   -PTR_ERR(ah));
+		ipoib_warn(priv, "ib_address_create failed %pe\n", ah);
 		/* use original error */
 		return PTR_ERR(ah);
 	}
-- 
2.43.0
Re: [PATCH] RDMA/ipoib: print symbolic error name instead of error code
Posted by Leon Romanovsky 1 year, 11 months ago
On Thu, 11 Jan 2024 15:13:07 +0100, Christian Heusel wrote:
> Utilize the %pe print specifier to get the symbolic error name as a
> string (i.e "-ENOMEM") in the log message instead of the error code to
> increase its readablility.
> 
> This change was suggested in
> https://lore.kernel.org/all/92972476-0b1f-4d0a-9951-af3fc8bc6e65@suswa.mountain/
> 
> [...]

Applied, thanks!

[1/1] RDMA/ipoib: print symbolic error name instead of error code
      https://git.kernel.org/rdma/rdma/c/64854534ff9664

Best regards,
-- 
Leon Romanovsky <leon@kernel.org>
Re: [PATCH] RDMA/ipoib: print symbolic error name instead of error code
Posted by Dan Carpenter 1 year, 11 months ago
On Thu, Jan 11, 2024 at 03:13:07PM +0100, Christian Heusel wrote:
> Utilize the %pe print specifier to get the symbolic error name as a
> string (i.e "-ENOMEM") in the log message instead of the error code to
> increase its readablility.
> 
> This change was suggested in
> https://lore.kernel.org/all/92972476-0b1f-4d0a-9951-af3fc8bc6e65@suswa.mountain/
> 
> Signed-off-by: Christian Heusel <christian@heusel.eu>

Thanks!

Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>

regards,
dan carpenter