Skip to contentSkip to conversation

v2.6.36-rc3: UML compile error in hostaudio_kern.c

uml-devel Toralf Förster 2 participants 2 messages Aug 29, 2010 – Oct 11, 2010 User-mode Linux (UML)

lore
Share & tools
lore
#0 lore raw

Hello,

I get with the attached config :

...

  CC      arch/um/drivers/hostaudio_kern.o
  CC      arch/um/kernel/tlb.o
  CC      arch/um/os-Linux/start_up.o

arch/um/drivers/hostaudio_kern.c: In function ‘hostaudio_open’:
arch/um/drivers/hostaudio_kern.c:204: error: ‘__param_dsp’ undeclared (first use in this function)
arch/um/drivers/hostaudio_kern.c:204: error: (Each undeclared identifier is reported only once
arch/um/drivers/hostaudio_kern.c:204: error: for each function it appears in.) arch/um/drivers/hostaudio_kern.c: In function ‘hostmixer_open_mixdev’:
arch/um/drivers/hostaudio_kern.c:265: error: ‘__param_mixer’ undeclared (first use in this function)
arch/um/drivers/hostaudio_kern.c:272: error: ‘__param_dsp’ undeclared (first use in this function)
make[1]: *** [arch/um/drivers/hostaudio_kern.o] Error 1
make: *** [arch/um/drivers] Error 2
make: *** Waiting for unfinished jobs....

Signature · 4 lines
MfG/Kind regards
Toralf Förster

pgp finger print: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 7DB6 9DA3

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d

_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#1 lore raw
Quoted 1 line · Toralf Förster

I get with the attached config :

the attached config is empty... but I have stepped onto the same bug. The problem happens when hostaudio is linked to the kernel (it is not a module).

Quoted 2 lines

arch/um/drivers/hostaudio_kern.c:204: error: ‘__param_dsp’ undeclared (first

The problem is that dsp and mixer are defined as module_param only when hostaudio is a module, so __param_dsp is undefined for kparam_block_sysfs_write when hostaudio is not a module.

The following patch seems to solve the problem.

renzo
----

um/drivers/hostaudio_kern.c renamed from um/drivers/hostaudio_kern.c.orig +16 -0
@@ -187,10 +187,14 @@
 	int ret;
 
 #ifdef DEBUG
+#ifdef MODULE
 	kparam_block_sysfs_write(dsp);
+#endif
 	printk(KERN_DEBUG "hostaudio: open called (host: %s)\n", dsp);
+#ifdef MODULE
 	kparam_unblock_sysfs_write(dsp);
 #endif
+#endif
 
 	state = kmalloc(sizeof(struct hostaudio_state), GFP_KERNEL);
 	if (state == NULL)
@@ -201,11 +205,15 @@
 	if (file->f_mode & FMODE_WRITE)
 		w = 1;
 
+#ifdef MODULE
 	kparam_block_sysfs_write(dsp);
+#endif
 	lock_kernel();
 	ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
 	unlock_kernel();
+#ifdef MODULE
 	kparam_unblock_sysfs_write(dsp);
+#endif
 
 	if (ret < 0) {
 		kfree(state);
@@ -262,17 +270,25 @@
 	if (file->f_mode & FMODE_WRITE)
 		w = 1;
 
+#ifdef MODULE
 	kparam_block_sysfs_write(mixer);
+#endif
 	lock_kernel();
 	ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
 	unlock_kernel();
+#ifdef MODULE
 	kparam_unblock_sysfs_write(mixer);
+#endif
 
 	if (ret < 0) {
+#ifdef MODULE
 		kparam_block_sysfs_write(dsp);
+#endif
 		printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
 		       "err = %d\n", dsp, -ret);
+#ifdef MODULE
 		kparam_unblock_sysfs_write(dsp);
+#endif
 		kfree(state);
 		return ret;
 	}

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. Spend less time writing and rewriting code and more time creating great experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel