linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Davidlohr Bueso <dave@stgolabs.net>
Cc: peterz@infradead.org, mingo@kernel.org, davem@davemloft.net,
	cw00.choi@samsung.com, dougthompson@xmission.com, bp@alien8.de,
	mchehab@osg.samsung.com, gregkh@linuxfoundation.org, pfg@sgi.com,
	hans.verkuil@cisco.com, awalls@md.metrocast.net,
	dledford@redhat.com, sean.hefty@intel.com, kys@microsoft.com,
	heiko.carstens@de.ibm.com, James.Bottomley@HansenPartnership.com,
	sumit.semwal@linaro.org, schwidefsky@de.ibm.com,
	linux-kernel@vger.kernel.org, Davidlohr Bueso <dbueso@suse.de>
Subject: Re: [PATCH 06/12] HID,wacom: Employ atomic_fetch_inc()
Date: Wed, 22 Jun 2016 10:10:39 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1606221009320.6874@cbobk.fhfr.pm> (raw)
In-Reply-To: <1466453164-13185-7-git-send-email-dave@stgolabs.net>

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@kernel.org>
> Signed-off-by: Davidlohr Bueso <dbueso@suse.de>

Acked-by: Jiri Kosina <jkosina@suse.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

  reply	other threads:[~2016-06-22  8:11 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 20:05 [PATCH -tip 00/12] locking/atomics: Add and use inc,dec calls for FETCH-OP flavors Davidlohr Bueso
2016-06-20 20:05 ` [PATCH 01/12] locking/atomic: Introduce inc/dec " Davidlohr Bueso
2016-06-21  7:28   ` Peter Zijlstra
2016-06-21 13:33   ` [PATCH v2 " Davidlohr Bueso
2016-06-21 16:36     ` Davidlohr Bueso
2016-06-23  9:09       ` Peter Zijlstra
2016-06-24 16:34         ` Davidlohr Bueso
2016-06-24 18:48           ` Peter Zijlstra
2016-06-28 21:56             ` [PATCH -v4 " Davidlohr Bueso
2016-07-07  8:33               ` [tip:locking/core] locking/atomic: Introduce inc/dec variants for the atomic_fetch_$op() API tip-bot for Davidlohr Bueso
2016-06-20 20:05 ` [PATCH 02/12] net/neighbour: Employ atomic_fetch_inc() Davidlohr Bueso
2016-06-20 20:05 ` [PATCH 03/12] PM,devfreq: " Davidlohr Bueso
2016-07-02  5:04   ` Chanwoo Choi
2016-06-20 20:05 ` [PATCH 04/12] EDAC: " Davidlohr Bueso
2016-06-21 13:59   ` Borislav Petkov
2016-06-20 20:05 ` [PATCH 05/12] tty/serial: " Davidlohr Bueso
2016-06-20 20:05 ` [PATCH 06/12] HID,wacom: " Davidlohr Bueso
2016-06-22  8:10   ` Jiri Kosina [this message]
2016-06-20 20:05 ` [PATCH 07/12] drivers/media: " Davidlohr Bueso
2016-07-13 16:07   ` Mauro Carvalho Chehab
2016-06-20 20:06 ` [PATCH 08/12] infiniband: " Davidlohr Bueso
2016-06-20 20:06 ` [PATCH 09/12] drivers/hv: " Davidlohr Bueso
2016-06-20 20:06 ` [PATCH 10/12] s390/scm_block: " Davidlohr Bueso
2016-06-20 20:06 ` [PATCH 11/12] scsi: " Davidlohr Bueso
2016-06-20 20:06 ` [PATCH 12/12] dma-buf/fence: Employ atomic_fetch_add Davidlohr Bueso
2016-06-24 16:46 ` [PATCH -tip 00/12] locking/atomics: Add and use inc,dec calls for FETCH-OP flavors James Bottomley
2016-06-24 17:30   ` Davidlohr Bueso
2016-06-24 17:44     ` James Bottomley
2016-06-24 20:35       ` Davidlohr Bueso
2016-06-24 17:45     ` KY Srinivasan
2016-06-24 19:35       ` Davidlohr Bueso
2016-06-24 19:17   ` Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LNX.2.00.1606221009320.6874@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=awalls@md.metrocast.net \
    --cc=bp@alien8.de \
    --cc=cw00.choi@samsung.com \
    --cc=dave@stgolabs.net \
    --cc=davem@davemloft.net \
    --cc=dbueso@suse.de \
    --cc=dledford@redhat.com \
    --cc=dougthompson@xmission.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hans.verkuil@cisco.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pfg@sgi.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=sean.hefty@intel.com \
    --cc=sumit.semwal@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).