lkml.org 
[lkml]   [1996]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Compile errors in 2.1.5
Nir Soffer wrote:
>
> Hiyas :)
> This is the list of errors I get on compiling 2.1.5
> (most of it snipped, just the errors I found are here, if someone want a
> whole stdout and stderr dump, let me know)
>
> I'll try fixing the errors by myself - and if I can - I'll submit a patch.
>
> make[3]: Entering directory `/usr/src/linux/drivers/sound/lowlevel'
> gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
> -fomit-fld -m elf_i386 -r -o lowlevel.o init.o
> make[3]: Leaving directory `/usr/src/linux/drivers/sound/lowlevel'
> gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
> -fomit-faudio.c:247: macro `copy_from_user' used with too many (6) args
> audio.c:384: macro `get_user' used with just one arg
> audio.c: In function `audio_write':
> audio.c:246: parse error before `('
> audio.c: In function `audio_ioctl':
> audio.c:384: parse error before `)'
> audio.c:384: parse error before `)'
> audio.c:384: parse error before `)'
> audio.c:384: parse error before `)'
> audio.c:384: parse error before `)'
> make[2]: *** [audio.o] Error 1
> make[2]: Leaving directory `/usr/src/linux/drivers/sound'
> make[1]: *** [modules] Error 2
> make[1]: Leaving directory `/usr/src/linux/drivers'

- I correct this in the patch below: change ... = get_buffer(...) by
get_buffer(a_var, ...) ).
(All sound driver may be corrected now except dmasound.c)

