Re: [RFC PATCH] explicitly mark recursion count

From: Jörn Engel
Date: Wed Jun 02 2004 - 12:49:49 EST


On Wed, 2 June 2004 10:32:00 -0700, Greg KH wrote:
> On Wed, Jun 02, 2004 at 07:17:32PM +0200, J?rn Engel wrote:
> >
> > Leaves usb_audio_recurseunit() as the only function in question, that
> > one could actually be sane, although it looks rather interesting:
> > WARNING: trivial recursion detected:
> > 0 usb_audio_recurseunit
> > WARNING: recursion detected:
> > 16 usb_audio_selectorunit
> > 0 usb_audio_recurseunit
> > WARNING: multiple recursions around usb_audio_recurseunit()
> > WARNING: recursion detected:
> > 0 usb_audio_recurseunit
> > 0 usb_audio_processingunit
> >
> > Greg, can you say whether this construct makes sense?
>
> Well it's sane only if you think that USB descriptors can be sane :)
>
> Anyway, this loop will always terminate as we have a finite sized USB
> descriptor that this function is parsing. As to how many times we will
> recurse, I don't really know as I haven't spent much time looking into
> the different messed up USB audio devices out there on the market...
>
> Sorry I can't be of more help, but I don't think you need to worry about
> this function.

That's ok. At least you can talk about that code without obvious
disgust, which is a quality criterium in itself.

Leaves exactly one multiply recursive function we might want to keep.
So I just won't worry too much and ignore the warnings about it, fine.

Jörn

--
ticks = jiffies;
while (ticks == jiffies);
ticks = jiffies;
-- /usr/src/linux/init/main.c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/