public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch] UML: Fix another build error
@ 2008-04-12 15:39 WANG Cong
  2008-04-14 15:43 ` Jeff Dike
  0 siblings, 1 reply; 5+ messages in thread
From: WANG Cong @ 2008-04-12 15:39 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, Jeff Dike, user-mode-linux-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1610 bytes --]


This patch fixes the following build error.

  CC      arch/um/drivers/mconsole_kern.o
/home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’
/home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here
make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
make: *** [sub-make] Error 2

Compile testing passed.

Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: WANG Cong <wangcong@zeuux.org>

---
 arch/um/drivers/mconsole_kern.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/um/drivers/mconsole_kern.c b/arch/um/drivers/mconsole_kern.c
index 19d579d..e94ccb8 100644
--- a/arch/um/drivers/mconsole_kern.c
+++ b/arch/um/drivers/mconsole_kern.c
@@ -330,9 +330,12 @@ void mconsole_stop(struct mc_request *req)
 	mconsole_reply(req, "", 0, 0);
 }
 
-static DEFINE_SPINLOCK(mc_devices_lock);
 static LIST_HEAD(mconsole_devices);
 
+#ifdef CONFIG_MCONSOLE
+
+static DEFINE_SPINLOCK(mc_devices_lock);
+
 void mconsole_register_dev(struct mc_device *new)
 {
 	spin_lock(&mc_devices_lock);
@@ -340,6 +343,7 @@ void mconsole_register_dev(struct mc_device *new)
 	list_add(&new->list, &mconsole_devices);
 	spin_unlock(&mc_devices_lock);
 }
+#endif
 
 static struct mc_device *mconsole_find_dev(char *name)
 {
-- 
1.5.2.4

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* Re: [Patch] UML: Fix another build error
  2008-04-12 15:39 [Patch] UML: Fix " WANG Cong
@ 2008-04-14 15:43 ` Jeff Dike
  2008-04-16  5:41   ` WANG Cong
  0 siblings, 1 reply; 5+ messages in thread
From: Jeff Dike @ 2008-04-14 15:43 UTC (permalink / raw)
  To: WANG Cong; +Cc: linux-kernel, akpm, user-mode-linux-devel

On Sat, Apr 12, 2008 at 11:39:14PM +0800, WANG Cong wrote:
> 
> This patch fixes the following build error.
> 
>   CC      arch/um/drivers/mconsole_kern.o
> /home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’
> /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here
> make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
> make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
> make: *** [sub-make] Error 2

This one is fishy.  For one thing, it looks like you reproduce this
with !CONFIG_MCONSOLE, but I just successfully built a
!CONFIG_MCONSOLE UML.

Second, the arch/um/drivers/Makefile looks to me (and the build log
confirms) that mconsole_kern.c isn't compiled with !CONFIG_MCONSOLE.

Third, you should ask yourself if there might be a deeper problem that
needs fixing if you find yourself putting #ifdef CONFIG_FOO in files
which implement FOO.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

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

* Re: [Patch] UML: Fix another build error
  2008-04-14 15:43 ` Jeff Dike
