Subject: Re: linux-next: Tree for November 14 (staging)

From: "J.R. Mauro" <[email-masked]>
Date: Fri, 14 Nov 2008 20:01:14 -0500

On Fri, Nov 14, 2008 at 10:22:04AM -0800, Randy Dunlap wrote:
> Greg KH wrote:
> > On Fri, Nov 14, 2008 at 09:52:47AM -0800, Randy Dunlap wrote:
> >> On Fri, 14 Nov 2008 18:40:21 +1100 Stephen Rothwell wrote:
> >>
> >>> Hi all,
> >>>
> >>> Changes since 20081113:
> >>>
> >>> New tree:
> >>> 	staging
> >>
> >> drivers/staging/benet/mpu.c:146: error: implicit declaration of function 'udelay'
> >>
> >> drivers/staging/comedi/proc.c:89: error: redefinition of 'comedi_proc_init'
> >> drivers/staging/comedi/comedidev.h:359: error: previous definition of 'comedi_proc_init' was here
> >> drivers/staging/comedi/proc.c:98: error: redefinition of 'comedi_proc_cleanup'
> >> drivers/staging/comedi/comedidev.h:362: error: previous definition of 'comedi_proc_cleanup' was here
> > 
> > Odd, I'm not getting these warnings here, can you give me a copy of your
> > .config?
> 
> 2 failing configs attached.
> 

The comedi driver does some wonky stuff if CONFIG_PROC_FS isn't set. It
conditionally defined these functions if it's set to a forward declaration, but
then if it's not set it makes them empty. However, the *real* definitions aren't
protected by the same kind of ifdefs. In case Greg can't reproduce this, here's 
a quick-n-dirty patch to do just that.

I think in reality there should be some way to exclude that proc.c file entirely
if CONFIG_PROC_FS is not set, but I'll leave that to the pros. (Whom I am adding
to the CC-list, BTW).

=

Don't include procfs functions if CONFIG_PROC_FS is not set

Signed-off by: J.R. Mauro <[email-masked]>

---
 drivers/staging/comedi/proc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/comedi/proc.c b/drivers/staging/comedi/proc.c
index 7db12ac..5a2b72d 100644
--- a/drivers/staging/comedi/proc.c
+++ b/drivers/staging/comedi/proc.c
@@ -85,6 +85,7 @@ int comedi_read_procmem(char *buf, char **start, off_t offset, int len,
 	return l;
 }
 
+#ifdef CONFIG_PROC_FS
 void comedi_proc_init(void)
 {
 	struct proc_dir_entry *comedi_proc;
@@ -98,3 +99,4 @@ void comedi_proc_cleanup(void)
 {
 	remove_proc_entry("comedi", 0);
 }
+#endif
-- 
1.6.0.3