From 3cf99df0fa944546d22f088bb21005dd9d68af25 Mon Sep 17 00:00:00 2001
From: Vipul Kumar <vipul_kumar@mentor.com>
Date: Tue, 4 Dec 2018 17:22:19 +0530
Subject: [PATCH] damengine: pxp: fixed compilation warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

drivers/dma/pxp/pxp_dma_v3.c: In function ‘pxp_2d_task_config’:
drivers/dma/pxp/pxp_dma_v3.c:1449:6: warning: ‘out_fmt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (rgb_colors[i].format == format)
      ^
drivers/dma/pxp/pxp_dma_v3.c:2323:19: note: ‘out_fmt’ was declared here
  uint32_t in_fmt, out_fmt;
                   ^~~~~~~
drivers/dma/pxp/pxp_dma_v3.c:1449:6: warning: ‘in_fmt’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   if (rgb_colors[i].format == format)
      ^
drivers/dma/pxp/pxp_dma_v3.c:2323:11: note: ‘in_fmt’ was declared here
  uint32_t in_fmt, out_fmt;
           ^~~~~~

Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com>
---
 drivers/dma/pxp/pxp_dma_v3.c | 28 ++++++++++++++++------------
 1 file changed, 16 insertions(+), 12 deletions(-)

diff --git a/drivers/dma/pxp/pxp_dma_v3.c b/drivers/dma/pxp/pxp_dma_v3.c
index b19a2848fbb18c..b23eb34cea49da 100644
--- a/drivers/dma/pxp/pxp_dma_v3.c
+++ b/drivers/dma/pxp/pxp_dma_v3.c
@@ -2337,23 +2337,27 @@ static int pxp_fetch_config(struct pxp_pixmap *input,
 		shift_bypass = (flags & FETCH_SHIFT) ? 0 : 1;
 		expand_en    = (flags & FETCH_EXPAND) ? 1 : 0;
 
-		if (!shift_bypass && expand_en) {
-			if (is_yuv(input->format)) {
-				in_fmt  = PXP_PIX_FMT_YVU444;
-				out_fmt = PXP_PIX_FMT_YUV444;
+		if (!shift_bypass) {
+			if (expand_en) {
+				if (is_yuv(input->format)) {
+					in_fmt  = PXP_PIX_FMT_YVU444;
+					out_fmt = PXP_PIX_FMT_YUV444;
+				} else {
+					in_fmt  = PXP_PIX_FMT_ABGR32;
+					out_fmt = PXP_PIX_FMT_ARGB32;
+				}
 			} else {
-				in_fmt  = PXP_PIX_FMT_ABGR32;
-				out_fmt = PXP_PIX_FMT_ARGB32;
+				in_fmt  = input->format;
+				out_fmt = is_yuv(input->format) ? PXP_PIX_FMT_YUV444 :
+							 	PXP_PIX_FMT_ARGB32;
 			}
-		} else if  (!shift_bypass) {
-			in_fmt  = input->format;
-			out_fmt = is_yuv(input->format) ? PXP_PIX_FMT_YUV444 :
-							  PXP_PIX_FMT_ARGB32;
+
+			shift_offset = pxp_fetch_shift_calc(in_fmt, out_fmt,
+							    &shift_width);
 		}
 	}
+
 	shift_ctrl = pxp_fetch_shift_ctrl_config(input, shift_bypass, expand_en);
-	if (!shift_bypass)
-		shift_offset = pxp_fetch_shift_calc(in_fmt, out_fmt, &shift_width);
 
 	offset = input->crop.y * input->pitch +
 		 input->crop.x * (input->bpp >> 3);
-- 
GitLab