diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-07-18 20:09:05 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2011-07-18 20:10:41 -0400 |
commit | e449edbb91decd0260105fadd4f5fcc3ce170e01 (patch) | |
tree | 6b95a5554d47bff1c31417cf822c9bced934d3fd /drivers/input/touchscreen | |
parent | dc3e8247eb90655c0ff01ce03bdf3aa5868f1cde (diff) |
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>
Diffstat (limited to 'drivers/input/touchscreen')
-rw-r--r-- | drivers/input/touchscreen/intel-mid-touch.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/input/touchscreen/intel-mid-touch.c b/drivers/input/touchscreen/intel-mid-touch.c index 66c96bfc5522..327695268e06 100644 --- a/drivers/input/touchscreen/intel-mid-touch.c +++ b/drivers/input/touchscreen/intel-mid-touch.c | |||
@@ -448,15 +448,11 @@ static int __devinit mrstouch_read_pmic_id(uint *vendor, uint *rev) | |||
448 | */ | 448 | */ |
449 | static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) | 449 | static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) |
450 | { | 450 | { |
451 | int err, i, found; | 451 | int found = 0; |
452 | int err, i; | ||
452 | u8 r8; | 453 | u8 r8; |
453 | 454 | ||
454 | found = -1; | ||
455 | |||
456 | for (i = 0; i < MRSTOUCH_MAX_CHANNELS; i++) { | 455 | for (i = 0; i < MRSTOUCH_MAX_CHANNELS; i++) { |
457 | if (found >= 0) | ||
458 | break; | ||
459 | |||
460 | err = intel_scu_ipc_ioread8(PMICADDR0 + i, &r8); | 456 | err = intel_scu_ipc_ioread8(PMICADDR0 + i, &r8); |
461 | if (err) | 457 | if (err) |
462 | return err; | 458 | return err; |
@@ -466,16 +462,15 @@ static int __devinit mrstouch_chan_parse(struct mrstouch_dev *tsdev) | |||
466 | break; | 462 | break; |
467 | } | 463 | } |
468 | } | 464 | } |
469 | if (found < 0) | ||
470 | return 0; | ||
471 | 465 | ||
472 | if (tsdev->vendor == PMIC_VENDOR_FS) { | 466 | if (tsdev->vendor == PMIC_VENDOR_FS) { |
473 | if (found && found > (MRSTOUCH_MAX_CHANNELS - 18)) | 467 | if (found > MRSTOUCH_MAX_CHANNELS - 18) |
474 | return -ENOSPC; | 468 | return -ENOSPC; |
475 | } else { | 469 | } else { |
476 | if (found && found > (MRSTOUCH_MAX_CHANNELS - 4)) | 470 | if (found > MRSTOUCH_MAX_CHANNELS - 4) |
477 | return -ENOSPC; | 471 | return -ENOSPC; |
478 | } | 472 | } |
473 | |||
479 | return found; | 474 | return found; |
480 | } | 475 | } |
481 | 476 | ||