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

Maninder Singh maninder1.s at samsung.com
Wed Jun 24 00:10:58 PDT 2015


sender is dereferrenced before NULL check
struct drm_device *dev = sender->dev;

and due to this we get warning during static analysis:
warn: variable dereferenced before check 'sender'

__read_panel_data Function is called by mdfld_dsi_read_mcs
and there is a same check, Thus removing the check from
__read_panel_data.

Signed-off-by: Maninder Singh <maninder1.s at samsung.com>
Reviewed-by: Vaneet Narang <v.narang at samsung.com>
---
 drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
index 6b43ae3..d29b881 100644
--- a/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
+++ b/drivers/gpu/drm/gma500/mdfld_dsi_pkg_sender.c
@@ -525,11 +525,6 @@ static int __read_panel_data(struct mdfld_dsi_pkg_sender *sender, u8 data_type,
 	u32 gen_data_reg;
 	int retry = MDFLD_DSI_READ_MAX_COUNT;
 
-	if (!sender || !data_out || !len_out) {
-		DRM_ERROR("Invalid parameters\n");
-		return -EINVAL;
-	}
-
 	/**
 	 * do reading.
 	 * 0) send out generic read request
-- 
1.7.1


More information about the dri-devel mailing list