summaryrefslogtreecommitdiff
path: root/drivers/staging/xgifb
diff options
context:
space:
mode:
authorShivani Bhardwaj <shivanib134@gmail.com>2015-10-01 21:27:03 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-02 09:36:00 (GMT)
commitd1e9aef604da38a4963998922ed0ffff675e3ede (patch)
treef2a8962dd1b62ea9550ad7520801d408e27cf4f3 /drivers/staging/xgifb
parent1657183fcc4e044b2e96bcb9150265027ad2b44b (diff)
downloadlinux-d1e9aef604da38a4963998922ed0ffff675e3ede.tar.xz
Staging: xgifb: vb_util: Fixed sparse warning of bit truncation due to cast
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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/xgifb')
-rw-r--r--drivers/staging/xgifb/vb_util.h4
1 files 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);
}