drm/i915: Use container_of_const() for states
commit 64f6a5d1 ("container_of: add container_of_const() that preserves const-ness of the pointer") is nice. Let's use it so that we don't accidentally cast away the const from our state pointers. The only thing I don't particularly like about container_of_const() is that it still accepts void* in addition to the proper pointer types, but that's how most other things in C work anyway so I guess we can live with it. And while at it rename the macro arguments to be a bit more descriptive than just 'x'. TODO: maybe convert *all* container_of() uses to container_of_const()? Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240307151810.24208-4-ville.syrjala@linux.intel.comReviewed-by: Jani Nikula <jani.nikula@intel.com>
Showing
Please register or sign in to comment