Skip to contentSkip to conversation

drm/gma500: mdfld: Remove unncessary code

PATCH Maninder Singh 2 participants 2 messages Jun 24, 2015

lore
Share & tools
lore
#0 lore raw

Hi,

Quoted 11 lines

Review

Quoted 5 lines
(quoted diff) +0 -5
-       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
---------
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#1 lore raw
Quoted 14 lines · Maninder Singh

Hi,

Quoted 11 lines

Review

Quoted 5 lines
(quoted diff) +0 -5
-       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().

Quoted 6 lines

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?

REG_READ and REG_WRITE macros need the drm device (see psb_drv.h) so it must stay.

Quoted 3 lines

Thanks,
Maninder
---------

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel