linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* thinkpad_acpi: define _sta only when needed
@ 2008-01-16 13:01 Johannes Weiner
  2008-01-16 13:01 ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Johannes Weiner
  2008-01-16 19:13 ` thinkpad_acpi: define _sta only when needed Henrique de Moraes Holschuh
  0 siblings, 2 replies; 8+ messages in thread
From: Johannes Weiner @ 2008-01-16 13:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: ibm-acpi


Define _sta() helper conditionally; also remove its prototype from
the internal header and also some other unneeded ones.

This function is only needed when the bay or the dock subdriver is
enabled.  Otherwise, gcc complains about an unused static function.

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

* [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header
  2008-01-16 13:01 thinkpad_acpi: define _sta only when needed Johannes Weiner
@ 2008-01-16 13:01 ` Johannes Weiner
  2008-01-16 13:01   ` [PATCH] thinkpad_acpi: Define _sta() only when there are callsites Johannes Weiner
  2008-01-16 19:13   ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Henrique de Moraes Holschuh
  2008-01-16 19:13 ` thinkpad_acpi: define _sta only when needed Henrique de Moraes Holschuh
  1 sibling, 2 replies; 8+ messages in thread
From: Johannes Weiner @ 2008-01-16 13:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: ibm-acpi, Johannes Weiner

The helper functions are defined at the top of the C file so they are
known within the definition of the callsites below anyway.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---
 drivers/misc/thinkpad_acpi.h |   10 ----------
 1 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/drivers/misc/thinkpad_acpi.h b/drivers/misc/thinkpad_acpi.h
index 8fba2bb..afaeb82 100644
--- a/drivers/misc/thinkpad_acpi.h
+++ b/drivers/misc/thinkpad_acpi.h
@@ -115,13 +115,6 @@ static const char *str_supported(int is_supported);
 /* ACPI HIDs */
 #define IBM_HKEY_HID    "IBM0068"
 
-/* ACPI helpers */
-static int __must_check acpi_evalf(acpi_handle handle,
-		      void *res, char *method, char *fmt, ...);
-static int __must_check acpi_ec_read(int i, u8 * p);
-static int __must_check acpi_ec_write(int i, u8 v);
-static int __must_check _sta(acpi_handle handle);
-
 /* ACPI handles */
 static acpi_handle root_handle;			/* root namespace */
 static acpi_handle ec_handle;			/* EC */
