summaryrefslogtreecommitdiff
path: root/drivers/mxc
diff options
context:
space:
mode:
authorGao Pan <pandy.gao@nxp.com>2016-01-11 16:30:05 +0800
committerOctavian Purdila <octavian.purdila@nxp.com>2017-02-23 14:21:42 +0200
commitfb00b3604533fc980f347e4da65908799e6d40de (patch)
tree36494c45eb59c60772f302f9ce1966972ca0fe09 /drivers/mxc
parentf3c6d25981d380cdda9b9b798d248caa96bddb2e (diff)
MLK-12185 mlb: imx: fix the operation for mlb status in mlb_isr
As a result that the wrong operation is used for the mlb status in mlb_isr(), some results are independent of their operations. for example: rx_cis = (cdt_val[2] & ~MASK) >> SHIFT, where, MASK = 0xf0000000 and SHIFT = 28. So, the result is always 0 regardless of the values of its operands. This patch fixes the operation for mlb status in mlb_isr(). (reported by coverity check) Signed-off-by: Gao Pan <pandy.gao@nxp.com>
Diffstat (limited to 'drivers/mxc')
-rwxr-xr-xdrivers/mxc/mlb/mxc_mlb.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/mxc/mlb/mxc_mlb.c b/drivers/mxc/mlb/mxc_mlb.c
index 6bec2bfd7554..f935ab8cb848 100755
--- a/drivers/mxc/mlb/mxc_mlb.c
+++ b/drivers/mxc/mlb/mxc_mlb.c
@@ -1831,7 +1831,7 @@ static irqreturn_t mlb_isr(int irq, void *dev_id)
cdt_val[1], cdt_val[0]);
switch (ctype) {
case MLB_CTYPE_SYNC:
- tx_cis = (cdt_val[2] & ~CDT_SYNC_WSTS_MASK)
+ tx_cis = (cdt_val[2] & CDT_SYNC_WSTS_MASK)
>> CDT_SYNC_WSTS_SHIFT;
/*
* Clear RSTS/WSTS errors to resume
@@ -1843,7 +1843,7 @@ static irqreturn_t mlb_isr(int irq, void *dev_id)
case MLB_CTYPE_CTRL:
case MLB_CTYPE_ASYNC:
tx_cis = (cdt_val[2] &
- ~CDT_CTRL_ASYNC_WSTS_MASK)
+ CDT_CTRL_ASYNC_WSTS_MASK)
>> CDT_CTRL_ASYNC_WSTS_SHIFT;
tx_cis = (cdt_val[3] & CDT_CTRL_ASYNC_WSTS_1) ?
(tx_cis | (0x1 << 4)) : tx_cis;
@@ -1857,7 +1857,7 @@ static irqreturn_t mlb_isr(int irq, void *dev_id)
~(0x4 << CDT_CTRL_ASYNC_WSTS_SHIFT);
break;
case MLB_CTYPE_ISOC:
- tx_cis = (cdt_val[2] & ~CDT_ISOC_WSTS_MASK)
+ tx_cis = (cdt_val[2] & CDT_ISOC_WSTS_MASK)
>> CDT_ISOC_WSTS_SHIFT;
/* c. For isoc channels: WSTS[2:1] = 0x00 */
cdt_val[2] &= ~(0x6 << CDT_ISOC_WSTS_SHIFT);
@@ -1879,23 +1879,23 @@ static irqreturn_t mlb_isr(int irq, void *dev_id)
cdt_val[1], cdt_val[0]);
switch (ctype) {
case MLB_CTYPE_SYNC:
- tx_cis = (cdt_val[2] & ~CDT_SYNC_RSTS_MASK)
+ rx_cis = (cdt_val[2] & CDT_SYNC_RSTS_MASK)
>> CDT_SYNC_RSTS_SHIFT;
cdt_val[2] &= ~(0x8 << CDT_SYNC_WSTS_SHIFT);
break;
case MLB_CTYPE_CTRL:
case MLB_CTYPE_ASYNC:
- tx_cis =
- (cdt_val[2] & ~CDT_CTRL_ASYNC_RSTS_MASK)
+ rx_cis =
+ (cdt_val[2] & CDT_CTRL_ASYNC_RSTS_MASK)
>> CDT_CTRL_ASYNC_RSTS_SHIFT;
- tx_cis = (cdt_val[3] & CDT_CTRL_ASYNC_RSTS_1) ?
- (tx_cis | (0x1 << 4)) : tx_cis;
+ rx_cis = (cdt_val[3] & CDT_CTRL_ASYNC_RSTS_1) ?
+ (rx_cis | (0x1 << 4)) : rx_cis;
cdt_val[3] &= ~CDT_CTRL_ASYNC_RSTS_1;
cdt_val[2] &=
~(0x4 << CDT_CTRL_ASYNC_RSTS_SHIFT);
break;
case MLB_CTYPE_ISOC:
- tx_cis = (cdt_val[2] & ~CDT_ISOC_RSTS_MASK)
+ rx_cis = (cdt_val[2] & CDT_ISOC_RSTS_MASK)
>> CDT_ISOC_RSTS_SHIFT;
cdt_val[2] &= ~(0x6 << CDT_ISOC_WSTS_SHIFT);
break;