* [PATCH] Staging: xgifb: vb_util: Fixed sparse warning of bit truncation due to cast
@ 2015-10-01 21:27 Shivani Bhardwaj
0 siblings, 0 replies; only message in thread
From: Shivani Bhardwaj @ 2015-10-01 21:27 UTC (permalink / raw)
To: outreachy-kernel
Fixed the warning generated by sparse that 'cast truncates bits from
constant value' by typecasting unsigned values to u8 as their logical
operation is being performed with and stored in a u8 type variable.
Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
---
drivers/staging/xgifb/vb_util.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/xgifb/vb_util.h b/drivers/staging/xgifb/vb_util.h
index 7bd395f..f613f54 100644
--- a/drivers/staging/xgifb/vb_util.h
+++ b/drivers/staging/xgifb/vb_util.h
@@ -18,7 +18,7 @@ static inline void xgifb_reg_and_or(unsigned long port, u8 index,
u8 temp;
temp = xgifb_reg_get(port, index);
- temp = (temp & data_and) | data_or;
+ temp = (u8) ((temp & data_and) | data_or);
xgifb_reg_set(port, index, temp);
}
@@ -27,7 +27,7 @@ static inline void xgifb_reg_and(unsigned long port, u8 index, unsigned data_and
u8 temp;
temp = xgifb_reg_get(port, index);
- temp &= data_and;
+ temp = (u8) (temp & data_and);
xgifb_reg_set(port, index, temp);
}
--
2.1.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-01 21:27 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-01 21:27 [PATCH] Staging: xgifb: vb_util: Fixed sparse warning of bit truncation due to cast Shivani Bhardwaj
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.