diff mbox

[01/12] ACPI: introduce CONFIG_ACPI_REDUCED_HARDWARE to enable this ACPI mode

Message ID 528F2A4F.90908@linaro.org (mailing list archive)
State RFC, archived
Headers show

Commit Message

Hanjun Guo Nov. 22, 2013, 9:56 a.m. UTC
On 2013-11-22 14:14, Zheng, Lv wrote:
[...]
>>  endif	# ACPI
>> diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
>> index 28f4f4d..ae93a91 100644
>> --- a/include/acpi/platform/aclinux.h
>> +++ b/include/acpi/platform/aclinux.h
>> @@ -67,6 +67,10 @@
>>
>>  /* Host-dependent types and defines for in-kernel ACPICA */
>>
>> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
>> +#define ACPI_REDUCED_HARDWARE TRUE
>> +#endif
>> +
> 
> Maybe you put this here because of my previous wrong comment.
> 
> For ACPICA environments that work like Kconfigs for Linux, it is good to define them before including any ACPICA files.
> While putting things here cannot cover <asm/acpi.h>.

Good catch! thanks for the reminding.

> 
> Normally, I will do:
> 
> ...
> 
> #ifdef __KERNEL__
> 
> /* some comment */
> (one empty line as ACPICA enforces 1 empty line after 1 line comment and no empty lines after a block of comments)
> #ifdef CONFIG_ACPI_REDUCED_HARDWARE
> #define ACPI_REDUCED_HARDWARE(spaces not tabs here according to ACPICA's coding style)TRUE
> #endif
> 
> #include <linux/string.h>

There is a problem when I try yours suggestion, it is a compiling warning:

warning: "TRUE" is not defined

And I find that "TRUE" is defined in include/acpi/actypes.

So, is this ok to you?