@ 2008-04-16  5:41   ` WANG Cong
  0 siblings, 0 replies; 5+ messages in thread
From: WANG Cong @ 2008-04-16  5:41 UTC (permalink / raw)
  To: jdike; +Cc: linux-kernel, akpm, user-mode-linux-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: Text/Plain; charset=utf-8, Size: 1369 bytes --]

From: Jeff Dike <jdike@addtoit.com>
Date: Mon, 14 Apr 2008 11:43:42 -0400
> On Sat, Apr 12, 2008 at 11:39:14PM +0800, WANG Cong wrote:
> > 
> > This patch fixes the following build error.
> > 
> >   CC      arch/um/drivers/mconsole_kern.o
> > /home/wangcong/projects/linux-2.6/arch/um/drivers/mconsole_kern.c:337: error: redefinition of ‘mconsole_register_dev’
> > /home/wangcong/projects/linux-2.6/arch/um/include/mconsole_kern.h:47: error: previous definition of ‘mconsole_register_dev’ was here
> > make[2]: *** [arch/um/drivers/mconsole_kern.o] Error 1
> > make[1]: *** [arch/um/drivers/mconsole_kern.ko] Error 2
> > make: *** [sub-make] Error 2
> 
> This one is fishy.  For one thing, it looks like you reproduce this
> with !CONFIG_MCONSOLE, but I just successfully built a
> !CONFIG_MCONSOLE UML.
> 
> Second, the arch/um/drivers/Makefile looks to me (and the build log
> confirms) that mconsole_kern.c isn't compiled with !CONFIG_MCONSOLE.
> 
> Third, you should ask yourself if there might be a deeper problem that
> needs fixing if you find yourself putting #ifdef CONFIG_FOO in files
> which implement FOO.

Thanks for teaching this!

I will try if it's possible to reproduce this.


 Cong
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

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

* [Patch] uml: fix another build error
@ 2008-07-22 17:41 WANG Cong
  2008-07-23 15:48 ` Jeff Dike
  0 siblings, 1 reply; 5+ messages in thread
From: WANG Cong @ 2008-07-22 17:41 UTC (permalink / raw)
  To: LKML; +Cc: jdike, user-mode-linux-devel


Fixed this error:

  CC      arch/um/drivers/vde_user.o
  /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c: In
function ‘vde_init_libstuff’:
/home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81:
error: implicit declaration of function ‘kmalloc’
/home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81:
warning: assignment makes pointer from integer without a cast
make[2]: *** [arch/um/drivers/vde_user.o] Error 1
make[1]: *** [arch/um/drivers/vde_user.ko] Error 2
make: *** [sub-make] Error 2

Signed-off-by: WANG Cong <wangcong@zeuux.org>
Cc: jdike@addtoit.com

---
diff --git a/arch/um/drivers/vde_user.c b/arch/um/drivers/vde_user.c
index 56533db..744eacf 100644
--- a/arch/um/drivers/vde_user.c
+++ b/arch/um/drivers/vde_user.c
@@ -78,7 +78,7 @@ void vde_init_libstuff(struct vde_data *vpri, struct vde_init *init)
 {
 	struct vde_open_args *args;
 
-	vpri->args = kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL);
+	vpri->args = uml_kmalloc(sizeof(struct vde_open_args), UM_GFP_KERNEL);
 	if (vpri->args == NULL) {
 		printk(UM_KERN_ERR "vde_init_libstuff - vde_open_args "
 		       "allocation failed");

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

* Re: [Patch] uml: fix another build error
  2008-07-22 17:41 [Patch] uml: fix another build error WANG Cong
@ 2008-07-23 15:48 ` Jeff Dike
  0 siblings, 0 replies; 5+ messages in thread
From: Jeff Dike @ 2008-07-23 15:48 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML, user-mode-linux-devel

On Tue, Jul 22, 2008 at 06:41:52PM +0100, WANG Cong wrote:
> 
> Fixed this error:
> 
>   CC      arch/um/drivers/vde_user.o
>   /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c: In
> function ‘vde_init_libstuff’:
> /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81:
> error: implicit declaration of function ‘kmalloc’
> /home/wangcong/Projects/linux-2.6/arch/um/drivers/vde_user.c:81:
> warning: assignment makes pointer from integer without a cast
> make[2]: *** [arch/um/drivers/vde_user.o] Error 1
> make[1]: *** [arch/um/drivers/vde_user.ko] Error 2
> make: *** [sub-make] Error 2

Thanks - added to the queue.

       	       	  Jeff

-- 
Work email - jdike at linux dot intel dot com

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

end of thread, other threads:[~2008-07-23 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-22 17:41 [Patch] uml: fix another build error WANG Cong
2008-07-23 15:48 ` Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2008-04-12 15:39 [Patch] UML: Fix " WANG Cong
2008-04-14 15:43 ` Jeff Dike
2008-04-16  5:41   ` WANG Cong

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