Quoting Tvrtko Ursulin (2019-03-01 15:39:13)
>
> On 01/03/2019 14:03, Chris Wilson wrote:
> > +int i915_user_extensions(struct i915_user_extension __user *ext,
> > + const i915_user_extension_fn *tbl,
> > + unsigned long count,
> > + void *data)
> > +{
> > + unsigned int stackdepth = 512;
> > +
> > + while (ext) {
> > + int err;
> > + u64 x;
> > +
> > + if (!stackdepth--) /* recursion vs useful flexibility */
> > + return -EINVAL;
>
> I don't get this. What stack? Did you mean "static unsigned int
> stackdepth" in case someone puts i915_user_extension into the extension
> table? Or just a limit on number of chained extensions? But you are not
> processing the recursively here.
It's iterative recursion :)
I still think of this loop in terms of its simple tail recursion.
And if we need to individual levels for unwind, that is a manual stack.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx