2.1.80 miscellanea

Thomas Sailer (sailer@ife.ee.ethz.ch)
Wed, 21 Jan 1998 18:56:04 +0100


The first patch changes Rules.make to consistently use
$(RM) instead of rm and to use mv -f instead of mv.
Otherwise, make may ask to replace a .ver file during
the make process.

The second patch apparently fixes a sound oops
with the old mixer info ioctl.

Thirdly, what are the following lines from 2.1.80 supposed
to do and why?

--- v2.1.79/linux/drivers/sound/soundcard.c Fri Jan 2 14:37:02 1998
+++ linux/drivers/sound/soundcard.c Tue Jan 20 16:44:57 1998
@@ -12,7 +12,8 @@
*/
/*
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
- * integrated sound_switch.c and made /proc/sound (equals to
/dev/sndstat,
+ * integrated sound_switch.c
+ * Stefan Reinauer : integrated /proc/sound (equals to /dev/sndstat,
* which should disappear in the near future)
*/
#include <linux/config.h>

--- linux/Rules.make.orig Wed Jan 21 18:15:48 1998
+++ linux/Rules.make Wed Jan 21 18:25:07 1998
@@ -72,7 +72,7 @@
ifdef O_TARGET
ALL_O = $(OX_OBJS) $(O_OBJS)
$(O_TARGET): $(ALL_O)
- rm -f $@
+ $(RM) -f $@
ifneq "$(strip $(ALL_O))" ""
$(LD) $(EXTRA_LDFLAGS) -r -o $@ $(ALL_O)
else
@@ -90,7 +90,7 @@
#
ifdef L_TARGET
$(L_TARGET): $(LX_OBJS) $(L_OBJS)
- rm -f $@
+ $(RM) -f $@
$(AR) $(EXTRA_ARFLAGS) rcs $@ $(LX_OBJS) $(L_OBJS)
@ ( \
echo 'ifeq ($(strip $(EXTRA_ARFLAGS) $(LX_OBJS) $(L_OBJS)),$$(strip $$(EXTRA_ARFLAGS) $$(LX_OBJS) $$(L_OBJS)))' ; \
@@ -131,7 +131,7 @@
set -e; for i in $(MOD_IN_SUB_DIRS); do $(MAKE) -C $$i modules; done
endif
ifneq "$(strip $(MOD_LIST_NAME))" ""
- rm -f $$TOPDIR/modules/$(MOD_LIST_NAME)
+ $(RM) -f $$TOPDIR/modules/$(MOD_LIST_NAME)
ifdef MOD_SUB_DIRS
for i in $(MOD_SUB_DIRS); do \
echo `basename $$i`.o >> $$TOPDIR/modules/$(MOD_LIST_NAME); done
@@ -179,7 +179,7 @@
$(MODINCL)/%.ver: %.c
$(CC) $(CFLAGS) -E -D__GENKSYMS__ $<\
| $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
- mv $@.tmp $@
+ mv -f $@.tmp $@

$(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h

--- linux/drivers/sound/soundcard.c.orig Wed Jan 21 18:11:56 1998
+++ linux/drivers/sound/soundcard.c Wed Jan 21 18:14:00 1998
@@ -548,14 +548,13 @@
static int get_old_mixer_info(int dev, caddr_t arg)
{
_old_mixer_info info;
- int i;

if (dev < 0 || dev >= num_mixers)
return -ENXIO;
- strcpy(info.id, mixer_devs[dev]->id);
- for (i = 0; i < 32 && mixer_devs[dev]->name; i++)
- info.name[i] = mixer_devs[dev]->name[i];
- info.name[i] = 0;
+ strncpy(info.id, mixer_devs[dev]->id, sizeof(info.id));
+ info.name[0] = 0;
+ if (mixer_devs[dev]->name)
+ strncpy(info.name, mixer_devs[dev]->name, sizeof(info.name));
if (__copy_to_user(arg, &info, sizeof(info)))
return -EFAULT;
return 0;

Tom