* [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c
@ 2008-05-01 9:52 akpm
2008-05-01 18:55 ` Thomas Renninger
0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2008-05-01 9:52 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi, akpm, jbeulich
From: "Jan Beulich" <jbeulich@novell.com>
All of the code in this file is use at boot time only.
Additionally, acpi_tb_create_local_fadt() doesn't need a globally visible
declaration.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/acpi/tables/tbfadt.c | 15 +++++++++------
include/acpi/actables.h | 2 --
2 files changed, 9 insertions(+), 8 deletions(-)
diff -puN drivers/acpi/tables/tbfadt.c~acpi-use-__init-on-everything-in-tables-tbfadtc drivers/acpi/tables/tbfadt.c
--- a/drivers/acpi/tables/tbfadt.c~acpi-use-__init-on-everything-in-tables-tbfadtc
+++ a/drivers/acpi/tables/tbfadt.c
@@ -52,6 +52,8 @@ static void inline
acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
u8 bit_width, u64 address);
+static void acpi_tb_create_local_fadt(struct acpi_table_header *, u32 length);
+
static void acpi_tb_convert_fadt(void);
static void acpi_tb_validate_fadt(void);
@@ -59,7 +61,7 @@ static void acpi_tb_validate_fadt(void);
/* Table for conversion of FADT to common internal format and FADT validation */
typedef struct acpi_fadt_info {
- char *name;
+ const char *name;
u8 target;
u8 source;
u8 length;
@@ -70,7 +72,7 @@ typedef struct acpi_fadt_info {
#define ACPI_FADT_REQUIRED 1
#define ACPI_FADT_SEPARATE_LENGTH 2
-static struct acpi_fadt_info fadt_info_table[] = {
+static struct acpi_fadt_info __initdata fadt_info_table[] = {
{"Pm1aEventBlock", ACPI_FADT_OFFSET(xpm1a_event_block),
ACPI_FADT_OFFSET(pm1a_event_block),
ACPI_FADT_OFFSET(pm1_event_length), ACPI_FADT_REQUIRED},
@@ -155,7 +157,7 @@ acpi_tb_init_generic_address(struct acpi
*
******************************************************************************/
-void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
+void __init acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
{
u32 length;
struct acpi_table_header *table;
@@ -215,7 +217,8 @@ void acpi_tb_parse_fadt(acpi_native_uint
*
******************************************************************************/
-void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
+static void __init
+acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
{
/*
@@ -276,7 +279,7 @@ void acpi_tb_create_local_fadt(struct ac
*
******************************************************************************/
-static void acpi_tb_convert_fadt(void)
+static void __init acpi_tb_convert_fadt(void)
{
u8 pm1_register_length;
struct acpi_generic_address *target;
@@ -397,7 +400,7 @@ static void acpi_tb_convert_fadt(void)
*
******************************************************************************/
-static void acpi_tb_validate_fadt(void)
+static void __init acpi_tb_validate_fadt(void)
{
u32 *address32;
struct acpi_generic_address *address64;
diff -puN include/acpi/actables.h~acpi-use-__init-on-everything-in-tables-tbfadtc include/acpi/actables.h
--- a/include/acpi/actables.h~acpi-use-__init-on-everything-in-tables-tbfadtc
+++ a/include/acpi/actables.h
@@ -51,8 +51,6 @@ acpi_status acpi_allocate_root_table(u32
*/
void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
-void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
-
/*
* tbfind - find ACPI table
*/
_
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c
2008-05-01 9:52 [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c akpm
@ 2008-05-01 18:55 ` Thomas Renninger
2008-05-01 19:02 ` Thomas Renninger
2008-05-01 19:37 ` Andrew Morton
0 siblings, 2 replies; 4+ messages in thread
From: Thomas Renninger @ 2008-05-01 18:55 UTC (permalink / raw)
To: Jan Beulich; +Cc: lenb, linux-acpi, Moore, Robert, akpm
Andrew, IMO you can drop this and the const cleanups from -mm tree.
Jan, nearly all code in:
drivers/acpi/*/*.[hc]
is part of ACPICA. This currently still is (may change) an Intel
internal repository which gets synced to several OS implementations,
also Linux. __init does not exist there (yet).
Also the const changes may be a bit of a pain -> this is what Robert
meant with as long as it won't end in a chain of const cleanups :)
The whole code gets style cleaned up through Lindent and manually to
half way fit to the Linux kernel style when things get merged.
Currently Robert has to readjust this to ACPICA coding style by hand
and merge it into the internal Intel repository. Len has to pick it up
somewhat later and merge it back to the Linux kernel...
Therefore I expect for cleanup patches (this one is on the edge, but I
could understand Intel if they hold it off) the best is to wait until
Intel publishs ACPICA as CVS or whatever repository on their
lesswatts.org site.
Then it is at least only half of the merging work and this half a bit
automated with Lindent...
ACPICA is packaged on SUSE in the pmtools package, it's rather new, but
it's not the very latest version, waiting for a revision control system
is worth it, before ending up in manual fiddling...
Thomas
On Thu, 2008-05-01 at 02:52 -0700, akpm@linux-foundation.org wrote:
> From: "Jan Beulich" <jbeulich@novell.com>
>
> All of the code in this file is use at boot time only.
>
> Additionally, acpi_tb_create_local_fadt() doesn't need a globally visible
> declaration.
>
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> Cc: Len Brown <lenb@kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
> drivers/acpi/tables/tbfadt.c | 15 +++++++++------
> include/acpi/actables.h | 2 --
> 2 files changed, 9 insertions(+), 8 deletions(-)
>
> diff -puN drivers/acpi/tables/tbfadt.c~acpi-use-__init-on-everything-in-tables-tbfadtc drivers/acpi/tables/tbfadt.c
> --- a/drivers/acpi/tables/tbfadt.c~acpi-use-__init-on-everything-in-tables-tbfadtc
> +++ a/drivers/acpi/tables/tbfadt.c
> @@ -52,6 +52,8 @@ static void inline
> acpi_tb_init_generic_address(struct acpi_generic_address *generic_address,
> u8 bit_width, u64 address);
>
> +static void acpi_tb_create_local_fadt(struct acpi_table_header *, u32 length);
> +
> static void acpi_tb_convert_fadt(void);
>
> static void acpi_tb_validate_fadt(void);
> @@ -59,7 +61,7 @@ static void acpi_tb_validate_fadt(void);
> /* Table for conversion of FADT to common internal format and FADT validation */
>
> typedef struct acpi_fadt_info {
> - char *name;
> + const char *name;
> u8 target;
> u8 source;
> u8 length;
> @@ -70,7 +72,7 @@ typedef struct acpi_fadt_info {
> #define ACPI_FADT_REQUIRED 1
> #define ACPI_FADT_SEPARATE_LENGTH 2
>
> -static struct acpi_fadt_info fadt_info_table[] = {
> +static struct acpi_fadt_info __initdata fadt_info_table[] = {
> {"Pm1aEventBlock", ACPI_FADT_OFFSET(xpm1a_event_block),
> ACPI_FADT_OFFSET(pm1a_event_block),
> ACPI_FADT_OFFSET(pm1_event_length), ACPI_FADT_REQUIRED},
> @@ -155,7 +157,7 @@ acpi_tb_init_generic_address(struct acpi
> *
> ******************************************************************************/
>
> -void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
> +void __init acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags)
> {
> u32 length;
> struct acpi_table_header *table;
> @@ -215,7 +217,8 @@ void acpi_tb_parse_fadt(acpi_native_uint
> *
> ******************************************************************************/
>
> -void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
> +static void __init
> +acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length)
> {
>
> /*
> @@ -276,7 +279,7 @@ void acpi_tb_create_local_fadt(struct ac
> *
> ******************************************************************************/
>
> -static void acpi_tb_convert_fadt(void)
> +static void __init acpi_tb_convert_fadt(void)
> {
> u8 pm1_register_length;
> struct acpi_generic_address *target;
> @@ -397,7 +400,7 @@ static void acpi_tb_convert_fadt(void)
> *
> ******************************************************************************/
>
> -static void acpi_tb_validate_fadt(void)
> +static void __init acpi_tb_validate_fadt(void)
> {
> u32 *address32;
> struct acpi_generic_address *address64;
> diff -puN include/acpi/actables.h~acpi-use-__init-on-everything-in-tables-tbfadtc include/acpi/actables.h
> --- a/include/acpi/actables.h~acpi-use-__init-on-everything-in-tables-tbfadtc
> +++ a/include/acpi/actables.h
> @@ -51,8 +51,6 @@ acpi_status acpi_allocate_root_table(u32
> */
> void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
>
> -void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
> -
> /*
> * tbfind - find ACPI table
> */
> _
> --
> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c
2008-05-01 18:55 ` Thomas Renninger
@ 2008-05-01 19:02 ` Thomas Renninger
2008-05-01 19:37 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Renninger @ 2008-05-01 19:02 UTC (permalink / raw)
To: Jan Beulich; +Cc: lenb, linux-acpi, Moore, Robert, akpm
On Thu, 2008-05-01 at 20:55 +0200, Thomas Renninger wrote:
> Andrew, IMO you can drop this and the const cleanups from -mm tree.
...
> __init does not exist there (yet).
...
I wonder whether Intel could already think about or implement a possible
__init integration. There is probably a lot more that can be declared
__init which can then be cleaned up by Linux kernel developers as soon
as acpica exists as repository.
Thomas
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c
2008-05-01 18:55 ` Thomas Renninger
2008-05-01 19:02 ` Thomas Renninger
@ 2008-05-01 19:37 ` Andrew Morton
1 sibling, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2008-05-01 19:37 UTC (permalink / raw)
To: trenn; +Cc: jbeulich, lenb, linux-acpi, robert.moore
On Thu, 01 May 2008 20:55:51 +0200
Thomas Renninger <trenn@suse.de> wrote:
> Andrew, IMO you can drop this and the const cleanups from -mm tree.
I cannot locate a patch which matches the description "const cleanups"?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-05-01 19:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-01 9:52 [patch 05/10] acpi: use __init* on everything in tables/tbfadt.c akpm
2008-05-01 18:55 ` Thomas Renninger
2008-05-01 19:02 ` Thomas Renninger
2008-05-01 19:37 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox