Re: patch on 2.1.80, mostly to fix gcc complaints

Michael Elizabeth Chastain (mec@shout.net)
Sat, 24 Jan 1998 03:20:04 -0600


Hi Andries,

> diff -u --recursive --new-file ../linux-2.1.80/linux/drivers/sound/audio.c ./linux/drivers/sound/audio.c
> --- ../linux-2.1.80/linux/drivers/sound/audio.c Wed Jan 21 01:44:57 1998
> +++ ./linux/drivers/sound/audio.c Fri Jan 23 23:07:00 1998
> @@ -350,7 +350,7 @@
> int audio_ioctl(int dev, struct fileinfo *file_must_not_be_used,
> unsigned int cmd, caddr_t arg)
> {
> - int val, info, count;
> + int val = 0, info, count;
> unsigned long flags;
> struct dma_buffparms *dmap;

Oops, this is a mistake. case SNDCTL_DSP_GETCAPS is broken. Now it
is still broken, but the compiler no longer warns about it.

The right fix is to kill 'info' and use 'val' all the way through
case SNDCTL_DSP_GETCAPS. (And if you leave 'val' uninitialized, then
the compiler will issue warnings for bugs.)

Michael Chastain
<mailto:mec@shout.net>
"love without fear"