diff options
author | Aniroop Mathur <aniroop.mathur@gmail.com> | 2014-12-03 14:27:42 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2014-12-03 15:27:17 -0800 |
commit | 939ffb1712890ee22146d2dfc24adbc7da6afa84 (patch) | |
tree | 32f55ccf440835f0c929b6c7b173ffd87e18f2c6 /drivers/input/misc | |
parent | 9c7d66fa9bb21ef89c6acdd0cf536eb84e760d8b (diff) | |
download | blackbird-op-linux-939ffb1712890ee22146d2dfc24adbc7da6afa84.tar.gz blackbird-op-linux-939ffb1712890ee22146d2dfc24adbc7da6afa84.zip |
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) static int ims_pcu_init_application_mode(struct ims_pcu *pcu) { - static atomic_t device_no = ATOMIC_INIT(0); + static atomic_t device_no = ATOMIC_INIT(-1); const struct ims_pcu_device_info *info; int error; @@ -1882,7 +1882,7 @@ static int ims_pcu_init_application_mode(struct ims_pcu *pcu) } /* Device appears to be operable, complete initialization */ - pcu->device_no = atomic_inc_return(&device_no) - 1; + pcu->device_no = atomic_inc_return(&device_no); /* * PCU-B devices, both GEN_1 and GEN_2 do not have OFN sensor |