Re: Result of compiling with `-W'

From: Jakub Jelinek (jakub@redhat.com)
Date: Thu Jul 13 2000 - 17:05:55 EST


On Thu, Jul 13, 2000 at 11:50:46PM +0200, Ingo Oeser wrote:
> On Thu, Jul 13, 2000 at 05:20:52PM +0100, Alan Cox wrote:
> > > /* Register devices */
> > > - if ((card->audio1_num = register_sound_dsp(&emu10k1_audio_fops, -1)) < 0) {
> > > + if ((signed long)(card->audio1_num = register_sound_dsp(&emu10k1_audio_fops, -1)) < 0) {
> >
> > Fix the type of card->foo_num to be signed instead - the fix is right.
> >
>
> I disagree here. If you enumerate things, you have zero or more
> of them. _Never_ owe you (as the kernel) somebody a soundcard ;-)
>
> So fix is:
>
> signed long ret = register_sound_dsp(&emu10k1_audio_fops, -1);

BTW: Why signed long? Using signed keyword makes sense only for char, the
rest of the types are signed unless unsigned keyword is used.

        Jakub

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:17 EST