> The coding style can help ACPICA release process to generate correct Linuxized patches.
> It would be good to Linux developers to follow this currently for ACPICA internal code or we may see a small useless divergences commit generated from a back ported Linux commit :-( .
> I'm sorry for the inconvenience.

ok, will update in next version.

> 
> Thanks
> -Lv

--
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

Comments

Lv Zheng Nov. 25, 2013, 7:43 a.m. UTC | #1
HI,

> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Hanjun Guo
> Sent: Friday, November 22, 2013 5:57 PM
> 
> On 2013-11-22 14:14, Zheng, Lv wrote:
> [...]
> >>  endif	# ACPI
> >> diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
> >> index 28f4f4d..ae93a91 100644
> >> --- a/include/acpi/platform/aclinux.h
> >> +++ b/include/acpi/platform/aclinux.h
> >> @@ -67,6 +67,10 @@
> >>
> >>  /* Host-dependent types and defines for in-kernel ACPICA */
> >>
> >> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
> >> +#define ACPI_REDUCED_HARDWARE TRUE
> >> +#endif
> >> +
> >
> > Maybe you put this here because of my previous wrong comment.
> >
> > For ACPICA environments that work like Kconfigs for Linux, it is good to define them before including any ACPICA files.
> > While putting things here cannot cover <asm/acpi.h>.
> 
> Good catch! thanks for the reminding.
> 
> >
> > Normally, I will do:
> >
> > ...
> >
> > #ifdef __KERNEL__
> >
> > /* some comment */
> > (one empty line as ACPICA enforces 1 empty line after 1 line comment and no empty lines after a block of comments)
> > #ifdef CONFIG_ACPI_REDUCED_HARDWARE
> > #define ACPI_REDUCED_HARDWARE(spaces not tabs here according to ACPICA's coding style)TRUE
> > #endif
> >
> > #include <linux/string.h>
> 
> There is a problem when I try yours suggestion, it is a compiling warning:
> 
> warning: "TRUE" is not defined
> 
> And I find that "TRUE" is defined in include/acpi/actypes.
> 
> So, is this ok to you?

... How ugly the TRUE is.
OK, you can keep your original code as this is really not a real issue, just a tricky point.
I'll try to offer a cleanup after another ACPICA cleanup that tries to modify all "#if" condition related TRUE into "1" in ACPICA.

Thanks and best regards
-Lv

> 
> --- a/include/acpi/platform/aclinux.h
> +++ b/include/acpi/platform/aclinux.h
> @@ -63,6 +63,13 @@
>  #ifdef EXPORT_ACPI_INTERFACES
>  #include <linux/export.h>
>  #endif
> +
> +#define TRUE    (1 == 1)
> +
> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
> +#define ACPI_REDUCED_HARDWARE TRUE
> +#endif
> +
>  #include <asm/acpi.h>
> 
> >
> > The coding style can help ACPICA release process to generate correct Linuxized patches.
> > It would be good to Linux developers to follow this currently for ACPICA internal code or we may see a small useless divergences
> commit generated from a back ported Linux commit :-( .
> > I'm sorry for the inconvenience.
> 
> ok, will update in next version.
> 
> >
> > Thanks
> > -Lv
> 
> --
> 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
Lv Zheng Nov. 25, 2013, 8:14 a.m. UTC | #2
> From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Zheng, Lv
> Sent: Monday, November 25, 2013 3:44 PM
> 
> HI,
> 
> > From: linux-acpi-owner@vger.kernel.org [mailto:linux-acpi-owner@vger.kernel.org] On Behalf Of Hanjun Guo
> > Sent: Friday, November 22, 2013 5:57 PM
> >
> > On 2013-11-22 14:14, Zheng, Lv wrote:
> > [...]
> > >>  endif	# ACPI
> > >> diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
> > >> index 28f4f4d..ae93a91 100644
> > >> --- a/include/acpi/platform/aclinux.h
> > >> +++ b/include/acpi/platform/aclinux.h
> > >> @@ -67,6 +67,10 @@
> > >>
> > >>  /* Host-dependent types and defines for in-kernel ACPICA */
> > >>
> > >> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
> > >> +#define ACPI_REDUCED_HARDWARE TRUE
> > >> +#endif
> > >> +
> > >
> > > Maybe you put this here because of my previous wrong comment.
> > >
> > > For ACPICA environments that work like Kconfigs for Linux, it is good to define them before including any ACPICA files.
> > > While putting things here cannot cover <asm/acpi.h>.
> >
> > Good catch! thanks for the reminding.
> >
> > >
> > > Normally, I will do:
> > >
> > > ...
> > >
> > > #ifdef __KERNEL__
> > >
> > > /* some comment */
> > > (one empty line as ACPICA enforces 1 empty line after 1 line comment and no empty lines after a block of comments)
> > > #ifdef CONFIG_ACPI_REDUCED_HARDWARE
> > > #define ACPI_REDUCED_HARDWARE(spaces not tabs here according to ACPICA's coding style)TRUE
> > > #endif
> > >
> > > #include <linux/string.h>
> >
> > There is a problem when I try yours suggestion, it is a compiling warning:
> >
> > warning: "TRUE" is not defined
> >
> > And I find that "TRUE" is defined in include/acpi/actypes.
> >
> > So, is this ok to you?
> 
> ... How ugly the TRUE is.
> OK, you can keep your original code as this is really not a real issue, just a tricky point.
> I'll try to offer a cleanup after another ACPICA cleanup that tries to modify all "#if" condition related TRUE into "1" in ACPICA.

I checked ACPICA code base and found there is really nothing need to be cleaned up.

Why not:
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE
+#define ACPI_REDUCED_HARDWARE 1
+#endif

If you take a look at generated/autoconf.h, such environmental conditions should be 1 rather than TRUE as they are meant to be included prior than any source code.

Thanks and best regards
-Lv

> 
> Thanks and best regards
> -Lv
> 
> >
> > --- a/include/acpi/platform/aclinux.h
> > +++ b/include/acpi/platform/aclinux.h
> > @@ -63,6 +63,13 @@
> >  #ifdef EXPORT_ACPI_INTERFACES
> >  #include <linux/export.h>
> >  #endif
> > +
> > +#define TRUE    (1 == 1)
> > +
> > +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
> > +#define ACPI_REDUCED_HARDWARE TRUE
> > +#endif
> > +
> >  #include <asm/acpi.h>
> >
> > >
> > > The coding style can help ACPICA release process to generate correct Linuxized patches.
> > > It would be good to Linux developers to follow this currently for ACPICA internal code or we may see a small useless divergences
> > commit generated from a back ported Linux commit :-( .
> > > I'm sorry for the inconvenience.
> >
> > ok, will update in next version.
> >
> > >
> > > Thanks
> > > -Lv
> >
> > --
> > 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
--
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
Hanjun Guo Nov. 27, 2013, 9:02 a.m. UTC | #3
Hi Lv,

Sorry for the late reply, I have some comments below.

On 2013-11-25 16:14, Zheng, Lv wrote:
[...]
>>>>> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
>>>>> +#define ACPI_REDUCED_HARDWARE TRUE
>>>>> +#endif
>>>>> +
>>>>
>>>> Maybe you put this here because of my previous wrong comment.
>>>>
>>>> For ACPICA environments that work like Kconfigs for Linux, it is good to define them before including any ACPICA files.
>>>> While putting things here cannot cover <asm/acpi.h>.
>>>
>>> Good catch! thanks for the reminding.
>>>
>>>>
>>>> Normally, I will do:
>>>>
>>>> ...
>>>>
>>>> #ifdef __KERNEL__
>>>>
>>>> /* some comment */
>>>> (one empty line as ACPICA enforces 1 empty line after 1 line comment and no empty lines after a block of comments)
>>>> #ifdef CONFIG_ACPI_REDUCED_HARDWARE
>>>> #define ACPI_REDUCED_HARDWARE(spaces not tabs here according to ACPICA's coding style)TRUE
>>>> #endif
>>>>
>>>> #include <linux/string.h>
>>>
>>> There is a problem when I try yours suggestion, it is a compiling warning:
>>>
>>> warning: "TRUE" is not defined
>>>
>>> And I find that "TRUE" is defined in include/acpi/actypes.
>>>
>>> So, is this ok to you?
>>
>> ... How ugly the TRUE is.
>> OK, you can keep your original code as this is really not a real issue, just a tricky point.
>> I'll try to offer a cleanup after another ACPICA cleanup that tries to modify all "#if" condition related TRUE into "1" in ACPICA.
> 
> I checked ACPICA code base and found there is really nothing need to be cleaned up.
> 
> Why not:
> +#ifdef CONFIG_ACPI_REDUCED_HARDWARE
> +#define ACPI_REDUCED_HARDWARE 1
> +#endif

In include/acpi/acconfig.h:

#ifndef ACPI_REDUCED_HARDWARE
#define ACPI_REDUCED_HARDWARE           FALSE
#endif

In order to make the code consistent, I used "TRUE" here.

But it is ok to me to use "1" here, will update in next version.

Thanks
Hanjun
--
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
diff mbox

Patch

--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -63,6 +63,13 @@ 
 #ifdef EXPORT_ACPI_INTERFACES
 #include <linux/export.h>
 #endif
+
+#define TRUE    (1 == 1)
+
+#ifdef CONFIG_ACPI_REDUCED_HARDWARE
+#define ACPI_REDUCED_HARDWARE TRUE
+#endif
+
 #include <asm/acpi.h>

>