Skip to contentSkip to conversation

AcpiXtract: fix warning on int printed with %u specifier

PATCH In review Colin King 2 participants 4 messages Jul 1, 2015 – Jul 2, 2015 ACPI component architecture (acpica)

lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 AcpiXtract: fix warning on int printed with %u specifier

From: Colin Ian King <colin.king(a)canonical.com>

A signed integer is being printed using %u. Since the integer is never going to be negative, make it unsigned and this also cleans up the warning found by static analysis:

[source/tools/acpixtract/acpixtract.c:819]: (warning) %u in
format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/tools/acpixtract/acpixtract.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
source/tools/acpixtract/acpixtract.c +1 -1
index fa2cb5a..7e961ff 100644
@@ -738,7 +738,7 @@ AxListTables (
     FILE                    *InputFile;
     size_t                  HeaderSize;
     unsigned char           Header[48];
-    int                     TableCount = 0;
+    unsigned int            TableCount = 0;
     ACPI_TABLE_HEADER       *TableHeader = (ACPI_TABLE_HEADER *) (void *) Header;
 
 
Signature · 1 line
2.1.4
#1 lore raw

Got it, thanks.

Quoted 44 lines

-----Original Message-----
From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Colin King
Sent: Wednesday, July 01, 2015 12:02 AM
To: devel(a)acpica.org
Subject: [Devel] [PATCH] AcpiXtract: fix warning on int printed with %u specifier

From: Colin Ian King <colin.king(a)canonical.com>

A signed integer is being printed using %u. Since the integer is never going to be negative, make it unsigned and this also cleans up the warning found by static analysis:

[source/tools/acpixtract/acpixtract.c:819]: (warning) %u in
format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/tools/acpixtract/acpixtract.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
source/tools/acpixtract/acpixtract.c +1 -2
index fa2cb5a..7e961ff 100644
@@ -738,7 +738,7 @@ AxListTables (
     FILE                    *InputFile;
     size_t                  HeaderSize;
     unsigned char           Header[48];
-    int                     TableCount = 0;
+    unsigned int            TableCount = 0;
     ACPI_TABLE_HEADER       *TableHeader = (ACPI_TABLE_HEADER *) (void *)
 Header;
 
 
--

2.1.4

_______________________________________________
Devel mailing list
Devel(a)acpica.org
https://lists.acpica.org/mailman/listinfo/devel

author
#2 lore raw
Quoted 2 lines · Robert

Got it, thanks.

Thanks for applying it. However, the patch landed with the following commit message:

commit 03f9b1938b163cc09306b3ba17c4bb701abf079d

Author: Robert Moore <Robert.Moore(a)intel.com>
Date:   Thu Jul 2 06:22:18 2015 -0700

acpixtract: Replace an "int" with "unsigned int"

The variable is used with %u printf, causing a warning via a static analysis tool. Reported by Colin Ian King.

This is a misrepresentation. I fixed it. Not just reported it. I know it is a minor thing, but re-working the commit message in such a disingenuous way as to take credit away from authors makes me want to no longer contribute to ACPICA. This has not been the first time credit on fixes has been misrepresented "by accident" by re-working the commit messages.

Quoted 45 lines
Quoted 45 lines

-----Original Message-----
From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Colin King
Sent: Wednesday, July 01, 2015 12:02 AM
To: devel(a)acpica.org
Subject: [Devel] [PATCH] AcpiXtract: fix warning on int printed with %u specifier

From: Colin Ian King <colin.king(a)canonical.com>

A signed integer is being printed using %u. Since the integer is never going to be negative, make it unsigned and this also cleans up the warning found by static analysis:

[source/tools/acpixtract/acpixtract.c:819]: (warning) %u in
format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/tools/acpixtract/acpixtract.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
source/tools/acpixtract/acpixtract.c +1 -2
index fa2cb5a..7e961ff 100644
@@ -738,7 +738,7 @@ AxListTables (
     FILE                    *InputFile;
     size_t                  HeaderSize;
     unsigned char           Header[48];
-    int                     TableCount = 0;
+    unsigned int            TableCount = 0;
     ACPI_TABLE_HEADER       *TableHeader = (ACPI_TABLE_HEADER *) (void *)
 Header;
 
 
--

2.1.4

_______________________________________________
Devel mailing list
Devel(a)acpica.org
https://lists.acpica.org/mailman/listinfo/devel

#3 lore raw

Sorry. Sometimes I'm not real good about this.

Quoted 75 lines

-----Original Message-----
From: Colin Ian King [mailto:colin.king(a)canonical.com]
Sent: Thursday, July 02, 2015 7:57 AM
To: Moore, Robert; devel(a)acpica.org
Subject: Re: [Devel] [PATCH] AcpiXtract: fix warning on int printed with %u specifier

Quoted 2 lines · Robert

Got it, thanks.

Thanks for applying it. However, the patch landed with the following commit message:

commit 03f9b1938b163cc09306b3ba17c4bb701abf079d

Author: Robert Moore <Robert.Moore(a)intel.com>
Date:   Thu Jul 2 06:22:18 2015 -0700

acpixtract: Replace an "int" with "unsigned int"

The variable is used with %u printf, causing a warning via a static analysis tool. Reported by Colin Ian King.

This is a misrepresentation. I fixed it. Not just reported it. I know it is a minor thing, but re-working the commit message in such a disingenuous way as to take credit away from authors makes me want to no longer contribute to ACPICA. This has not been the first time credit on fixes has been misrepresented "by accident" by re-working the commit messages.

Quoted 23 lines
Quoted 23 lines

-----Original Message-----
From: Devel [mailto:devel-bounces(a)acpica.org] On Behalf Of Colin King
Sent: Wednesday, July 01, 2015 12:02 AM
To: devel(a)acpica.org
Subject: [Devel] [PATCH] AcpiXtract: fix warning on int printed with %u specifier

From: Colin Ian King <colin.king(a)canonical.com>

A signed integer is being printed using %u. Since the integer is never going to be negative, make it unsigned and this also cleans up the warning found by static analysis:

[source/tools/acpixtract/acpixtract.c:819]: (warning) %u in
format string (no. 1) requires 'unsigned int' but the argument type is 'int'.

Signed-off-by Colin Ian King <colin.king(a)canonical.com>
---
 source/tools/acpixtract/acpixtract.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

source/tools/acpixtract/acpixtract.c AxListTables ( · line 742

Quoted 12 lines
source/tools/acpixtract/acpixtract.c +1 -1
index fa2cb5a..7e961ff 100644
@@ -738,7 +738,7 @@ AxListTables (
     FILE                    *InputFile;
     size_t                  HeaderSize;
     unsigned char           Header[48];
-    int                     TableCount = 0;
+    unsigned int            TableCount = 0;
     ACPI_TABLE_HEADER       *TableHeader = (ACPI_TABLE_HEADER *) (void

*)

Quoted 10 lines
Quoted 10 lines
source/tools/acpixtract/acpixtract.c +0 -1
 Header;
 
 
--

2.1.4

_______________________________________________
Devel mailing list
Devel(a)acpica.org
https://lists.acpica.org/mailman/listinfo/devel