Patch?: linux-2.5.59/sound/soundcore.c referenced non-existant errno variable

From: Adam J. Richter (adam@yggdrasil.com)
Date: Fri Jan 17 2003 - 18:57:17 EST


        linux-2.5.59/sound/sound_firmware.c attempts to use the
user level system call interface from the kernel, which I understand
works on i386 and perhaps all architectures, but requires a variable
named "errno." (Actually, it mixed things like close() and
sys_close(), but that's beside the point.)

        I could just declare a "static int errno;" in the file, but I
thought it might be helpful to use filp_open, vfs_read and filp_close
instead, which shaves a few cpu cycles and avoids the need to allocate
a file descriptor number. I think that this also seems to be the
convention for other kernel facilities that want to open their own
files briefly. I've attached a patch below. The patch shrinks
sound_firmware.c by six lines. I have only verified that the patch
compiles and that the soundcore module now loads.

        Comments are welcome. If this patch looks good, then I'd
appreciate it if someone more connected to sound development would
integrate it and forward it to Linus.

-- 
Adam J. Richter     __     ______________   575 Oroville Road
adam@yggdrasil.com     \ /                  Milpitas, California 95035
+1 408 309-6081         | g g d r a s i l   United States of America
                         "Free Software For The Rest Of Us."


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:17 EST