Patchwork acpi: acpidump: fix formatting of bit fields

login
register
mail settings
Submitter Colin King
Date Dec. 3, 2012, 9:42 p.m.
Message ID <1354570970-22310-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/203445/
State Accepted
Headers show

Comments

Colin King - Dec. 3, 2012, 9:42 p.m.
From: Colin Ian King <colin.king@canonical.com>

Integer bit fields are being formatted 1 char too narrow which looks
ugly.  Increase the field width by 1 char to make it align with other
fields.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/acpi/acpidump/acpidump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Keng-Yu Lin - Dec. 6, 2012, 7:28 a.m.
On Tue, Dec 4, 2012 at 5:42 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Integer bit fields are being formatted 1 char too narrow which looks
> ugly.  Increase the field width by 1 char to make it align with other
> fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/acpi/acpidump/acpidump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index d6b899d..435608c 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -144,7 +144,7 @@ static void acpi_dump_uint(fwts_framework *fw, fwts_acpidump_field *info, void *
>         case 8:
>                 if (info->bit_field_nbits) {
>                         hexdigits = (3+info->bit_field_nbits) / 4;
> -                       fwts_log_info_verbatum(fw, "%56.56s: 0x%*.*" PRIx64, info->label,
> +                       fwts_log_info_verbatum(fw, "%57.57s: 0x%*.*" PRIx64, info->label,
>                                 hexdigits, hexdigits, val);
>                 } else
>                         fwts_log_info_verbatum(fw, "%s 0x%*.*" PRIx64,
> --
> 1.8.0
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Alex Hung - Dec. 12, 2012, 8:05 a.m.
On 12/04/2012 05:42 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Integer bit fields are being formatted 1 char too narrow which looks
> ugly.  Increase the field width by 1 char to make it align with other
> fields.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/acpi/acpidump/acpidump.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
> index d6b899d..435608c 100644
> --- a/src/acpi/acpidump/acpidump.c
> +++ b/src/acpi/acpidump/acpidump.c
> @@ -144,7 +144,7 @@ static void acpi_dump_uint(fwts_framework *fw, fwts_acpidump_field *info, void *
>   	case 8:
>   		if (info->bit_field_nbits) {
>   			hexdigits = (3+info->bit_field_nbits) / 4;
> -			fwts_log_info_verbatum(fw, "%56.56s: 0x%*.*" PRIx64, info->label,
> +			fwts_log_info_verbatum(fw, "%57.57s: 0x%*.*" PRIx64, info->label,
>   				hexdigits, hexdigits, val);
>   		} else
>   			fwts_log_info_verbatum(fw, "%s 0x%*.*" PRIx64,
>
Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/acpi/acpidump/acpidump.c b/src/acpi/acpidump/acpidump.c
index d6b899d..435608c 100644
--- a/src/acpi/acpidump/acpidump.c
+++ b/src/acpi/acpidump/acpidump.c
@@ -144,7 +144,7 @@  static void acpi_dump_uint(fwts_framework *fw, fwts_acpidump_field *info, void *
 	case 8:
 		if (info->bit_field_nbits) {
 			hexdigits = (3+info->bit_field_nbits) / 4;
-			fwts_log_info_verbatum(fw, "%56.56s: 0x%*.*" PRIx64, info->label,
+			fwts_log_info_verbatum(fw, "%57.57s: 0x%*.*" PRIx64, info->label,
 				hexdigits, hexdigits, val);
 		} else
 			fwts_log_info_verbatum(fw, "%s 0x%*.*" PRIx64,