summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIoana Radulescu <ruxandra.radulescu@nxp.com>2018-03-06 11:43:45 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-08 09:57:37 -0800
commit0f4e6014677e8b85b8c61a6ed3707e12b6b5a59a (patch)
tree5cadccda55bcd068f9696575fb1fec5db32a041c
parent11bc6596aaad2c30b1538c15fa5471ed283aa3e4 (diff)
downloadlinux-0f4e6014677e8b85b8c61a6ed3707e12b6b5a59a.tar.bz2
staging: fsl-mc/dpio: Fix cast truncate warning
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/fsl-mc/include/dpaa2-fd.h4
1 files 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 70501d7789c0..b55b89ba4eda 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);
}