diff mbox series

[2/2] kernel: sched: print errors with %pe for better readability of logs

Message ID 20240206051120.4173475-2-onkarnath.1@samsung.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [1/2] drivers: acpi: use %pe for better readability of errors while printing | expand

Commit Message

Onkarnarth Feb. 6, 2024, 5:11 a.m. UTC
From: Onkarnath <onkarnath.1@samsung.com>

instead of printing errros as a number(%ld), it's better to print in string
format for better readability of logs.

Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
---
 kernel/sched/cpufreq_schedutil.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stanislaw Gruszka Feb. 6, 2024, 9:23 a.m. UTC | #1
On Tue, Feb 06, 2024 at 10:41:20AM +0530, Onkarnarth wrote:
> From: Onkarnath <onkarnath.1@samsung.com>
> 
> instead of printing errros as a number(%ld), it's better to print in string
> format for better readability of logs.
> 
> Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

> ---
>  kernel/sched/cpufreq_schedutil.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index eece6244f9d2..2c42eaa56fa3 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -671,7 +671,7 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
>  				"sugov:%d",
>  				cpumask_first(policy->related_cpus));
>  	if (IS_ERR(thread)) {
> -		pr_err("failed to create sugov thread: %ld\n", PTR_ERR(thread));
> +		pr_err("failed to create sugov thread: %pe\n", thread);
>  		return PTR_ERR(thread);
>  	}
>  
> -- 
> 2.25.1
> 
>
Valentin Schneider Feb. 6, 2024, 9:48 a.m. UTC | #2
On 06/02/24 10:41, Onkarnarth wrote:
> From: Onkarnath <onkarnath.1@samsung.com>
>
> instead of printing errros as a number(%ld), it's better to print in string
> format for better readability of logs.
>
> Signed-off-by: Onkarnath <onkarnath.1@samsung.com>

I quick ripgrep tells me this is the only culprit in sched, so:

Reviewed-by: Valentin Schneider <vschneid@redhat.com>
diff mbox series

Patch

diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
index eece6244f9d2..2c42eaa56fa3 100644
--- a/kernel/sched/cpufreq_schedutil.c
+++ b/kernel/sched/cpufreq_schedutil.c
@@ -671,7 +671,7 @@  static int sugov_kthread_create(struct sugov_policy *sg_policy)
 				"sugov:%d",
 				cpumask_first(policy->related_cpus));
 	if (IS_ERR(thread)) {
-		pr_err("failed to create sugov thread: %ld\n", PTR_ERR(thread));
+		pr_err("failed to create sugov thread: %pe\n", thread);
 		return PTR_ERR(thread);
 	}