Input: intel-mid-touch - remove pointless checking for variable 'found'
The implementation does break from the for loop after we assign 'i' to variable 'found'. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
committed by
Dmitry Torokhov
parent
dc3e8247eb
commit
e449edbb91
@@ -448,15 +448,11 @@ static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev)
|
|||||||
*/
|
*/
|
||||||
static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev)
|
static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev)
|
||||||
{
|
{
|
||||||
int err, i, found;
|
int found = 0;
|
||||||
|
int err, i;
|
||||||
u8 r8;
|
u8 r8;
|
||||||
|
|
||||||
found = -1;
|
|
||||||
|
|
||||||
for (i = 0; i < MRSTOUCH_MAX_CHANNELS; i++) {
|
for (i = 0; i < MRSTOUCH_MAX_CHANNELS; i++) {
|
||||||
if (found >= 0)
|
|
||||||
break;
|
|
||||||
|
|
||||||
err = intel_scu_ipc_ioread8(PMICADDR0 + i, &r8);
|
err = intel_scu_ipc_ioread8(PMICADDR0 + i, &r8);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
@@ -466,16 +462,15 @@ static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found < 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (tsdev->vendor == PMIC_VENDOR_FS) {
|
if (tsdev->vendor == PMIC_VENDOR_FS) {
|
||||||
if (found && found > (MRSTOUCH_MAX_CHANNELS - 18))
|
if (found > MRSTOUCH_MAX_CHANNELS - 18)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
} else {
|
} else {
|
||||||
if (found && found > (MRSTOUCH_MAX_CHANNELS - 4))
|
if (found > MRSTOUCH_MAX_CHANNELS - 4)
|
||||||
return -ENOSPC;
|
return -ENOSPC;
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user