[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1606221009320.6874@cbobk.fhfr.pm>
Date: Wed, 22 Jun 2016 10:10:39 +0200 (CEST)
From: Jiri Kosina <jikos@...nel.org>
To: Davidlohr Bueso <dave@...olabs.net>
cc: peterz@...radead.org, mingo@...nel.org, davem@...emloft.net,
cw00.choi@...sung.com, dougthompson@...ssion.com, bp@...en8.de,
mchehab@....samsung.com, gregkh@...uxfoundation.org, pfg@....com,
hans.verkuil@...co.com, awalls@...metrocast.net,
dledford@...hat.com, sean.hefty@...el.com, kys@...rosoft.com,
heiko.carstens@...ibm.com, James.Bottomley@...senPartnership.com,
sumit.semwal@...aro.org, schwidefsky@...ibm.com,
linux-kernel@...r.kernel.org, Davidlohr Bueso <dbueso@...e.de>
Subject: Re: [PATCH 06/12] HID,wacom: Employ atomic_fetch_inc()
On Mon, 20 Jun 2016, Davidlohr Bueso wrote:
> Now that we have fetch_inc() we can stop using inc_return() - 1.
>
> These are very similar to the existing OP-RETURN primitives we already
> have, except they return the value of the atomic variable _before_
> modification.
>
> Cc: Jiri Kosina <jikos@...nel.org>
> Signed-off-by: Davidlohr Bueso <dbueso@...e.de>
Acked-by: Jiri Kosina <jkosina@...e.cz>
> ---
> drivers/hid/wacom_sys.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> index 499cc8213cfe..88bde7687edd 100644
> --- a/drivers/hid/wacom_sys.c
> +++ b/drivers/hid/wacom_sys.c
> @@ -1088,7 +1088,7 @@ static int wacom_initialize_battery(struct wacom *wacom)
> if (wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) {
> struct power_supply_desc *bat_desc = &wacom->battery_desc;
> struct power_supply_desc *ac_desc = &wacom->ac_desc;
> - n = atomic_inc_return(&battery_no) - 1;
> + n = atomic_fetch_inc(&battery_no);
>
> bat_desc->properties = wacom_battery_props;
> bat_desc->num_properties = ARRAY_SIZE(wacom_battery_props);
> --
> 2.6.6
>
--
Jiri Kosina
SUSE Labs
Powered by blists - more mailing lists