util+treewide: container_of() cleanup
Replace mesa's slightly different container_of() with one more aligned to the linux kernel's version which takes a type as the 2nd param. This avoids warnings like: freedreno_context.c:396:44: warning: variable 'batch' is uninitialized when used within its own initialization [-Wuninitialized] At the same time, we can add additional build-time type-checking asserts Signed-off-by: Rob Clark <robdclark@chromium.org> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7941>
This commit is contained in:
@@ -96,8 +96,7 @@ struct radv_shader_output_values {
|
||||
static inline struct radv_shader_context *
|
||||
radv_shader_context_from_abi(struct ac_shader_abi *abi)
|
||||
{
|
||||
struct radv_shader_context *ctx = NULL;
|
||||
return container_of(abi, ctx, abi);
|
||||
return container_of(abi, struct radv_shader_context, abi);
|
||||
}
|
||||
|
||||
static LLVMValueRef get_rel_patch_id(struct radv_shader_context *ctx)
|
||||
|
Reference in New Issue
Block a user