- I found a strange error when I compile patmgr.c:
gcc -D__KERNEL__ -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2
-fomit-frame-pointer -fno-strength-reduce -pipe -m486 -malign-loops=2
-malign-jumps=2 -malign-functions=2 -DCPU=586 -DMODULE -DMODVERSIONS
-include /usr/src/linux/include/linux/modversions.h -c -o patmgr.o
patmgr.c
patmgr.c: In function `pmgr_read':
patmgr.c:122: fixed or forbidden register was spilled.
This may be due to a compiler bug or to impossible asm
statements or clauses.

I added:
unsigned long __cu_from = (unsigned long) from;
in copy_to_user (include/asm-i386/segment.h). It seems to work after
that.

- I correct IPX too. (get_fs_byte -> get_user)

Bye.

Guilhem.

P.S.: If I'm wrong for the patmgr.c problem, please accept my apologies.
--
-----------------------------------|
| /-\ LAVAUX Yves & Guilhem |
| / \ /-\ |
|-/ \ / \ /------------|
| \ / \-/ |
| \-/ ylavaux@pratique.fr |
-----------------------------------|
diff -u --recursive linux-2.1.5/drivers/sound/ad1848.c linux/drivers/sound/ad1848.c
--- linux-2.1.5/drivers/sound/ad1848.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/ad1848.c Sat Oct 19 13:49:51 1996
@@ -469,6 +469,7 @@
ad1848_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
{
ad1848_info *devc = mixer_devs[dev]->devc;
+ int i;

if (((cmd >> 8) & 0xff) == 'M')
{
@@ -477,11 +478,13 @@
switch (cmd & 0xff)
{
case SOUND_MIXER_RECSRC:
- return snd_ioctl_return ((int *) arg, ad1848_set_recmask (devc, get_user ((int *) arg)));
+ get_user(i, (int *)addr);
+ return snd_ioctl_return ((int *) arg, ad1848_set_recmask (devc, i));
break;

default:
- return snd_ioctl_return ((int *) arg, ad1848_mixer_set (devc, cmd & 0xff, get_user ((int *) arg)));
+ get_user(i, (int *)addr);
+ return snd_ioctl_return ((int *) arg, ad1848_mixer_set (devc, cmd & 0xff, i));
}
else
switch (cmd & 0xff) /*
diff -u --recursive linux-2.1.5/drivers/sound/audio.c linux/drivers/sound/audio.c
--- linux-2.1.5/drivers/sound/audio.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/audio.c Sat Oct 19 13:00:22 1996
@@ -236,15 +236,15 @@
if (l > (buf_size - buf_ptr))
l = (buf_size - buf_ptr);

- if (!audio_devs[dev]->d->copy_from_user)
+ if (!audio_devs[dev]->d->audio_copy_from_user)
{ /*
* No device specific copy routine
*/
copy_from_user (&dma_buf[buf_ptr], &(buf)[p], l);
}
else
- audio_devs[dev]->d->copy_from_user (dev,
- dma_buf, buf_ptr, buf, p, l);
+ audio_devs[dev]->d->audio_copy_from_user (dev,
+ dma_buf, buf_ptr, buf, p, l);

if (local_conversion[dev] == AFMT_MU_LAW)
{
@@ -341,6 +341,7 @@
audio_ioctl (int dev, struct fileinfo *file,
unsigned int cmd, caddr_t arg)
{
+ int i;

dev = dev >> 4;

@@ -381,7 +382,8 @@
break;

case SNDCTL_DSP_SETFMT:
- return snd_ioctl_return ((int *) arg, set_format (dev, get_user ((int *) arg)));
+ get_user (i,(int *)arg);
+ return snd_ioctl_return ((int *) arg, set_format (dev, i));

case SNDCTL_DSP_GETISPACE:
if (!(audio_devs[dev]->open_mode & OPEN_READ))
diff -u --recursive linux-2.1.5/drivers/sound/dev_table.h linux/drivers/sound/dev_table.h
--- linux-2.1.5/drivers/sound/dev_table.h Thu Oct 10 19:34:32 1996
+++ linux/drivers/sound/dev_table.h Fri Oct 18 20:16:22 1996
@@ -148,8 +148,8 @@
void (*reset) (int dev);
void (*halt_xfer) (int dev);
int (*local_qlen)(int dev);
- void (*copy_from_user)(int dev, char *localbuf, int localoffs,
- const char *userbuf, int useroffs, int len);
+ void (*audio_copy_from_user)(int dev, char *localbuf, int localoffs,
+ const char *userbuf, int useroffs, int len);
void (*halt_input) (int dev);
void (*halt_output) (int dev);
void (*trigger) (int dev, int bits);
diff -u --recursive linux-2.1.5/drivers/sound/dmabuf.c linux/drivers/sound/dmabuf.c
--- linux-2.1.5/drivers/sound/dmabuf.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/dmabuf.c Sat Oct 19 13:00:22 1996
@@ -762,13 +762,15 @@
struct dma_buffparms *dmap_out = audio_devs[dev]->dmap_out;
struct dma_buffparms *dmap_in = audio_devs[dev]->dmap_in;
long larg = (long) arg;
+ int i;

switch (cmd)
{
case SOUND_PCM_WRITE_RATE:
if (local)
return audio_devs[dev]->d->set_speed (dev, larg);
- return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_speed (dev, get_user ((int *) arg)));
+ get_user (i,(int *)arg);
+ return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_speed (dev, i));

case SOUND_PCM_READ_RATE:
if (local)
@@ -778,12 +780,14 @@
case SNDCTL_DSP_STEREO:
if (local)
return audio_devs[dev]->d->set_channels (dev, larg + 1) - 1;
- return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_channels (dev, get_user ((int *) arg) + 1) - 1);
+ get_user (i,(int *)arg);
+ return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_channels (dev, i + 1) - 1);

case SOUND_PCM_WRITE_CHANNELS:
if (local)
return audio_devs[dev]->d->set_channels (dev, (short) larg);
- return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_channels (dev, get_user ((int *) arg)));
+ get_user (i,(int *)arg);
+ return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_channels (dev, i));

case SOUND_PCM_READ_CHANNELS:
if (local)
@@ -793,7 +797,8 @@
case SNDCTL_DSP_SAMPLESIZE:
if (local)
return audio_devs[dev]->d->set_bits (dev, larg);
- return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_bits (dev, get_user ((int *) arg)));
+ get_user (i,(int *)arg);
+ return snd_ioctl_return ((int *) arg, audio_devs[dev]->d->set_bits (dev, i));

case SOUND_PCM_READ_BITS:
if (local)
@@ -827,9 +832,11 @@

case SNDCTL_DSP_SUBDIVIDE:
{
- int fact = get_user ((int *) arg);
+ int fact;
int ret;

+ get_user (fact, (int *)arg);
+
ret = dma_subdivide (dev, dmap_out, arg, fact);
if (ret < 0)
return ret;
@@ -851,9 +858,11 @@

case SNDCTL_DSP_SETFRAGMENT:
{
- int fact = get_user ((int *) arg);
+ int fact;
int ret;

+ get_user (fact,(int *)arg);
+
ret = dma_set_fragment (dev, dmap_out, arg, fact);
if (ret < 0)
return ret;
@@ -930,8 +939,11 @@
{
unsigned long flags;

- int bits = get_user ((int *) arg) & audio_devs[dev]->open_mode;
+ int bits;
int changed;
+
+ get_user (bits, (int *)arg);
+ bits &= audio_devs[dev]->open_mode;

if (audio_devs[dev]->d->trigger == NULL)
return -(EINVAL);
diff -u --recursive linux-2.1.5/drivers/sound/gus_wave.c linux/drivers/sound/gus_wave.c
--- linux-2.1.5/drivers/sound/gus_wave.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/gus_wave.c Sat Oct 19 13:53:23 1996
@@ -2190,12 +2190,15 @@
static int
gus_audio_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
{
+ int i;
+
switch (cmd)
{
case SOUND_PCM_WRITE_RATE:
if (local)
return gus_audio_set_speed ((int) arg);
- return snd_ioctl_return ((int *) arg, gus_audio_set_speed (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, gus_audio_set_speed (i));
break;

case SOUND_PCM_READ_RATE:
@@ -2207,13 +2210,15 @@
case SNDCTL_DSP_STEREO:
if (local)
return gus_audio_set_channels ((int) arg + 1) - 1;
- return snd_ioctl_return ((int *) arg, gus_audio_set_channels (get_user ((int *) arg) + 1) - 1);
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, gus_audio_set_channels (i + 1) - 1);
break;

case SOUND_PCM_WRITE_CHANNELS:
if (local)
return gus_audio_set_channels ((int) arg);
- return snd_ioctl_return ((int *) arg, gus_audio_set_channels (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, gus_audio_set_channels (i));
break;

case SOUND_PCM_READ_CHANNELS:
@@ -2225,7 +2230,8 @@
case SNDCTL_DSP_SETFMT:
if (local)
return gus_audio_set_bits ((int) arg);
- return snd_ioctl_return ((int *) arg, gus_audio_set_bits (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, gus_audio_set_bits (i));
break;

case SOUND_PCM_READ_BITS:
@@ -3046,7 +3052,8 @@
switch (cmd & 0xff)
{
case SOUND_MIXER_RECSRC:
- gus_recmask = get_user ((int *) arg) & MIX_DEVS;
+ get_user (gus_recmask, (int *)arg);
+ gus_recmask &= MIX_DEVS;
if (!(gus_recmask & (SOUND_MASK_MIC | SOUND_MASK_LINE)))
gus_recmask = SOUND_MASK_MIC;
/* Note! Input volumes are updated during next open for recording */
@@ -3055,8 +3062,10 @@

case SOUND_MIXER_MIC:
{
- int vol = get_user ((int *) arg) & 0xff;
+ int vol;

+ get_user (vol, (int *)arg);
+ vol &= 0xff;
if (vol < 0)
vol = 0;
if (vol > 100)
@@ -3069,8 +3078,10 @@

case SOUND_MIXER_LINE:
{
- int vol = get_user ((int *) arg) & 0xff;
+ int vol

+ get_user (vol, (int *)arg);
+ vol &= 0xff;
if (vol < 0)
vol = 0;
if (vol > 100)
@@ -3082,7 +3093,8 @@
break;

case SOUND_MIXER_PCM:
- gus_pcm_volume = get_user ((int *) arg) & 0xff;
+ get_user (gus_pcm_volume, (int *)arg);
+ gus_pcm_volume &= 0xff;
if (gus_pcm_volume < 0)
gus_pcm_volume = 0;
if (gus_pcm_volume > 100)
@@ -3095,7 +3107,8 @@
{
int voice;

- gus_wave_volume = get_user ((int *) arg) & 0xff;
+ get_user (gus_wave_volume, (int *) arg);
+ gus_wave_volume &= 0xff;

if (gus_wave_volume < 0)
gus_wave_volume = 0;
diff -u --recursive linux-2.1.5/drivers/sound/ics2101.c linux/drivers/sound/ics2101.c
--- linux-2.1.5/drivers/sound/ics2101.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/ics2101.c Sat Oct 19 14:08:03 1996
@@ -128,23 +128,28 @@
break;

case SOUND_MIXER_MIC:
- return snd_ioctl_return ((int *) arg, set_volumes (DEV_MIC, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_volumes (DEV_MIC, i));
break;

case SOUND_MIXER_CD:
- return snd_ioctl_return ((int *) arg, set_volumes (DEV_CD, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_volumes (DEV_CD, i));
break;

case SOUND_MIXER_LINE:
- return snd_ioctl_return ((int *) arg, set_volumes (DEV_LINE, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_volumes (DEV_LINE, i));
break;

case SOUND_MIXER_SYNTH:
- return snd_ioctl_return ((int *) arg, set_volumes (DEV_GF1, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_volumes (DEV_GF1, i));
break;

case SOUND_MIXER_VOLUME:
- return snd_ioctl_return ((int *) arg, set_volumes (DEV_VOL, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_volumes (DEV_VOL, i));
break;

default:
diff -u --recursive linux-2.1.5/drivers/sound/lowlevel/aci.c linux/drivers/sound/lowlevel/aci.c
--- linux-2.1.5/drivers/sound/lowlevel/aci.c Sat Jul 6 15:07:37 1996
+++ linux/drivers/sound/lowlevel/aci.c Sat Oct 19 14:04:15 1996
@@ -290,7 +290,7 @@
int vol, ret;
unsigned param;

- param = get_user((int *) arg);
+ get_user(param, (int *) arg);
/* left channel */
vol = param & 0xff;
if (vol > 100) vol = 100;
@@ -316,8 +316,11 @@

/* handle solo mode control */
if (cmd == SOUND_MIXER_PRIVATE1) {
- if (get_user((int *) arg) >= 0) {
- aci_solo = !!get_user((int *) arg);
+ int i;
+
+ get_user (i, (int *) arg));
+ if (i >= 0) {
+ aci_solo = !!i;
if (write_cmd(0xd2, aci_solo)) return -EIO;
} else if (aci_version >= 0xb0) {
if ((status = read_general_status()) < 0) return -EIO;
@@ -347,7 +350,8 @@
case SOUND_MIXER_LINE2: /* AUX2 */
return setvolume(arg, 0x3e, 0x36);
case SOUND_MIXER_IGAIN: /* MIC pre-amp */
- vol = get_user((int *) arg) & 0xff;
+ get_user(vol, (int *) arg);
+ vol &= 0xff;
if (vol > 100) vol = 100;
vol = SCALE(100, 3, vol);
if (write_cmd(0x03, vol)) return -EIO;
diff -u --recursive linux-2.1.5/drivers/sound/midi_synth.c linux/drivers/sound/midi_synth.c
--- linux-2.1.5/drivers/sound/midi_synth.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/midi_synth.c Sat Oct 19 13:00:23 1996
@@ -537,7 +537,7 @@
{
unsigned char data;

- data = get_fs_byte (&((addr)[hdr_size + i]));
+ get_user (data, &((addr)[hdr_size + i]));

eox_seen = (i > 0 && data & 0x80); /* End of sysex */

diff -u --recursive linux-2.1.5/drivers/sound/midibuf.c linux/drivers/sound/midibuf.c
--- linux-2.1.5/drivers/sound/midibuf.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/midibuf.c Sat Oct 19 13:00:23 1996
@@ -473,7 +473,7 @@
{

case SNDCTL_MIDI_PRETIME:
- val = (int) get_user ((int *) arg);
+ get_user (val, (int *) arg);
if (val < 0)
val = 0;

diff -u --recursive linux-2.1.5/drivers/sound/mpu401.c linux/drivers/sound/mpu401.c
--- linux-2.1.5/drivers/sound/mpu401.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/mpu401.c Sat Oct 19 13:56:54 1996
@@ -790,7 +790,8 @@
printk ("MPU-401: Intelligent mode not supported by the HW\n");
return -(EINVAL);
}
- set_uart_mode (dev, devc, !get_user ((int *) arg));
+ get_user (i, (int *)arg);
+ set_uart_mode (dev, devc, !i);
return 0;
break;

@@ -1585,13 +1586,16 @@
unsigned int command, caddr_t arg)
{
int midi_dev = sound_timer_devs[dev]->devlink;
+ int i;

switch (command)
{
case SNDCTL_TMR_SOURCE:
{
- int parm = (int) get_user ((int *) arg) & timer_caps;
+ int parm;

+ get_user (parm, (int *)arg);
+ parm &= timer_caps;
if (parm != 0)
{
timer_mode = parm;
@@ -1628,8 +1632,9 @@

case SNDCTL_TMR_TIMEBASE:
{
- int val = (int) get_user ((int *) arg);
+ int val;

+ get_user(val, (int *)arg);
if (val)
set_timebase (midi_dev, val);

@@ -1639,9 +1644,10 @@

case SNDCTL_TMR_TEMPO:
{
- int val = (int) get_user ((int *) arg);
+ int val;
int ret;

+ get_user (val, (int *)arg);
if (val)
{
if (val < 8)
@@ -1662,14 +1668,15 @@
break;

case SNDCTL_SEQ_CTRLRATE:
- if (get_user ((int *) arg) != 0) /* Can't change */
+ get_user (i, (int *)arg);
+ if (i != 0) /* Can't change */
return -(EINVAL);

return snd_ioctl_return ((int *) arg, ((curr_tempo * curr_timebase) + 30) / 60);
break;

case SNDCTL_TMR_METRONOME:
- metronome_mode = (int) get_user ((int *) arg);
+ get_user (metronome_mode, (int *) arg);
setup_metronome (midi_dev);
return 0;
break;
diff -u --recursive linux-2.1.5/drivers/sound/pas2_mixer.c linux/drivers/sound/pas2_mixer.c
--- linux-2.1.5/drivers/sound/pas2_mixer.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/pas2_mixer.c Sat Oct 19 13:59:31 1996
@@ -218,8 +218,9 @@

if (cmd == SOUND_MIXER_PRIVATE1) /* Set loudness bit */
{
- int level = get_user ((int *) arg);
+ int level;

+ get_user (level, (int *)arg);
if (level == -1) /* Return current settings */
{
if (mode_control & 0x04)
@@ -240,8 +241,9 @@

if (cmd == SOUND_MIXER_PRIVATE2) /* Set enhance bit */
{
- int level = get_user ((int *) arg);
+ int level;

+ get_user(level, (int *)arg);
if (level == -1) /* Return current settings */
{
if (!(mode_control & 0x03))
@@ -269,8 +271,9 @@

if (cmd == SOUND_MIXER_PRIVATE3) /* Set mute bit */
{
- int level = get_user ((int *) arg);
+ int level;

+ get_user (level, (int *)arg);
if (level == -1) /* Return current settings */
{
return snd_ioctl_return ((int *) arg,
@@ -292,9 +295,12 @@

if (((cmd >> 8) & 0xff) == 'M')
{
- if (_IOC_DIR (cmd) & _IOC_WRITE)
- return snd_ioctl_return ((int *) arg, pas_mixer_set (cmd & 0xff, get_user ((int *) arg)));
- else
+ if (_IOC_DIR (cmd) & _IOC_WRITE) {
+ int i;
+
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, pas_mixer_set (cmd & 0xff, i));
+ } else
{ /*
* Read parameters
*/
diff -u --recursive linux-2.1.5/drivers/sound/pas2_pcm.c linux/drivers/sound/pas2_pcm.c
--- linux-2.1.5/drivers/sound/pas2_pcm.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/pas2_pcm.c Sat Oct 19 14:01:38 1996
@@ -149,6 +149,7 @@
static int
pas_audio_ioctl (int dev, unsigned int cmd, caddr_t arg, int local)
{
+ int i;
DEB (printk ("pas2_pcm.c: static int pas_audio_ioctl(unsigned int cmd = %X, unsigned int arg = %X)\n", cmd, arg));

switch (cmd)
@@ -156,7 +157,8 @@
case SOUND_PCM_WRITE_RATE:
if (local)
return pcm_set_speed ((int) arg);
- return snd_ioctl_return ((int *) arg, pcm_set_speed (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, pcm_set_speed (i));
break;

case SOUND_PCM_READ_RATE:
@@ -168,13 +170,15 @@
case SNDCTL_DSP_STEREO:
if (local)
return pcm_set_channels ((int) arg + 1) - 1;
- return snd_ioctl_return ((int *) arg, pcm_set_channels (get_user ((int *) arg) + 1) - 1);
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, pcm_set_channels (i + 1) - 1);
break;

case SOUND_PCM_WRITE_CHANNELS:
if (local)
return pcm_set_channels ((int) arg);
- return snd_ioctl_return ((int *) arg, pcm_set_channels (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, pcm_set_channels (i));
break;

case SOUND_PCM_READ_CHANNELS:
@@ -186,7 +190,8 @@
case SNDCTL_DSP_SETFMT:
if (local)
return pcm_set_bits ((int) arg);
- return snd_ioctl_return ((int *) arg, pcm_set_bits (get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, pcm_set_bits (i));
break;

case SOUND_PCM_READ_BITS:
@@ -197,9 +202,10 @@
case SOUND_PCM_WRITE_FILTER: /*
* NOT YET IMPLEMENTED
*/
- if (get_user ((int *) arg) > 1)
+ get_user (i, (int *)arg);
+ if (i > 1)
return -(EINVAL);
- pcm_filter = get_user ((int *) arg);
+ pcm_filter = i;
break;

case SOUND_PCM_READ_FILTER:
diff -u --recursive linux-2.1.5/drivers/sound/patmgr.c linux/drivers/sound/patmgr.c
--- linux-2.1.5/drivers/sound/patmgr.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/patmgr.c Sat Oct 19 13:00:23 1996
@@ -104,7 +104,10 @@

if (mbox[dev] && msg_direction[dev] == A_TO_S)
{
+/*
copy_to_user (&(buf)[0], (char *) mbox[dev], count);
+*/
+ copy_to_user(buf, (unsigned long)(mbox[dev]), count);
msg_direction[dev] = 0;
ok = 1;
}
diff -u --recursive linux-2.1.5/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c
--- linux-2.1.5/drivers/sound/sb_mixer.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/sb_mixer.c Sat Oct 19 13:00:23 1996
@@ -300,6 +300,7 @@
sb_mixer_ioctl (int dev, unsigned int cmd, caddr_t arg)
{
sb_devc *devc = mixer_devs[dev]->devc;
+ int i;

if (((cmd >> 8) & 0xff) == 'M')
{
@@ -307,12 +308,14 @@
switch (cmd & 0xff)
{
case SOUND_MIXER_RECSRC:
- return snd_ioctl_return ((int *) arg, set_recmask (devc, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, set_recmask (devc, i));
break;

default:

- return snd_ioctl_return ((int *) arg, sb_mixer_set (devc, cmd & 0xff, get_user ((int *) arg)));
+ get_user (i, (int *)arg);
+ return snd_ioctl_return ((int *) arg, sb_mixer_set (devc, cmd & 0xff, i));
}
else
switch (cmd & 0xff)
diff -u --recursive linux-2.1.5/drivers/sound/sequencer.c linux/drivers/sound/sequencer.c
--- linux-2.1.5/drivers/sound/sequencer.c Sat Oct 19 14:11:43 1996
+++ linux/drivers/sound/sequencer.c Sat Oct 19 13:00:23 1996
@@ -1518,6 +1518,7 @@
{
int midi_dev, orig_dev;
int mode = file->mode & O_ACCMODE;
+ int i;

orig_dev = dev = dev >> 4;

@@ -1544,7 +1545,7 @@

if (seq_mode != SEQ_2)
return -(EINVAL);
- pending_timer = get_user ((int *) arg);
+ get_user (pending_timer, (int *)arg);

if (pending_timer < 0 || pending_timer >= num_sound_timers)
{
@@ -1591,7 +1592,7 @@
*/
return -(EIO);

- midi_dev = get_user ((int *) arg);
+ get_user (midi_dev, (int *)arg);
if (midi_dev >= max_mididev)
return -(ENXIO);

@@ -1639,7 +1640,8 @@
if (seq_mode == SEQ_2)
return tmr->ioctl (tmr_no, cmd, arg);

- if (get_user ((int *) arg) != 0)
+ get_user (i, (int *)arg);
+ if (i != 0)
return -(EINVAL);

return snd_ioctl_return ((int *) arg, HZ);
@@ -1649,7 +1651,7 @@
{
int err;

- dev = get_user ((int *) arg);
+ get_user (dev, (int *) arg);
if (dev < 0 || dev >= num_synths)
{
return -(ENXIO);
@@ -1678,8 +1680,9 @@

case SNDCTL_SYNTH_MEMAVL:
{
- int dev = get_user ((int *) arg);
+ int dev;

+ get_user (dev, (int *)arg);
if (dev < 0 || dev >= num_synths)
return -(ENXIO);

@@ -1692,8 +1695,9 @@

case SNDCTL_FM_4OP_ENABLE:
{
- int dev = get_user ((int *) arg);
+ int dev;

+ get_user (dev, (int *)arg);
if (dev < 0 || dev >= num_synths)
return -(ENXIO);

@@ -1833,8 +1837,9 @@

case SNDCTL_SEQ_THRESHOLD:
{
- int tmp = get_user ((int *) arg);
+ int tmp;

+ get_user (tmp, (int *)arg);
if (dev) /*
* Patch manager
*/
@@ -1851,8 +1856,9 @@

case SNDCTL_MIDI_PRETIME:
{
- int val = get_user ((int *) arg);
+ int val;

+ get_user (val, (int *)arg);
if (val < 0)
val = 0;

diff -u --recursive linux-2.1.5/drivers/sound/sound_timer.c linux/drivers/sound/sound_timer.c
--- linux-2.1.5/drivers/sound/sound_timer.c Tue Aug 20 21:58:08 1996
+++ linux/drivers/sound/sound_timer.c Sat Oct 19 13:00:23 1996
@@ -190,6 +190,8 @@
timer_ioctl (int dev,
unsigned int cmd, caddr_t arg)
{
+ int i;
+
switch (cmd)
{
case SNDCTL_TMR_SOURCE:
@@ -214,8 +216,9 @@

case SNDCTL_TMR_TIMEBASE:
{
- int val = get_user ((int *) arg);
+ int val;

+ get_user (val, (int *)arg);
if (val)
{
if (val < 1)
@@ -231,8 +234,9 @@

case SNDCTL_TMR_TEMPO:
{
- int val = get_user ((int *) arg);
+ int val;

+ get_user (val, (int *)arg);
if (val)
{
if (val < 8)
@@ -251,7 +255,8 @@
break;

case SNDCTL_SEQ_CTRLRATE:
- if (get_user ((int *) arg) != 0) /* Can't change */
+ get_user (i, (int *)arg);
+ if (i != 0) /* Can't change */
return -(EINVAL);

return snd_ioctl_return ((int *) arg, ((curr_tempo * curr_timebase) + 30) / 60);
diff -u --recursive linux-2.1.5/drivers/sound/sys_timer.c linux/drivers/sound/sys_timer.c
--- linux-2.1.5/drivers/sound/sys_timer.c Tue Aug 20 21:58:09 1996
+++ linux/drivers/sound/sys_timer.c Sat Oct 19 13:00:23 1996
@@ -189,6 +189,8 @@
def_tmr_ioctl (int dev,
unsigned int cmd, caddr_t arg)
{
+ int i;
+
switch (cmd)
{
case SNDCTL_TMR_SOURCE:
@@ -213,8 +215,9 @@

case SNDCTL_TMR_TIMEBASE:
{
- int val = get_user ((int *) arg);
+ int val;

+ get_user (val, (int *) arg);
if (val)
{
if (val < 1)
@@ -230,8 +233,9 @@

case SNDCTL_TMR_TEMPO:
{
- int val = get_user ((int *) arg);
+ int val;

+ get_user (val, (int *) arg);
if (val)
{
if (val < 8)
@@ -249,7 +253,8 @@
break;

case SNDCTL_SEQ_CTRLRATE:
- if (get_user ((int *) arg) != 0) /* Can't change */
+ get_user (i, (int *)arg);
+ if (i != 0) /* Can't change */
return -(EINVAL);

return snd_ioctl_return ((int *) arg, ((curr_tempo * curr_timebase) + 30) / 60);
diff -u --recursive linux-2.1.5/include/asm-i386/segment.h linux/include/asm-i386/segment.h
--- linux-2.1.5/include/asm-i386/segment.h Sat Oct 19 14:12:18 1996
+++ linux/include/asm-i386/segment.h Sat Oct 19 12:50:03 1996
@@ -147,8 +147,9 @@
#define copy_to_user(to,from,n) ({ \
unsigned long __cu_to = (unsigned long) (to); \
unsigned long __cu_size = (unsigned long) (n); \
+unsigned long __cu_from = (unsigned long) (from); \
if (__cu_size && __access_ok(VERIFY_WRITE, __cu_to, __cu_size)) \
-__copy_user(__cu_to,from,__cu_size); \
+__copy_user(__cu_to,__cu_from,__cu_size); \
__cu_size; })

#define copy_from_user(to,from,n) ({ \
diff -u --recursive linux-2.1.5/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- linux-2.1.5/net/ipx/af_ipx.c Sat Oct 19 14:11:56 1996
+++ linux/net/ipx/af_ipx.c Sat Oct 19 13:47:46 1996
@@ -1087,12 +1087,14 @@
err=verify_area(VERIFY_READ,arg,sizeof(char));
if(err)
return err;
- return ipxcfg_set_auto_create(get_fs_byte(arg));
+ get_user(i, arg);
+ return ipxcfg_set_auto_create(i);
case SIOCAIPXPRISLT:
err=verify_area(VERIFY_READ,arg,sizeof(char));
if(err)
return err;
- return ipxcfg_set_auto_select(get_fs_byte(arg));
+ get_user(i, arg);
+ return ipxcfg_set_auto_select(i);
default:
return -EINVAL;
}
@@ -1626,7 +1628,7 @@
err=verify_area(VERIFY_READ,optval,sizeof(int));
if(err)
return err;
- opt=get_fs_long((unsigned long *)optval);
+ get_user(opt, (unsigned long *)optval);

switch(level)
{
\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.060 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site