public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Nasty warnings on arm (+ one compile problem -- INIT_WORK related)
@ 2006-12-15 23:58 Pavel Machek
  2006-12-16  1:07 ` Al Viro
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Pavel Machek @ 2006-12-15 23:58 UTC (permalink / raw)
  To: rpurdie, lenz, kernel list, Russell King, Dirk, arminlitzel,
	pavel.urban, metan

Hi!

I get nasty warning for each file compiled:

  CC      drivers/video/sa1100fb.o
In file included from include/asm/bitops.h:23,
                 from include/linux/bitops.h:9,
                 from include/linux/thread_info.h:20,
                 from include/linux/preempt.h:9,
                 from include/linux/spinlock.h:49,
                 from include/linux/module.h:9,
                 from drivers/video/sa1100fb.c:163:
include/asm/system.h: In function `adjust_cr':
include/asm/system.h:185: warning: implicit declaration of function
`local_irq_save'
include/asm/system.h:192: warning: implicit declaration of function
`local_irq_restore'
include/asm/system.h:179: warning: unused variable `cr'

Plus compile error. It should be some search&replace I should do, but
which one?

drivers/video/sa1100fb.c:1447:49: macro "INIT_WORK" passed 3
arguments, but takes just 2
drivers/video/sa1100fb.c: In function `sa1100fb_init_fbinfo':
drivers/video/sa1100fb.c:1447: error: `INIT_WORK' undeclared (first
use in this function)
drivers/video/sa1100fb.c:1447: error: (Each undeclared identifier is
reported only once
drivers/video/sa1100fb.c:1447: error: for each function it appears
in.)
drivers/video/sa1100fb.c: At top level:
drivers/video/sa1100fb.c:1204: warning: `sa1100fb_task' defined but
not used
make[2]: *** [drivers/video/sa1100fb.o] Error 1
make[1]: *** [drivers/video] Error 2
make: *** [drivers] Error 2

        INIT_WORK(&fbi->task, sa1100fb_task, fbi);

...

/*
 * Our LCD controller task (which is called when we blank or unblank)
 * via keventd.
 */
static void sa1100fb_task(void *dummy)
{
        struct sa1100fb_info *fbi = dummy;
        u_int state = xchg(&fbi->task_state, -1);

        set_ctrlr_state(fbi, state);
}

(Or will I need to play with container_of or something? I guess I did
not pay attetion to workqueue stuff).
								Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

* Re: Nasty warnings on arm (+ one compile problem -- INIT_WORK related)
  2006-12-15 23:58 Nasty warnings on arm (+ one compile problem -- INIT_WORK related) Pavel Machek
@ 2006-12-16  1:07 ` Al Viro
  2006-12-16  1:09 ` Al Viro
  2006-12-16 12:10 ` Russell King
  2 siblings, 0 replies; 5+ messages in thread
From: Al Viro @ 2006-12-16  1:07 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rmk, rpurdie, lenz, kernel list, Russell King, Dirk, arminlitzel,
	pavel.urban, metan

On Sat, Dec 16, 2006 at 12:58:18AM +0100, Pavel Machek wrote:
> Hi!
> 
> I get nasty warning for each file compiled:
> 
>   CC      drivers/video/sa1100fb.o
> In file included from include/asm/bitops.h:23,
>                  from include/linux/bitops.h:9,
>                  from include/linux/thread_info.h:20,
>                  from include/linux/preempt.h:9,
>                  from include/linux/spinlock.h:49,
>                  from include/linux/module.h:9,
>                  from drivers/video/sa1100fb.c:163:
> include/asm/system.h: In function `adjust_cr':
> include/asm/system.h:185: warning: implicit declaration of function
> `local_irq_save'
> include/asm/system.h:192: warning: implicit declaration of function
> `local_irq_restore'
> include/asm/system.h:179: warning: unused variable `cr'

That's dealt with by the following:

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/include/asm-arm/system.h b/include/asm-arm/system.h
index e160aeb..bf44782 100644
--- a/include/asm-arm/system.h
+++ b/include/asm-arm/system.h
@@ -173,10 +173,12 @@ static inline void set_copro_access(unsi
 extern unsigned long cr_no_alignment;	/* defined in entry-armv.S */
 extern unsigned long cr_alignment;	/* defined in entry-armv.S */
 
+#include <linux/irqflags.h>
+
 #ifndef CONFIG_SMP
 static inline void adjust_cr(unsigned long mask, unsigned long set)
 {
-	unsigned long flags, cr;
+	unsigned long flags;
 
 	mask &= ~CR_A;
 
@@ -248,8 +250,6 @@ static inline void sched_cacheflush(void
 {
 }
 
-#include <linux/irqflags.h>
-
 #ifdef CONFIG_SMP
 
 #define smp_mb()		mb()

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

* Re: Nasty warnings on arm (+ one compile problem -- INIT_WORK related)
  2006-12-15 23:58 Nasty warnings on arm (+ one compile problem -- INIT_WORK related) Pavel Machek
  2006-12-16  1:07 ` Al Viro
