[PATCH 1/1]drm/gma500: mdfld: Remove unncessary code

Maninder Singh maninder1.s at samsung.com
Wed Jun 24 01:54:10 PDT 2015


Hi,

>> -       if (!sender || !data_out || !len_out) {
>> -               DRM_ERROR("Invalid parameters\n");
>> -               return -EINVAL;
>> -       }
>> -
>
>I would prefer to have these kind of checks where it actually matters
>(ie. in __read_panel_data()). The saner thing would be to move the
>dereference until after the check and remove the duplicated check from
>mdfld_dsi_read_mcs(). That would prevent any further need for adding
>additional checks whenever calling __read_panel_data().

Ok agree, But i am thinking whether this initilaization has to be there?
struct drm_device *dev = sender->dev;

Because in function __read_panel_data I saw no usage of this dev struct,
So along with check from mdfld_dsi_read_mcs, can we remove this dev from
__read_panel_data also ? Or i missed something in code?
 
Thanks,
Maninder
---------


More information about the dri-devel mailing list