[1/2] drivers: acpi: use %pe for better readability of errors while printing

Message ID 20240206051120.4173475-1-onkarnath.1@samsung.com
State New
Headers
Series [1/2] drivers: acpi: use %pe for better readability of errors while printing |

Commit Message

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

As %pe is already introduced, its better to use it inplace of (%ld) for
printing errors in logs. It would enhance redability of logs.

Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
---
 drivers/acpi/acpi_processor.c | 2 +-
 drivers/acpi/acpi_watchdog.c  | 2 +-
 drivers/acpi/pci_slot.c       | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
  

Comments

Stanislaw Gruszka Feb. 6, 2024, 9:22 a.m. UTC | #1
On Tue, Feb 06, 2024 at 10:41:19AM +0530, Onkarnarth wrote:
> From: Onkarnath <onkarnath.1@samsung.com>
> 
> As %pe is already introduced, its better to use it inplace of (%ld) for
> printing errors in logs. It would enhance redability of logs.
> 
> Signed-off-by: Maninder Singh <maninder1.s@samsung.com>
> Signed-off-by: Onkarnath <onkarnath.1@samsung.com>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>

> ---
>  drivers/acpi/acpi_processor.c | 2 +-
>  drivers/acpi/acpi_watchdog.c  | 2 +-
>  drivers/acpi/pci_slot.c       | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
> index 4fe2ef54088c..2ddd36a21850 100644
> --- a/drivers/acpi/acpi_processor.c
> +++ b/drivers/acpi/acpi_processor.c
> @@ -161,7 +161,7 @@ static void cpufreq_add_device(const char *name)
>  
>  	pdev = platform_device_register_simple(name, PLATFORM_DEVID_NONE, NULL, 0);
>  	if (IS_ERR(pdev))
> -		pr_info("%s device creation failed: %ld\n", name, PTR_ERR(pdev));
> +		pr_info("%s device creation failed: %pe\n", name, pdev);
>  }
>  
>  #ifdef CONFIG_X86
> diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c
> index 8e9e001da38f..14b24157799c 100644
> --- a/drivers/acpi/acpi_watchdog.c
> +++ b/drivers/acpi/acpi_watchdog.c
> @@ -179,7 +179,7 @@ void __init acpi_watchdog_init(void)
>  	pdev = platform_device_register_simple("wdat_wdt", PLATFORM_DEVID_NONE,
>  					       resources, nresources);
>  	if (IS_ERR(pdev))
> -		pr_err("Device creation failed: %ld\n", PTR_ERR(pdev));
> +		pr_err("Device creation failed: %pe\n", pdev);
>  
>  	kfree(resources);
>  
> diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
> index d6cb2c27a23b..741bcc9d6d6a 100644
> --- a/drivers/acpi/pci_slot.c
> +++ b/drivers/acpi/pci_slot.c
> @@ -111,7 +111,7 @@ register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
>  	snprintf(name, sizeof(name), "%llu", sun);
>  	pci_slot = pci_create_slot(pci_bus, device, name, NULL);
>  	if (IS_ERR(pci_slot)) {
> -		pr_err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
> +		pr_err("pci_create_slot returned %pe\n", pci_slot);
>  		kfree(slot);
>  		return AE_OK;
>  	}
> -- 
> 2.25.1
> 
>
  
Bjorn Helgaas Feb. 6, 2024, 3:32 p.m. UTC | #2
On Tue, Feb 06, 2024 at 10:41:19AM +0530, Onkarnarth wrote:
> From: Onkarnath <onkarnath.1@samsung.com>
> 
> As %pe is already introduced, its better to use it inplace of (%ld) for
> printing errors in logs. It would enhance redability of logs.

s/its/it's/
s/inplace/in place/
s/redability/readability/

In the subject line, run "git log --oneline drivers/acpi" and pick
something that fits with the history instead of just encoding the file
path.  Same for the sched patch.

Bjorn
  

Patch

diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
index 4fe2ef54088c..2ddd36a21850 100644
--- a/drivers/acpi/acpi_processor.c
+++ b/drivers/acpi/acpi_processor.c
@@ -161,7 +161,7 @@  static void cpufreq_add_device(const char *name)
 
 	pdev = platform_device_register_simple(name, PLATFORM_DEVID_NONE, NULL, 0);
 	if (IS_ERR(pdev))
-		pr_info("%s device creation failed: %ld\n", name, PTR_ERR(pdev));
+		pr_info("%s device creation failed: %pe\n", name, pdev);
 }
 
 #ifdef CONFIG_X86
diff --git a/drivers/acpi/acpi_watchdog.c b/drivers/acpi/acpi_watchdog.c
index 8e9e001da38f..14b24157799c 100644
--- a/drivers/acpi/acpi_watchdog.c
+++ b/drivers/acpi/acpi_watchdog.c
@@ -179,7 +179,7 @@  void __init acpi_watchdog_init(void)
 	pdev = platform_device_register_simple("wdat_wdt", PLATFORM_DEVID_NONE,
 					       resources, nresources);
 	if (IS_ERR(pdev))
-		pr_err("Device creation failed: %ld\n", PTR_ERR(pdev));
+		pr_err("Device creation failed: %pe\n", pdev);
 
 	kfree(resources);
 
diff --git a/drivers/acpi/pci_slot.c b/drivers/acpi/pci_slot.c
index d6cb2c27a23b..741bcc9d6d6a 100644
--- a/drivers/acpi/pci_slot.c
+++ b/drivers/acpi/pci_slot.c
@@ -111,7 +111,7 @@  register_slot(acpi_handle handle, u32 lvl, void *context, void **rv)
 	snprintf(name, sizeof(name), "%llu", sun);
 	pci_slot = pci_create_slot(pci_bus, device, name, NULL);
 	if (IS_ERR(pci_slot)) {
-		pr_err("pci_create_slot returned %ld\n", PTR_ERR(pci_slot));
+		pr_err("pci_create_slot returned %pe\n", pci_slot);
 		kfree(slot);
 		return AE_OK;
 	}