Quoting Chris Wilson (2019-03-15 15:03:27) > +static int create_clone(struct i915_user_extension __user *ext, void *data) > +{ > + static int (* const fn[])(struct i915_gem_context *dst, > + struct i915_gem_context *src) = { > + [ilog2(I915_CONTEXT_CLONE_FLAGS)] = clone_flags, > + [ilog2(I915_CONTEXT_CLONE_SCHEDATTR)] = clone_schedattr, > + [ilog2(I915_CONTEXT_CLONE_SSEU)] = clone_sseu, > + [ilog2(I915_CONTEXT_CLONE_TIMELINE)] = clone_timeline, > + [ilog2(I915_CONTEXT_CLONE_VM)] = clone_vm, > + }; Should be able to do something like BUILD_BUG_ON(GENMASK(ARRAY_SIZE(fn)-1, 0) != I915_CONTEXT_CLONE_UNKNOWN); -Chris _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx