[PATCH 02/10] staging: most: fix usage of false data type

Christian Gromm christian.gromm at microchip.com
Thu Oct 15 11:28:52 UTC 2015


This patch changes the data type from u32 to u16 used for temporary
variable. It is needed to stay in the correct range and get rid of
the unnecessary cast.

Signed-off-by: Christian Gromm <christian.gromm at microchip.com>
---
 drivers/staging/most/hdm-dim2/dim2_hdm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hdm.c b/drivers/staging/most/hdm-dim2/dim2_hdm.c
index 45b8332..dda02a6 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hdm.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hdm.c
@@ -381,11 +381,11 @@ static void service_done_flag(struct dim2_hdm *dev, int ch_idx)
 			if (hdm_ch->data_type == MOST_CH_CONTROL ||
 			    hdm_ch->data_type == MOST_CH_ASYNC) {
 
-				u32 const data_size =
-					(u32)data[0] * 256 + data[1] + 2;
+				u16 const data_size =
+					(u16)data[0] * 256 + data[1] + 2;
 
 				mbo->processed_length =
-					min(data_size, (u32)mbo->buffer_length);
+					min(data_size, mbo->buffer_length);
 			} else {
 				mbo->processed_length = mbo->buffer_length;
 			}
-- 
1.7.9.5



More information about the devel mailing list