From: Andrii Simiklit Date: Wed, 9 Jan 2019 13:39:45 +0000 (+0200) Subject: anv/pipeline: remove unnecessary null-pointer check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0206ffc28db1c12a62c96384760c38f21ec1b420;p=mesa.git anv/pipeline: remove unnecessary null-pointer check Looks like it is impossible that 'last' variable is a null because at least the get_vs_prog_data shouldn't return a null pointer. So this check is unnecessary starts from commit: 99d497c5b691 "anv/pipeline: Replace get_fs_input_map with ..." This small issue is found by cppcheck. Signed-off-by: Andrii Simiklit Reviewed-by: Jason Ekstrand --- diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c index d39a0da12da..e52e5d8304a 100644 --- a/src/intel/vulkan/genX_pipeline.c +++ b/src/intel/vulkan/genX_pipeline.c @@ -1116,10 +1116,8 @@ emit_3dstate_clip(struct anv_pipeline *pipeline, clip.FrontWinding = vk_to_gen_front_face[rs_info->frontFace]; clip.CullMode = vk_to_gen_cullmode[rs_info->cullMode]; clip.ViewportZClipTestEnable = !pipeline->depth_clamp_enable; - if (last) { - clip.UserClipDistanceClipTestEnableBitmask = last->clip_distance_mask; - clip.UserClipDistanceCullTestEnableBitmask = last->cull_distance_mask; - } + clip.UserClipDistanceClipTestEnableBitmask = last->clip_distance_mask; + clip.UserClipDistanceCullTestEnableBitmask = last->cull_distance_mask; #else clip.NonPerspectiveBarycentricEnable = wm_prog_data ? (wm_prog_data->barycentric_interp_modes &