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); }