* [patch 02/12] ACPI: fix printk format warnings
@ 2006-10-10 21:20 akpm
2006-10-14 8:07 ` Len Brown
0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2006-10-10 21:20 UTC (permalink / raw)
To: len.brown; +Cc: linux-acpi, akpm, rdunlap
From: Randy Dunlap <rdunlap@xenotime.net>
Fix printk format warnings in drivers/acpi:
drivers/acpi/tables/tbget.c:326: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
drivers/acpi/tables/tbrsdt.c:189: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
drivers/acpi/tables/tbget.c | 2 +-
drivers/acpi/tables/tbrsdt.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff -puN drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings drivers/acpi/tables/tbget.c
--- a/drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
+++ a/drivers/acpi/tables/tbget.c
@@ -324,7 +324,7 @@ acpi_tb_get_this_table(struct acpi_point
if (header->length < sizeof(struct acpi_table_header)) {
ACPI_ERROR((AE_INFO,
- "Table length (%X) is smaller than minimum (%X)",
+ "Table length (%X) is smaller than minimum (%zX)",
header->length, sizeof(struct acpi_table_header)));
return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
diff -puN drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings drivers/acpi/tables/tbrsdt.c
--- a/drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
+++ a/drivers/acpi/tables/tbrsdt.c
@@ -187,7 +187,7 @@ acpi_status acpi_tb_validate_rsdt(struct
if (table_ptr->length < sizeof(struct acpi_table_header)) {
ACPI_ERROR((AE_INFO,
- "RSDT/XSDT length (%X) is smaller than minimum (%X)",
+ "RSDT/XSDT length (%X) is smaller than minimum (%zX)",
table_ptr->length,
sizeof(struct acpi_table_header)));
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: [patch 02/12] ACPI: fix printk format warnings
@ 2006-10-10 21:47 Moore, Robert
2006-10-10 22:01 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Moore, Robert @ 2006-10-10 21:47 UTC (permalink / raw)
To: akpm, Brown, Len; +Cc: linux-acpi, rdunlap
A few things:
1) is the "z" modifier ANSI C?
2) in attempting to make this code go both 32/64, and given that we know
that the sizeof this struct is tiny (36 bytes), would it not make more
sense to just cast the sizeof to unsigned int or u32? Same argument for
any use of sizeof in a printf.
3) both of these messages are gone in the new table manager, but the
basic problem remains, I would like to solve it once and for all.
Bob
> -----Original Message-----
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> owner@vger.kernel.org] On Behalf Of akpm@osdl.org
> Sent: Tuesday, October 10, 2006 2:21 PM
> To: Brown, Len
> Cc: linux-acpi@vger.kernel.org; akpm@osdl.org; rdunlap@xenotime.net
> Subject: [patch 02/12] ACPI: fix printk format warnings
>
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Fix printk format warnings in drivers/acpi:
> drivers/acpi/tables/tbget.c:326: warning: format '%X' expects type
> 'unsigned int', but argument 5 has type 'long unsigned int'
> drivers/acpi/tables/tbrsdt.c:189: warning: format '%X' expects type
> 'unsigned int', but argument 5 has type 'long unsigned int'
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> Cc: "Brown, Len" <len.brown@intel.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
>
> drivers/acpi/tables/tbget.c | 2 +-
> drivers/acpi/tables/tbrsdt.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
> drivers/acpi/tables/tbget.c
> --- a/drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
> +++ a/drivers/acpi/tables/tbget.c
> @@ -324,7 +324,7 @@ acpi_tb_get_this_table(struct acpi_point
>
> if (header->length < sizeof(struct acpi_table_header)) {
> ACPI_ERROR((AE_INFO,
> - "Table length (%X) is smaller than minimum
(%X)",
> + "Table length (%X) is smaller than minimum
(%zX)",
> header->length, sizeof(struct
acpi_table_header)));
>
> return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
> diff -puN drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
> drivers/acpi/tables/tbrsdt.c
> --- a/drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
> +++ a/drivers/acpi/tables/tbrsdt.c
> @@ -187,7 +187,7 @@ acpi_status acpi_tb_validate_rsdt(struct
>
> if (table_ptr->length < sizeof(struct acpi_table_header)) {
> ACPI_ERROR((AE_INFO,
> - "RSDT/XSDT length (%X) is smaller than
minimum
> (%X)",
> + "RSDT/XSDT length (%X) is smaller than
minimum
> (%zX)",
> table_ptr->length,
> sizeof(struct acpi_table_header)));
>
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi"
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 02/12] ACPI: fix printk format warnings
2006-10-10 21:47 Moore, Robert
@ 2006-10-10 22:01 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2006-10-10 22:01 UTC (permalink / raw)
To: Moore, Robert; +Cc: akpm, Brown, Len, linux-acpi
On Tue, 10 Oct 2006 14:47:02 -0700 Moore, Robert wrote:
> A few things:
>
> 1) is the "z" modifier ANSI C?
Yes. C99 section 7.19.6.1, paragraph 7:
z Specifies that a following d, i, o, u, x, or X conversion
specifier applies to a size_t or the corresponding signed integer
type argument; or that a following n conversion specifier
applies to a pointer to a signed integer type
corresponding to size_t argument.
> 2) in attempting to make this code go both 32/64, and given that we know
> that the sizeof this struct is tiny (36 bytes), would it not make more
> sense to just cast the sizeof to unsigned int or u32? Same argument for
> any use of sizeof in a printf.
Using %zd should always work (unless you are using some $@#% compiler).
> 3) both of these messages are gone in the new table manager, but the
> basic problem remains, I would like to solve it once and for all.
%zd or %zX
>
> Bob
>
>
> > -----Original Message-----
> > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-
> > owner@vger.kernel.org] On Behalf Of akpm@osdl.org
> > Sent: Tuesday, October 10, 2006 2:21 PM
> > To: Brown, Len
> > Cc: linux-acpi@vger.kernel.org; akpm@osdl.org; rdunlap@xenotime.net
> > Subject: [patch 02/12] ACPI: fix printk format warnings
> >
> > From: Randy Dunlap <rdunlap@xenotime.net>
> >
> > Fix printk format warnings in drivers/acpi:
> > drivers/acpi/tables/tbget.c:326: warning: format '%X' expects type
> > 'unsigned int', but argument 5 has type 'long unsigned int'
> > drivers/acpi/tables/tbrsdt.c:189: warning: format '%X' expects type
> > 'unsigned int', but argument 5 has type 'long unsigned int'
> >
> > Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> > Cc: "Brown, Len" <len.brown@intel.com>
> > Signed-off-by: Andrew Morton <akpm@osdl.org>
> > ---
> >
> > drivers/acpi/tables/tbget.c | 2 +-
> > drivers/acpi/tables/tbrsdt.c | 2 +-
> > 2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff -puN drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
> > drivers/acpi/tables/tbget.c
> > --- a/drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
> > +++ a/drivers/acpi/tables/tbget.c
> > @@ -324,7 +324,7 @@ acpi_tb_get_this_table(struct acpi_point
> >
> > if (header->length < sizeof(struct acpi_table_header)) {
> > ACPI_ERROR((AE_INFO,
> > - "Table length (%X) is smaller than minimum
> (%X)",
> > + "Table length (%X) is smaller than minimum
> (%zX)",
> > header->length, sizeof(struct
> acpi_table_header)));
> >
> > return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
> > diff -puN drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
> > drivers/acpi/tables/tbrsdt.c
> > --- a/drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
> > +++ a/drivers/acpi/tables/tbrsdt.c
> > @@ -187,7 +187,7 @@ acpi_status acpi_tb_validate_rsdt(struct
> >
> > if (table_ptr->length < sizeof(struct acpi_table_header)) {
> > ACPI_ERROR((AE_INFO,
> > - "RSDT/XSDT length (%X) is smaller than
> minimum
> > (%X)",
> > + "RSDT/XSDT length (%X) is smaller than
> minimum
> > (%zX)",
> > table_ptr->length,
> > sizeof(struct acpi_table_header)));
> >
> > _
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-acpi"
> in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
---
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 02/12] ACPI: fix printk format warnings
2006-10-10 21:20 [patch 02/12] ACPI: fix printk format warnings akpm
@ 2006-10-14 8:07 ` Len Brown
0 siblings, 0 replies; 4+ messages in thread
From: Len Brown @ 2006-10-14 8:07 UTC (permalink / raw)
To: akpm; +Cc: linux-acpi, rdunlap
Applied.
thanks,
-Len
On Tuesday 10 October 2006 17:20, akpm@osdl.org wrote:
> From: Randy Dunlap <rdunlap@xenotime.net>
>
> Fix printk format warnings in drivers/acpi:
> drivers/acpi/tables/tbget.c:326: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
> drivers/acpi/tables/tbrsdt.c:189: warning: format '%X' expects type 'unsigned int', but argument 5 has type 'long unsigned int'
>
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
> Cc: "Brown, Len" <len.brown@intel.com>
> Signed-off-by: Andrew Morton <akpm@osdl.org>
> ---
>
> drivers/acpi/tables/tbget.c | 2 +-
> drivers/acpi/tables/tbrsdt.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff -puN drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings drivers/acpi/tables/tbget.c
> --- a/drivers/acpi/tables/tbget.c~acpi-fix-printk-format-warnings
> +++ a/drivers/acpi/tables/tbget.c
> @@ -324,7 +324,7 @@ acpi_tb_get_this_table(struct acpi_point
>
> if (header->length < sizeof(struct acpi_table_header)) {
> ACPI_ERROR((AE_INFO,
> - "Table length (%X) is smaller than minimum (%X)",
> + "Table length (%X) is smaller than minimum (%zX)",
> header->length, sizeof(struct acpi_table_header)));
>
> return_ACPI_STATUS(AE_INVALID_TABLE_LENGTH);
> diff -puN drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings drivers/acpi/tables/tbrsdt.c
> --- a/drivers/acpi/tables/tbrsdt.c~acpi-fix-printk-format-warnings
> +++ a/drivers/acpi/tables/tbrsdt.c
> @@ -187,7 +187,7 @@ acpi_status acpi_tb_validate_rsdt(struct
>
> if (table_ptr->length < sizeof(struct acpi_table_header)) {
> ACPI_ERROR((AE_INFO,
> - "RSDT/XSDT length (%X) is smaller than minimum (%X)",
> + "RSDT/XSDT length (%X) is smaller than minimum (%zX)",
> table_ptr->length,
> sizeof(struct acpi_table_header)));
>
> _
> -
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-10-14 8:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-10 21:20 [patch 02/12] ACPI: fix printk format warnings akpm
2006-10-14 8:07 ` Len Brown
-- strict thread matches above, loose matches on Subject: below --
2006-10-10 21:47 Moore, Robert
2006-10-10 22:01 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).