@@ -135,9 +128,6 @@ static void drv_acpi_handle_init(char *name,
 	drv_acpi_handle_init(#object, &object##_handle, *object##_parent,	\
 		object##_paths, ARRAY_SIZE(object##_paths), &object##_path)
 
-/* ThinkPad ACPI helpers */
-static int issue_thinkpad_cmos_command(int cmos_cmd);
-
 /* procfs support */
 static struct proc_dir_entry *proc_dir;
 
-- 
1.5.3.8


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

* [PATCH] thinkpad_acpi: Define _sta() only when there are callsites
  2008-01-16 13:01 ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Johannes Weiner
@ 2008-01-16 13:01   ` Johannes Weiner
  2008-01-16 19:14     ` Henrique de Moraes Holschuh
  2008-01-16 19:13   ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Henrique de Moraes Holschuh
  1 sibling, 1 reply; 8+ messages in thread
From: Johannes Weiner @ 2008-01-16 13:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: ibm-acpi, Johannes Weiner

With configs where neither the dock nor the bay subdriver is enabled,
_sta() is defined but never used.  Define it conditionally.

Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
---
 drivers/misc/thinkpad_acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
index cf56647..d5ac8b7 100644
--- a/drivers/misc/thinkpad_acpi.c
+++ b/drivers/misc/thinkpad_acpi.c
@@ -293,6 +293,7 @@ static int acpi_ec_write(int i, u8 v)
 	return 1;
 }
 
+#if defined(CONFIG_THINKPAD_ACPI_DOCK) || defined(CONFIG_THINKPAD_ACPI_DOCK)
 static int _sta(acpi_handle handle)
 {
 	int status;
@@ -302,6 +303,7 @@ static int _sta(acpi_handle handle)
 
 	return status;
 }
+#endif
 
 static int issue_thinkpad_cmos_command(int cmos_cmd)
 {
-- 
1.5.3.8


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

* Re: thinkpad_acpi: define _sta only when needed
  2008-01-16 13:01 thinkpad_acpi: define _sta only when needed Johannes Weiner
  2008-01-16 13:01 ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Johannes Weiner
@ 2008-01-16 19:13 ` Henrique de Moraes Holschuh
  2008-01-16 21:10   ` Johannes Weiner
  1 sibling, 1 reply; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-01-16 19:13 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: linux-kernel, linux-acpi

On Wed, 16 Jan 2008, Johannes Weiner wrote:
> Define _sta() helper conditionally; also remove its prototype from
> the internal header and also some other unneeded ones.
> 
> This function is only needed when the bay or the dock subdriver is
> enabled.  Otherwise, gcc complains about an unused static function.
> --
> 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/

Johannes, thanks for the patches, but NAK.  A similar group of patches that
clean up the _sta and heander file (kills it, actually) has already been
sent to Len Brown to be merged for 2.6.25.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header
  2008-01-16 13:01 ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Johannes Weiner
  2008-01-16 13:01   ` [PATCH] thinkpad_acpi: Define _sta() only when there are callsites Johannes Weiner
@ 2008-01-16 19:13   ` Henrique de Moraes Holschuh
  1 sibling, 0 replies; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-01-16 19:13 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: linux-kernel, linux-acpi


Equivalent patch already sent to Len Brown for 2.6.25, removing the header
file altogether...

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: [PATCH] thinkpad_acpi: Define _sta() only when there are callsites
  2008-01-16 13:01   ` [PATCH] thinkpad_acpi: Define _sta() only when there are callsites Johannes Weiner
@ 2008-01-16 19:14     ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-01-16 19:14 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: linux-kernel, linux-acpi

Another version of this patch has been sent to Len Brown for 2.6.25 already.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

* Re: thinkpad_acpi: define _sta only when needed
  2008-01-16 19:13 ` thinkpad_acpi: define _sta only when needed Henrique de Moraes Holschuh
@ 2008-01-16 21:10   ` Johannes Weiner
  2008-01-16 21:54     ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 8+ messages in thread
From: Johannes Weiner @ 2008-01-16 21:10 UTC (permalink / raw)
  To: Henrique de Moraes Holschuh; +Cc: linux-kernel, linux-acpi

Hi Henrique,

Henrique de Moraes Holschuh <hmh@hmh.eng.br> writes:

> On Wed, 16 Jan 2008, Johannes Weiner wrote:
>> Define _sta() helper conditionally; also remove its prototype from
>> the internal header and also some other unneeded ones.
>> 
>> This function is only needed when the bay or the dock subdriver is
>> enabled.  Otherwise, gcc complains about an unused static function.
>
> Johannes, thanks for the patches, but NAK.  A similar group of patches that
> clean up the _sta and heander file (kills it, actually) has already been
> sent to Len Brown to be merged for 2.6.25.

Sorry, I missed to check his tree in advance.  And if the work is
already done - even better! :)

	Hannes

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

* Re: thinkpad_acpi: define _sta only when needed
  2008-01-16 21:10   ` Johannes Weiner
@ 2008-01-16 21:54     ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 8+ messages in thread
From: Henrique de Moraes Holschuh @ 2008-01-16 21:54 UTC (permalink / raw)
  To: Johannes Weiner; +Cc: linux-kernel, linux-acpi

On Wed, 16 Jan 2008, Johannes Weiner wrote:
> > Johannes, thanks for the patches, but NAK.  A similar group of patches that
> > clean up the _sta and heander file (kills it, actually) has already been
> > sent to Len Brown to be merged for 2.6.25.
> 
> Sorry, I missed to check his tree in advance.  And if the work is
> already done - even better! :)

I don't think Len merged the latest version of the patchset yet, but a
previous version is available in the acpi-test tree.  The latest version was
posted to linux-acpi recently.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

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

end of thread, other threads:[~2008-01-16 21:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-16 13:01 thinkpad_acpi: define _sta only when needed Johannes Weiner
2008-01-16 13:01 ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Johannes Weiner
2008-01-16 13:01   ` [PATCH] thinkpad_acpi: Define _sta() only when there are callsites Johannes Weiner
2008-01-16 19:14     ` Henrique de Moraes Holschuh
2008-01-16 19:13   ` [PATCH] thinkpad_acpi: Remove superfluous prototypes from internal header Henrique de Moraes Holschuh
2008-01-16 19:13 ` thinkpad_acpi: define _sta only when needed Henrique de Moraes Holschuh
2008-01-16 21:10   ` Johannes Weiner
2008-01-16 21:54     ` Henrique de Moraes Holschuh

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