kernel/power/swap: Use %pe to print PTR_ERR()
Subsystems (2)
PATCH 1/1 kernel/power/swap: Use %pe to print PTR_ERR()
Use %pe format specifier instead of %ld with PTR_ERR() to print error pointers as a symbolic error name (e.g. -ENOMEM) instead of a raw integer value.
Signed-off-by Ronan Marchal <[email protected]>
--- kernel/power/swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/power/swap.c +2 -2
@@ -746,7 +746,7 @@ static int save_compressed_image(struct swap_map_handle *handle, data[thr].cc =crypto_alloc_acomp (hib_comp_algo,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR_OR_NULL (data[thr].cc)) { -pr_err ("Could not allocate comp stream %ld\n" ,PTR_ERR (data[thr].cc)); +pr_err ("Could not allocate comp stream %pe\n" , data[thr].cc); ret = -EFAULT ; goto out_clean; }
@@ -1250,7 +1250,7 @@ static int load_compressed_image(struct swap_map_handle *handle, data[thr].cc =crypto_alloc_acomp (hib_comp_algo,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR_OR_NULL (data[thr].cc)) { -pr_err ("Could not allocate comp stream %ld\n" ,PTR_ERR (data[thr].cc)); +pr_err ("Could not allocate comp stream %pe\n" , data[thr].cc); ret = -EFAULT ; goto out_clean; }
Signature · 1 line
2.53.0
Quoted 24 lines · Ronan Marchal
Use %pe format specifier instead of %ld with
PTR_ERR()to print error pointers as a symbolic error name (e.g.-ENOMEM) instead of a raw integer value.Signed-off-by Ronan Marchal <[email protected]>--- kernel/power/swap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)kernel/power/swap.c +1
-1@@ -746,7 +746,7 @@ static int save_compressed_image(struct swap_map_handle *handle, data[thr].cc =crypto_alloc_acomp (hib_comp_algo,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR_OR_NULL (data[thr].cc)) { -pr_err ("Could not allocate comp stream %ld\n" ,PTR_ERR (data[thr].cc)); +pr_err ("Could not allocate comp stream %pe\n" , data[thr].cc); ret = -EFAULT ; goto out_clean; }
kernel/power/swap.c static int load_compressed_image(struct swap_map_handle *handle,
Quoted 9 lines
kernel/power/swap.c +1
-2@@ -1250,7 +1250,7 @@ static int load_compressed_image(struct swap_map_handle *handle, data[thr].cc =crypto_alloc_acomp (hib_comp_algo,0 ,CRYPTO_ALG_ASYNC );if (IS_ERR_OR_NULL (data[thr].cc)) { -pr_err ("Could not allocate comp stream %ld\n" ,PTR_ERR (data[thr].cc)); +pr_err ("Could not allocate comp stream %pe\n" , data[thr].cc); ret = -EFAULT ; goto out_clean; } --
Applied as 7.3 material (with a modified subject), thanks!