@ 2006-12-16  1:09 ` Al Viro
  2006-12-17 12:33   ` Pavel Machek
  2006-12-16 12:10 ` Russell King
  2 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2006-12-16  1:09 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rpurdie, lenz, kernel list, Russell King, Dirk, arminlitzel,
	pavel.urban, metan

 
> Plus compile error. It should be some search&replace I should do, but
> which one?
> 
> drivers/video/sa1100fb.c:1447:49: macro "INIT_WORK" passed 3
> arguments, but takes just 2
> drivers/video/sa1100fb.c: In function `sa1100fb_init_fbinfo':
> drivers/video/sa1100fb.c:1447: error: `INIT_WORK' undeclared (first
> use in this function)
> drivers/video/sa1100fb.c:1447: error: (Each undeclared identifier is
> reported only once
> drivers/video/sa1100fb.c:1447: error: for each function it appears
> in.)
> drivers/video/sa1100fb.c: At top level:
> drivers/video/sa1100fb.c:1204: warning: `sa1100fb_task' defined but
> not used
> make[2]: *** [drivers/video/sa1100fb.o] Error 1
> make[1]: *** [drivers/video] Error 2
> make: *** [drivers] Error 2
> 
>         INIT_WORK(&fbi->task, sa1100fb_task, fbi);
> 
> ...
> 
> /*
>  * Our LCD controller task (which is called when we blank or unblank)
>  * via keventd.
>  */
> static void sa1100fb_task(void *dummy)
> {
>         struct sa1100fb_info *fbi = dummy;
>         u_int state = xchg(&fbi->task_state, -1);
> 
>         set_ctrlr_state(fbi, state);
> }
> 
> (Or will I need to play with container_of or something? I guess I did
> not pay attetion to workqueue stuff).

... and that's

static void sa1100fb_task(struct work_struct *ucking_fugly)
{
	struct sa1100fb_info *fbi = container_of(ucking_fugly,
						 struct sa1100fb_info,
						 task);

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

* Re: Nasty warnings on arm (+ one compile problem -- INIT_WORK related)
  2006-12-15 23:58 Nasty warnings on arm (+ one compile problem -- INIT_WORK related) Pavel Machek
  2006-12-16  1:07 ` Al Viro
  2006-12-16  1:09 ` Al Viro
@ 2006-12-16 12:10 ` Russell King
  2 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2006-12-16 12:10 UTC (permalink / raw)
  To: Pavel Machek
  Cc: rpurdie, lenz, kernel list, Dirk, arminlitzel, pavel.urban, metan

On Sat, Dec 16, 2006 at 12:58:18AM +0100, Pavel Machek wrote:
> I get nasty warning for each file compiled:
> 
>   CC      drivers/video/sa1100fb.o
> In file included from include/asm/bitops.h:23,
>                  from include/linux/bitops.h:9,
>                  from include/linux/thread_info.h:20,
>                  from include/linux/preempt.h:9,
>                  from include/linux/spinlock.h:49,
>                  from include/linux/module.h:9,
>                  from drivers/video/sa1100fb.c:163:
> include/asm/system.h: In function `adjust_cr':
> include/asm/system.h:185: warning: implicit declaration of function
> `local_irq_save'
> include/asm/system.h:192: warning: implicit declaration of function
> `local_irq_restore'
> include/asm/system.h:179: warning: unused variable `cr'

I know of these.  When I come around to merging next week I'll fix it
(probably by reverting the two commits.)  Until then, you'll have to
put up with it.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:

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

* Re: Nasty warnings on arm (+ one compile problem -- INIT_WORK related)
  2006-12-16  1:09 ` Al Viro
@ 2006-12-17 12:33   ` Pavel Machek
  0 siblings, 0 replies; 5+ messages in thread
From: Pavel Machek @ 2006-12-17 12:33 UTC (permalink / raw)
  To: Al Viro; +Cc: kernel list


> > (Or will I need to play with container_of or something? I guess I did
> > not pay attetion to workqueue stuff).
> 
> ... and that's
> 
> static void sa1100fb_task(struct work_struct *ucking_fugly)
> {
> 	struct sa1100fb_info *fbi = container_of(ucking_fugly,
> 						 struct sa1100fb_info,
> 						 task);

Thanks, fixed and sent patch to rmk. I made the variable name shorter,
I hope that's okay with you ;-).
									Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2006-12-17 12:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-15 23:58 Nasty warnings on arm (+ one compile problem -- INIT_WORK related) Pavel Machek
2006-12-16  1:07 ` Al Viro
2006-12-16  1:09 ` Al Viro
2006-12-17 12:33   ` Pavel Machek
2006-12-16 12:10 ` Russell King

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