Re: [PATCH] further __KERNEL_SYSCALLS__ removal

From: Arjan van de Ven
Date: Fri Feb 27 2004 - 13:04:29 EST


On Fri, 2004-02-27 at 18:35, Arnd Bergmann wrote:

> ===== drivers/media/dvb/frontends/alps_tdlb7.c 1.8 vs edited =====
> --- 1.8/drivers/media/dvb/frontends/alps_tdlb7.c Thu Feb 26 03:09:55 2004
> +++ edited/drivers/media/dvb/frontends/alps_tdlb7.c Thu Feb 26 23:57:05 2004
> @@ -29,8 +29,6 @@
> */
>
>
> -
> -#define __KERNEL_SYSCALLS__
> #include <linux/module.h>
> #include <linux/init.h>
> #include <linux/vmalloc.h>
> @@ -58,8 +56,6 @@
> #define SP8870_FIRMWARE_OFFSET 0x0A
>
>
> -static int errno;
> -
> static struct dvb_frontend_info tdlb7_info = {
> .name = "Alps TDLB7",
> .type = FE_OFDM,
> @@ -174,13 +170,13 @@
> loff_t filesize;
> char *dp;
>
> - fd = open(fn, 0, 0);
> + fd = sys_open(fn, 0, 0);
> if (fd == -1) {
> printk("%s: unable to open '%s'.\n", __FUNCTION__, fn);
> return -EIO;
> }
>
> - filesize = lseek(fd, 0L, 2);
> + filesize = sys_lseek(fd, 0L, 2);
> if (filesize <= 0 || filesize < SP8870_FIRMWARE_OFFSET + SP8870_FIRMWARE_SIZE) {
> printk("%s: firmware filesize to small '%s'\n", __FUNCTION__, fn);
> sys_close(fd);
> @@ -194,8 +190,8 @@
> return -EIO;
> }
>
> - lseek(fd, SP8870_FIRMWARE_OFFSET, 0);
> - if (read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) {
> + sys_lseek(fd, SP8870_FIRMWARE_OFFSET, 0);
> + if (sys_read(fd, dp, SP8870_FIRMWARE_SIZE) != SP8870_FIRMWARE_SIZE) {
> printk("%s: failed to read '%s'.\n",__FUNCTION__, fn);
> vfree(dp);
> sys_close(fd);


this is the wrong way to "fix" this; might as well leave this driver as
is until it is fixed to use request_firmware()

> ===== drivers/media/dvb/frontends/sp887x.c 1.6 vs edited =====
> --- 1.6/drivers/media/dvb/frontends/sp887x.c Thu Feb 26 03:09:55 2004
> +++ edited/drivers/media/dvb/frontends/sp887x.c Thu Feb 26 23:57:05 2004
> @@ -12,7 +12,6 @@
> next 0x4000 loaded. This may change in future versions.
> */
>
> -#define __KERNEL_SYSCALLS__
> #include <linux/kernel.h>
> #include <linux/vmalloc.h>
> #include <linux/module.h>
> @@ -68,8 +67,6 @@
> FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_RECOVER
> };
>
> -static int errno;
> -
> static
> int i2c_writebytes (struct dvb_frontend *fe, u8 addr, u8 *buf, u8 len)
> {
> @@ -216,13 +213,13 @@
>
> // Load the firmware
> set_fs(get_ds());
> - fd = open(sp887x_firmware, 0, 0);
> + fd = sys_open(sp887x_firmware, 0, 0);
> if (fd < 0) {
> printk(KERN_WARNING "%s: Unable to open firmware %s\n", __FUNCTION__,
> sp887x_firmware);
> return -EIO;
> }
> - filesize = lseek(fd, 0L, 2);
> + filesize = sys_lseek(fd, 0L, 2);
> if (filesize <= 0) {
> printk(KERN_WARNING "%s: Firmware %s is empty\n", __FUNCTION__,
> sp887x_firmware);

same here
> printk("%s: Unable to open firmware %s\n", __FUNCTION__,
> tda1004x_firmware);
> return -EIO;
> }
> - filesize = lseek(fd, 0L, 2);
> + filesize = sys_lseek(fd, 0L, 2);
> if (filesize <= 0) {
> printk("%s: Firmware %s is empty\n", __FUNCTION__,
> tda1004x_firmware);

same here

> ===== sound/isa/wavefront/wavefront_synth.c 1.13 vs edited =====
> --- 1.13/sound/isa/wavefront/wavefront_synth.c Tue Feb 25 19:44:25 2003
> +++ edited/sound/isa/wavefront/wavefront_synth.c Thu Feb 26 23:57:05 2004
> @@ -1913,11 +1913,11 @@
> return (1);
> }
>
> -#define __KERNEL_SYSCALLS__
> #include <linux/fs.h>
> #include <linux/mm.h>
> #include <linux/slab.h>
> #include <linux/unistd.h>
> +#include <linux/syscalls.h>
> #include <asm/uaccess.h>
>
> static int errno;
> @@ -1947,7 +1947,7 @@
> fs = get_fs();
> set_fs (get_ds());
>
> - if ((fd = open (path, 0, 0)) < 0) {
> + if ((fd = sys_open (path, 0, 0)) < 0) {
> snd_printk ("Unable to load \"%s\".\n",
> path);
> return 1;
> @@ -1956,7 +1956,7 @@
> while (1) {
> int x;
>
> - if ((x = read (fd, &section_length, sizeof (section_length))) !=
> + if ((x = sys_read (fd, &section_length, sizeof (section_length))) !=
> sizeof (section_length)) {
> snd_printk ("firmware read error.\n");
> goto failure;

same here
> ===== sound/oss/wavfront.c 1.15 vs edited =====
> --- 1.15/sound/oss/wavfront.c Mon Apr 21 09:32:53 2003
> +++ edited/sound/oss/wavfront.c Thu Feb 26 23:57:05 2004
> @@ -2489,11 +2489,9 @@
> }
>
> #include "os.h"
> -#define __KERNEL_SYSCALLS__
> #include <linux/fs.h>
> #include <linux/mm.h>
> #include <linux/slab.h>
> -#include <linux/unistd.h>
> #include <asm/uaccess.h>
>
> static int errno;
> @@ -2523,7 +2521,7 @@
> fs = get_fs();
> set_fs (get_ds());
>
> - if ((fd = open (path, 0, 0)) < 0) {
> + if ((fd = sys_open (path, 0, 0)) < 0) {
> printk (KERN_WARNING LOGNAME "Unable to load \"%s\".\n",
> path);
> return 1;

and here

Attachment: signature.asc
Description: This is a digitally signed message part