lkml.org 
[lkml]   [2018]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/5] staging: fsl-mc/dpio: Fix cast truncate warning
Date
Sparse reports the following warning:
drivers/staging/fsl-mc/include/dpaa2-fd.h:421:30:
warning: cast truncates bits from constant value (ffff7fff becomes 7fff)

Fix this by explicitly masking the value with 0xffff.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
---
drivers/staging/fsl-mc/include/dpaa2-fd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/fsl-mc/include/dpaa2-fd.h b/drivers/staging/fsl-mc/include/dpaa2-fd.h
index 70501d7..b55b89b 100644
--- a/drivers/staging/fsl-mc/include/dpaa2-fd.h
+++ b/drivers/staging/fsl-mc/include/dpaa2-fd.h
@@ -418,8 +418,8 @@ static inline bool dpaa2_sg_is_final(const struct dpaa2_sg_entry *sg)
*/
static inline void dpaa2_sg_set_final(struct dpaa2_sg_entry *sg, bool final)
{
- sg->format_offset &= cpu_to_le16(~(SG_FINAL_FLAG_MASK
- << SG_FINAL_FLAG_SHIFT));
+ sg->format_offset &= cpu_to_le16((~(SG_FINAL_FLAG_MASK
+ << SG_FINAL_FLAG_SHIFT)) & 0xFFFF);
sg->format_offset |= cpu_to_le16(final << SG_FINAL_FLAG_SHIFT);
}

--
2.7.4
\
 
 \ /
  Last update: 2018-03-06 18:45    [W:0.058 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site