2002-01-05 11:50:24

by Adam J. Richter

[permalink] [raw]
Subject: Patch: linux-2.5.2-pre8/drivers/sound compilation fixes: MINOR-->minor

Doing a global replace of "MINOR(" with "minor(" in all
.c files in linux/drivers/sound allows all of the sound drivers
to compile (at least as modules on x86). This reflect the
changes in kdev_t introduced in linux-2.5.2-pre6. You can do this
by applying the following patch *or* by the following shell command
(which is how I did it in the first place):

for file in $(find linux/drivers/sound -name '*.c' | xargs egrep -l 'MINOR\(' ) ; do
ed $file << DONE ; done
%s/MINOR(/minor(/g
DONE

One note about this: this resulted in some drivers that
made the following rather obscure looking declarations:

{
int minor = minor(dev);
...
}

Apparently, the variable being declared is not in the scope
of its initialization value. So, the code works, but it's not as
clear as could be. I could rename the effected variables if need
be, although I that is something that individual device driver
maintainers could deal with at "leisure" just as well.

I have not tested these changes. I only know that they
make the sound drivers compile.

--
Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
[email protected] \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."


Attachments:
(No filename) (1.31 kB)
sound.diffs (11.49 kB)
Download all attachments

2002-01-05 20:30:04

by Pete Zaitcev

[permalink] [raw]
Subject: Re: Patch: linux-2.5.2-pre8/drivers/sound compilation fixes: MINOR-->minor

> Doing a global replace of "MINOR(" with "minor(" in all
> .c files in linux/drivers/sound allows all of the sound drivers
> to compile (at least as modules on x86). [...]

You did not change ymfpci, why? Linus fixed it already?

-- Pete

2002-01-05 23:40:12

by Adam J. Richter

[permalink] [raw]
Subject: Re: Patch: linux-2.5.2-pre8/drivers/sound compilation fixes: MINOR-->minor

>From: Pete Zaitcev <[email protected]>

>> Doing a global replace of "MINOR(" with "minor(" in all
>> .c files in linux/drivers/sound allows all of the sound drivers
>> to compile (at least as modules on x86). [...]

>You did not change ymfpci, why? Linus fixed it already?

linux-2.5.2-pre8/drivers/sound/ymfpci.c compiles without
errors or warnings, unmodified.

Adam J. Richter __ ______________ 4880 Stevens Creek Blvd, Suite 104
[email protected] \ / San Jose, California 95129-1034
+1 408 261-6630 | g g d r a s i l United States of America
fax +1 408 261-6631 "Free Software For The Rest Of Us."