public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Carlos R. Mafra" <crmafra2@gmail.com>
To: akpm@linux-foundation.org
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: Re: rtc-cmos.c: Build fix
Date: Fri, 9 May 2008 09:33:08 -0300	[thread overview]
Message-ID: <20080509123308.GA4180@beyonder.ift.unesp.br> (raw)
In-Reply-To: <20080509083258.GB2592@elte.hu>

On Fri  9.May'08 at 10:32:58 +0200, Ingo Molnar wrote:
> 
> * Andrew Morton <akpm@linux-foundation.org> wrote:
> 
> > On Tue, 6 May 2008 15:51:25 -0300
> > "Carlos R. Mafra" <crmafra2@gmail.com> wrote:
> > 
> > > Subject: [PATCH] rtc-cmos.c: Build fix
> > > 
> > > The function hpet_rtc_interrupt(..) is to be used only if CONFIG_HPET_EMULATE_RTC
> > > is defined (see arch/x86/kernel/hpet.c), so we define it to return 0 when
> > > !CONFIG_HPET_EMULATE_RTC to avoid build failures. 
> > > 
> > > This function will never be used anyways when !CONFIG_HPET_EMULATE_RTC because 
> > > it is inside a if(is_hpet_enabled()) which is never true when
> > > !CONFIG_HPET_EMULATE_RTC.
> > 
> > I've lost the plot on this one.  Could we please have a description of 
> > the problem which is being fixed?  ie, the compiler (or linker?) 
> > output, and a description of why it is occurring?
> 
> dont have the build failure log around anymore, but the config is:
> 
>    http://redhat.com/~mingo/misc/config-Sun_May__4_09_41_21_CEST_2008.bad

The build failure was this one

  CC      drivers/rtc/rtc-cmos.o
drivers/rtc/rtc-cmos.c: In function cmos_do_probe:
drivers/rtc/rtc-cmos.c:661: error: hpet_rtc_interrupt undeclared (first use in this function)
drivers/rtc/rtc-cmos.c:661: error: (Each undeclared identifier is reported only once
drivers/rtc/rtc-cmos.c:661: error: for each function it appears in.)
make[2]: *** [drivers/rtc/rtc-cmos.o] Error 1
make[1]: *** [drivers/rtc] Error 2
make: *** [drivers] Error 2

And that happened with Ingo's config above and your patch (copy & pasted) below,

------------->
From: Andrew Morton <akpm@linux-foundation.org>

Should already be available via the hpet.h inclusion.

Could go further, by defining the do-nothing stub in hpet.h as well, perhaps.

Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/char/rtc.c     |    2 --
 drivers/rtc/rtc-cmos.c |    1 -
 2 files changed, 3 deletions(-)

diff -puN drivers/char/rtc.c~rtc-remove-unneeded-declarations-of-hpet_rtc_interrupt \
                drivers/char/rtc.c
--- a/drivers/char/rtc.c~rtc-remove-unneeded-declarations-of-hpet_rtc_interrupt
+++ a/drivers/char/rtc.c
@@ -119,8 +119,6 @@ static irqreturn_t hpet_rtc_interrupt(in
 	return 0;
 }
 #endif
-#else
-extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);
 #endif
 
 /*
diff -puN drivers/rtc/rtc-cmos.c~rtc-remove-unneeded-declarations-of-hpet_rtc_interrup \
                t drivers/rtc/rtc-cmos.c
--- a/drivers/rtc/rtc-cmos.c~rtc-remove-unneeded-declarations-of-hpet_rtc_interrupt
+++ a/drivers/rtc/rtc-cmos.c
@@ -52,7 +52,6 @@
 #define hpet_rtc_timer_init() 			do { } while (0)
 #define hpet_register_irq_handler(h) 		0
 #define hpet_unregister_irq_handler(h)		do { } while (0)
-extern irqreturn_t hpet_rtc_interrupt(int irq, void *dev_id);  <-----
 #endif                                                              |
                                                                     |
 struct cmos_rtc {                                                   |
                                                                     |
                                                  This is where the 
                                                  build failure comes
                                                  from. My patch fixed it,
						  but I folded it together
						  with yours.

It's up to you to decide what to do, if you want two patches or only
one (which is the status quo now).
It was an enlightining experience for me anyway :-)




      reply	other threads:[~2008-05-09 12:33 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-05 23:11 x86: Clean up computation of HPET .mult variables Carlos R. Mafra
2008-05-05 23:58 ` Daniel Walker
2008-05-06  2:13   ` Carlos R. Mafra
2008-05-06  3:23     ` Daniel Walker
2008-05-06 12:59       ` Carlos R. Mafra
2008-05-06 16:21         ` Daniel Walker
2008-05-06 20:50           ` Carlos R. Mafra
2008-05-07  2:17             ` Daniel Walker
2008-05-07  3:39               ` Carlos R. Mafra
2008-05-07  4:21                 ` Daniel Walker
2008-05-07  7:13             ` Ingo Molnar
2008-05-06 12:43 ` Ingo Molnar
2008-05-06 13:13   ` Carlos R. Mafra
2008-05-06 18:51   ` rtc-cmos.c: Build fix Carlos R. Mafra
2008-05-07  7:10     ` Ingo Molnar
2008-05-07 21:31     ` Andrew Morton
2008-05-09  8:32       ` Ingo Molnar
2008-05-09 12:33         ` Carlos R. Mafra [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080509123308.GA4180@beyonder.ift.unesp.br \
    --to=crmafra2@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox