v2: just tell the compiler to assume the format will always be found, as
it comes from the table itself to begin with. (DanielS)
CID:
1429516
Fixes: d32b23f3830099a328b91 "egl/wayland: Add bpp to visual map"
Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
{
int visual_idx = dri2_wl_visual_idx_from_shm_format(format);
{
int visual_idx = dri2_wl_visual_idx_from_shm_format(format);
+ assume(visual_idx != -1);
+
return w * (dri2_wl_visuals[visual_idx].bpp / 8);
}
return w * (dri2_wl_visuals[visual_idx].bpp / 8);
}