Linux ACPI
 help / color / mirror / Atom feed
* [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n
       [not found] <201003050232.o252WD4K011798@imap1.linux-foundation.org>
@ 2010-03-05 19:54 ` Randy Dunlap
  2010-03-05 20:37   ` Alexey Starikovskiy
  2010-03-09  6:21   ` Rakib Mullick
  0 siblings, 2 replies; 3+ messages in thread
From: Randy Dunlap @ 2010-03-05 19:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Alexey Starikovskiy, ACPI Devel Maling List, Len Brown

From: Randy Dunlap <randy.dunlap@oracle.com>

When CONFIG_ACPI_SYSFS_POWER is not enabled:

drivers/acpi/sbs.c:640: error: implicit declaration of function 'acpi_battery_get_alarm'
drivers/acpi/sbs.c:679: error: implicit declaration of function 'acpi_battery_set_alarm'


so move those functions outside of the ifdef/endif block for that
config option.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
---
 drivers/acpi/sbs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- mmotm-2010-0304-1805.orig/drivers/acpi/sbs.c
+++ mmotm-2010-0304-1805/drivers/acpi/sbs.c
@@ -412,8 +412,6 @@ static int acpi_ac_get_present(struct ac
 	return result;
 }
 
-#ifdef CONFIG_ACPI_SYSFS_POWER
-
 static int acpi_battery_get_alarm(struct acpi_battery *battery)
 {
 	return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
@@ -450,6 +448,8 @@ static int acpi_battery_set_alarm(struct
 	return ret;
 }
 
+#ifdef CONFIG_ACPI_SYSFS_POWER
+
 static ssize_t acpi_battery_alarm_show(struct device *dev,
 					struct device_attribute *attr,
 					char *buf)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n
  2010-03-05 19:54 ` [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n Randy Dunlap
@ 2010-03-05 20:37   ` Alexey Starikovskiy
  2010-03-09  6:21   ` Rakib Mullick
  1 sibling, 0 replies; 3+ messages in thread
From: Alexey Starikovskiy @ 2010-03-05 20:37 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, akpm, ACPI Devel Maling List, Len Brown


Randy Dunlap пишет:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> When CONFIG_ACPI_SYSFS_POWER is not enabled:
> 
> drivers/acpi/sbs.c:640: error: implicit declaration of function 'acpi_battery_get_alarm'
> drivers/acpi/sbs.c:679: error: implicit declaration of function 'acpi_battery_set_alarm'
> 
> 
> so move those functions outside of the ifdef/endif block for that
> config option.
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de>
> ---
>  drivers/acpi/sbs.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> --- mmotm-2010-0304-1805.orig/drivers/acpi/sbs.c
> +++ mmotm-2010-0304-1805/drivers/acpi/sbs.c
> @@ -412,8 +412,6 @@ static int acpi_ac_get_present(struct ac
>  	return result;
>  }
>  
> -#ifdef CONFIG_ACPI_SYSFS_POWER
> -
>  static int acpi_battery_get_alarm(struct acpi_battery *battery)
>  {
>  	return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
> @@ -450,6 +448,8 @@ static int acpi_battery_set_alarm(struct
>  	return ret;
>  }
>  
> +#ifdef CONFIG_ACPI_SYSFS_POWER
> +
>  static ssize_t acpi_battery_alarm_show(struct device *dev,
>  					struct device_attribute *attr,
>  					char *buf)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n
  2010-03-05 19:54 ` [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n Randy Dunlap
  2010-03-05 20:37   ` Alexey Starikovskiy
@ 2010-03-09  6:21   ` Rakib Mullick
  1 sibling, 0 replies; 3+ messages in thread
From: Rakib Mullick @ 2010-03-09  6:21 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: linux-kernel, akpm, Alexey Starikovskiy, ACPI Devel Maling List,
	Len Brown

Hi Randy,

On 3/6/10, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> When CONFIG_ACPI_SYSFS_POWER is not enabled:
>
> drivers/acpi/sbs.c:640: error: implicit declaration of function
> 'acpi_battery_get_alarm'
> drivers/acpi/sbs.c:679: error: implicit declaration of function
> 'acpi_battery_set_alarm'
>
This problem is introduced by the patch
(http://lkml.org/lkml/2010/3/1/29) named
acpi-put-acpi_battery_get-set_alarm-into-config_acpi_sysfs_power.patch.
If we use CONFIG_ACPI_SYSFS_POWER=y then we are warned by the
following warning:

drivers/acpi/sbs.c:399: warning: ‘acpi_battery_get_alarm’ defined but not used
drivers/acpi/sbs.c:406: warning: ‘acpi_battery_set_alarm’ defined but not used

So, I think it's better that we wrap CONFIG_ACPI_SYSFS_POWER with
#ifdef and #else. Otherwise we have to face the above warning.

Thanks,
Rakib

>
> so move those functions outside of the ifdef/endif block for that
> config option.
>
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>  drivers/acpi/sbs.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> --- mmotm-2010-0304-1805.orig/drivers/acpi/sbs.c
> +++ mmotm-2010-0304-1805/drivers/acpi/sbs.c
> @@ -412,8 +412,6 @@ static int acpi_ac_get_present(struct ac
>  	return result;
>  }
>
> -#ifdef CONFIG_ACPI_SYSFS_POWER
> -
>  static int acpi_battery_get_alarm(struct acpi_battery *battery)
>  {
>  	return acpi_smbus_read(battery->sbs->hc, SMBUS_READ_WORD,
> @@ -450,6 +448,8 @@ static int acpi_battery_set_alarm(struct
>  	return ret;
>  }
>
> +#ifdef CONFIG_ACPI_SYSFS_POWER
> +
>  static ssize_t acpi_battery_alarm_show(struct device *dev,
>  					struct device_attribute *attr,
>  					char *buf)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-03-09  6:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <201003050232.o252WD4K011798@imap1.linux-foundation.org>
2010-03-05 19:54 ` [PATCH -mmotm] acpi/sbs: fix build for ACPI_SYSFS_POWER=n Randy Dunlap
2010-03-05 20:37   ` Alexey Starikovskiy
2010-03-09  6:21   ` Rakib Mullick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox