public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: EC: add leading zeros to debug messages
@ 2008-01-17  7:25 Németh Márton
  2008-01-17 11:56 ` Alexey Starikovskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Németh Márton @ 2008-01-17  7:25 UTC (permalink / raw)
  To: Alexey Starikovskiy; +Cc: linux-kernel

From: Márton Németh <nm127@freemail.hu>

Add leading zeros to pr_debug() calls. For example if x=0x0a, the format
"0x%2x" will result the string "0x a", the format "0x%2.2x" will result "0x0a".

Signed-off-by: Márton Németh <nm127@freemail.hu>
---
--- linux-2.6.24-rc8/drivers/acpi/ec.c.orig	2008-01-16 07:25:33.000000000 +0100
+++ linux-2.6.24-rc8/drivers/acpi/ec.c	2008-01-17 07:15:10.000000000 +0100
@@ -138,26 +138,26 @@ static struct acpi_ec {
 static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
 {
 	u8 x = inb(ec->command_addr);
-	pr_debug(PREFIX "---> status = 0x%2x\n", x);
+	pr_debug(PREFIX "---> status = 0x%2.2x\n", x);
 	return x;
 }

 static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
 {
 	u8 x = inb(ec->data_addr);
-	pr_debug(PREFIX "---> data = 0x%2x\n", x);
+	pr_debug(PREFIX "---> data = 0x%2.2x\n", x);
 	return inb(ec->data_addr);
 }

 static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
 {
-	pr_debug(PREFIX "<--- command = 0x%2x\n", command);
+	pr_debug(PREFIX "<--- command = 0x%2.2x\n", command);
 	outb(command, ec->command_addr);
 }

 static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
 {
-	pr_debug(PREFIX "<--- data = 0x%2x\n", data);
+	pr_debug(PREFIX "<--- data = 0x%2.2x\n", data);
 	outb(data, ec->data_addr);
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI: EC: add leading zeros to debug messages
  2008-01-17  7:25 [PATCH] ACPI: EC: add leading zeros to debug messages Németh Márton
@ 2008-01-17 11:56 ` Alexey Starikovskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Starikovskiy @ 2008-01-17 11:56 UTC (permalink / raw)
  To: Németh Márton; +Cc: linux-kernel

Marton,
Could you please attach these patches to bug report? It is easier to track them there.

Thanks,
Alex.

Németh Márton wrote:
> From: Márton Németh <nm127@freemail.hu>
> 
> Add leading zeros to pr_debug() calls. For example if x=0x0a, the format
> "0x%2x" will result the string "0x a", the format "0x%2.2x" will result "0x0a".
> 
> Signed-off-by: Márton Németh <nm127@freemail.hu>
> ---
> --- linux-2.6.24-rc8/drivers/acpi/ec.c.orig	2008-01-16 07:25:33.000000000 +0100
> +++ linux-2.6.24-rc8/drivers/acpi/ec.c	2008-01-17 07:15:10.000000000 +0100
> @@ -138,26 +138,26 @@ static struct acpi_ec {
>  static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
>  {
>  	u8 x = inb(ec->command_addr);
> -	pr_debug(PREFIX "---> status = 0x%2x\n", x);
> +	pr_debug(PREFIX "---> status = 0x%2.2x\n", x);
>  	return x;
>  }
> 
>  static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
>  {
>  	u8 x = inb(ec->data_addr);
> -	pr_debug(PREFIX "---> data = 0x%2x\n", x);
> +	pr_debug(PREFIX "---> data = 0x%2.2x\n", x);
>  	return inb(ec->data_addr);
>  }
> 
>  static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
>  {
> -	pr_debug(PREFIX "<--- command = 0x%2x\n", command);
> +	pr_debug(PREFIX "<--- command = 0x%2.2x\n", command);
>  	outb(command, ec->command_addr);
>  }
> 
>  static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
>  {
> -	pr_debug(PREFIX "<--- data = 0x%2x\n", data);
> +	pr_debug(PREFIX "<--- data = 0x%2.2x\n", data);
>  	outb(data, ec->data_addr);
>  }
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-17 11:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17  7:25 [PATCH] ACPI: EC: add leading zeros to debug messages Németh Márton
2008-01-17 11:56 ` Alexey Starikovskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox