diff options
| author | Aniroop Mathur <aniroop.mathur@gmail.com> | 2014-12-03 17:27:42 -0500 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-12-03 18:27:17 -0500 |
| commit | 939ffb1712890ee22146d2dfc24adbc7da6afa84 (patch) | |
| tree | 32f55ccf440835f0c929b6c7b173ffd87e18f2c6 /drivers/input/misc | |
| parent | 9c7d66fa9bb21ef89c6acdd0cf536eb84e760d8b (diff) | |
Input: initialize device counter variables with -1
Let's initialize atomic_t variables keeping track of number of various
devices created so far with -1 in order to avoid extra subtraction
operation.
Signed-off-by: Aniroop Mathur <aniroop.mathur@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc')
| -rw-r--r-- | drivers/input/misc/ims-pcu.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c index 719410feb84b..69caee906ecd 100644 --- a/drivers/input/misc/ims-pcu.c +++ b/drivers/input/misc/ims-pcu.c | |||
| @@ -1851,7 +1851,7 @@ static int ims_pcu_identify_type(struct ims_pcu *pcu, u8 *device_id) | |||
| 1851 | 1851 | ||
| 1852 | static int ims_pcu_init_application_mode(struct ims_pcu *pcu) | 1852 | static int ims_pcu_init_application_mode(struct ims_pcu *pcu) |
| 1853 | { | 1853 | { |
| 1854 | static atomic_t device_no = ATOMIC_INIT(0); | 1854 | static atomic_t device_no = ATOMIC_INIT(-1); |
| 1855 | 1855 | ||
| 1856 | const struct ims_pcu_device_info *info; | 1856 | const struct ims_pcu_device_info *info; |
| 1857 | int error; | 1857 | int error; |
| @@ -1882,7 +1882,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu) | |||
| 1882 | } | 1882 | } |
| 1883 | 1883 | ||
| 1884 | /* Device appears to be operable, complete initialization */ | 1884 | /* Device appears to be operable, complete initialization */ |
| 1885 | pcu->device_no = atomic_inc_return(&device_no) - 1; | 1885 | pcu->device_no = atomic_inc_return(&device_no); |
| 1886 | 1886 | ||
| 1887 | /* | 1887 | /* |
| 1888 | * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor | 1888 | * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor |
