drm/gma500: Checking a get_config_mode() call in mdfld_dsi_output_init()

From: Markus Elfring
Date: Sun Oct 20 2019 - 04:20:59 EST


Hello,

I tried another script for the semantic patch language out.
This source code analysis approach points a call of the member
function âget_config_modeâ out for further considerations
according to the implementation of the function âmdfld_dsi_output_initâ.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/gma500/mdfld_dsi_output.c?id=531e93d11470aa2e14e6a3febef50d9bc7bab7a1#n523
https://elixir.bootlin.com/linux/v5.4-rc2/source/drivers/gpu/drm/gma500/mdfld_dsi_output.c#L523

â
dsi_config->fixed_mode = p_vid_funcs->get_config_mode(dev);
if (p_vid_funcs->get_panel_info(dev, pipe, &dsi_panel_info))
goto dsi_init_err0;
â
dsi_config->mode = dsi_config->fixed_mode;
â
if (!dsi_config->fixed_mode) {
DRM_ERROR("No pannel fixed mode was found\n");
goto dsi_init_err0;
}
â

How do you think about to move the condition check for the data structure
member âfixed_modeâ directly after the corresponding assignment?
Can it be helpful to reorder these statements a bit?

Regards,
Markus