diff mbox

[origin,tree,build,failure] thinkpad-acpi: Fix build on !CONFIG_THINKPAD_ACPI_HOTKEY_POLL

Message ID 20090927075254.GA20847@elte.hu (mailing list archive)
State Rejected, archived
Headers show

Commit Message

Ingo Molnar Sept. 27, 2009, 7:52 a.m. UTC
>  drivers/platform/x86/thinkpad_acpi.c    |  632 +++++++++++++++++++---------

-tip testing found that these changes caused a build failure 
in drivers/platform/x86/thinkpad_acpi.c when 
!CONFIG_THINKPAD_ACPI_HOTKEY_POLL - the fix is attached 
below.

Thanks,

	Ingo

------------------------->
From 7f6443f7238a0aa9014b11a0a31ab76825d75cdf Mon Sep 17 00:00:00 2001
From: Ingo Molnar <mingo@elte.hu>
Date: Sun, 27 Sep 2009 09:47:46 +0200
Subject: [PATCH] thinkpad-acpi: Fix build on !CONFIG_THINKPAD_ACPI_HOTKEY_POLL

This build error:

  drivers/platform/x86/thinkpad_acpi.c: In function 'tpacpi_hotkey_driver_mask_set':
  drivers/platform/x86/thinkpad_acpi.c:2238: error: lvalue required as left operand of assignment

Triggers because in the !CONFIG_THINKPAD_ACPI_HOTKEY_POLL case
tpacpi_hotkey_driver_mask_set ymbol is defined to a constant
literal - which is not an lvalue so cannot be assigned to.

The whole tpacpi_hotkey_driver_mask_set() function is not used
in the !CONFIG_THINKPAD_ACPI_HOTKEY_POLL, so enclose it with
an #ifdef.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 drivers/platform/x86/thinkpad_acpi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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

Henrique de Moraes Holschuh Sept. 27, 2009, 12:28 p.m. UTC | #1
On Sun, 27 Sep 2009, Ingo Molnar wrote:
> >  drivers/platform/x86/thinkpad_acpi.c    |  632 +++++++++++++++++++---------
> 
> -tip testing found that these changes caused a build failure 
> in drivers/platform/x86/thinkpad_acpi.c when 
> !CONFIG_THINKPAD_ACPI_HOTKEY_POLL - the fix is attached 
> below.

Fixed by a different patch, which will hit mainline soon.  Len already
merged the fix in acpi-test.

BTW, the function _is_ used even when CONFIG_THINKPAD_ACPI_HOTKEY_POLL is
undefined...
Len Brown Sept. 28, 2009, 3:34 a.m. UTC | #2
> > >  drivers/platform/x86/thinkpad_acpi.c    |  632 +++++++++++++++++++---------
> > 
> > -tip testing found that these changes caused a build failure 
> > in drivers/platform/x86/thinkpad_acpi.c when 
> > !CONFIG_THINKPAD_ACPI_HOTKEY_POLL - the fix is attached  below.
> 
> Fixed by a different patch, which will hit mainline soon....

Ingo,
2.6.32-rc1 should build fine* -- let me know if it doesn't.

thanks,
Len Brown, Intel Open Source Technology Center

* module this message, which Henruque assures me will go away soon
drivers/platform/x86/thinkpad_acpi.c:2225: warning: 
‘tpacpi_hotkey_driver_mask_set’ defined but not used
Ingo Molnar Sept. 28, 2009, 3:35 p.m. UTC | #3
* Len Brown <lenb@kernel.org> wrote:

> 
> > > >  drivers/platform/x86/thinkpad_acpi.c    |  632 +++++++++++++++++++---------
> > > 
> > > -tip testing found that these changes caused a build failure 
> > > in drivers/platform/x86/thinkpad_acpi.c when 
> > > !CONFIG_THINKPAD_ACPI_HOTKEY_POLL - the fix is attached  below.
> > 
> > Fixed by a different patch, which will hit mainline soon....
> 
> Ingo,
> 2.6.32-rc1 should build fine* -- let me know if it doesn't.
> 
> thanks,
> Len Brown, Intel Open Source Technology Center
> 
> * module this message, which Henruque assures me will go away soon
> drivers/platform/x86/thinkpad_acpi.c:2225: warning: 
> ‘tpacpi_hotkey_driver_mask_set’ defined but not used

well, the warning is fixed properly in my patch, as pointed out in the 
changelog. Have you read that?

	Ingo
--
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
Henrique de Moraes Holschuh Sept. 28, 2009, 7:44 p.m. UTC | #4
On Mon, 28 Sep 2009, Ingo Molnar wrote:
> * Len Brown <lenb@kernel.org> wrote:
> > > > >  drivers/platform/x86/thinkpad_acpi.c    |  632 +++++++++++++++++++---------
> > > > 
> > > > -tip testing found that these changes caused a build failure 
> > > > in drivers/platform/x86/thinkpad_acpi.c when 
> > > > !CONFIG_THINKPAD_ACPI_HOTKEY_POLL - the fix is attached  below.
> > > 
> > > Fixed by a different patch, which will hit mainline soon....
> > 
> > Ingo,
> > 2.6.32-rc1 should build fine* -- let me know if it doesn't.
> > 
> > thanks,
> > Len Brown, Intel Open Source Technology Center
> > 
> > * module this message, which Henruque assures me will go away soon
> > drivers/platform/x86/thinkpad_acpi.c:2225: warning: 
> > ???tpacpi_hotkey_driver_mask_set??? defined but not used
> 
> well, the warning is fixed properly in my patch, as pointed out in the 
> changelog. Have you read that?

Your patch will break the driver when the functionality that uses
tpacpi_hotkey_driver_mask_set() lands in mainline.  That functionality is
already in a subsystem tree waiting a push to Linus.

Of course, you had no way to know that, and I failed to convey that detail
(mostly because _I_ screwed up and forgot I had that patch already applied)
when I replied to you.  Sorry about that.

The patch adding that functionality had already been submitted at the time
you sent in your patch, and it will be merged through the backlight tree
very soon.  That patch couldn't arrive earlier because it needed changes
both in the backlight tree AND in the ACPI tree, and nobody knew which tree
would merge first.

Now that all dependencies (both from backlight and ACPI) are already in
mainline, I asked Richard Purdie to send it to Linus together with his next
batch of backlight updates.  That will silence the warning about
tpacpi_hotkey_driver_mask_set().
diff mbox

Patch

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 3910f2f..a52dbc9 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -2216,6 +2216,7 @@  static int hotkey_user_mask_set(const u32 mask)
 	return rc;
 }
 
+#ifdef CONFIG_THINKPAD_ACPI_HOTKEY_POLL
 /*
  * Sets the driver hotkey mask.
  *
@@ -2244,6 +2245,7 @@  static int tpacpi_hotkey_driver_mask_set(const u32 mask)
 
 	return rc;
 }
+#endif
 
 static int hotkey_status_get(int *status)
 {