* [PATCHv4 02/11] batman-adv: Remove private define of atomic_dec_not_zero
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 03/11] fault_inject: " Sven Eckelmann
` (8 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch
Cc: linux-kernel, Sven Eckelmann, Marek Lindner, Simon Wunderlich,
b.a.t.m.a.n
atomic_dec_not_zero is defined through <linux/atomic.h> for all
architectures and batman-adv doesn't need an extra define which may
collide with the global one.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: b.a.t.m.a.n@lists.open-mesh.org
---
net/batman-adv/main.h | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index a6df61a..d986f34 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -201,8 +201,6 @@ static inline int compare_eth(const void *data1, const void *data2)
}
-#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
-
/* Returns the smallest signed integer in two's complement with the sizeof x */
#define smallest_signed_int(x) (1u << (7u + 8u * (sizeof(x) - 1u)))
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCHv4 03/11] fault_inject: Remove private define of atomic_dec_not_zero
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
2011-07-27 9:47 ` [PATCHv4 02/11] batman-adv: Remove private define of atomic_dec_not_zero Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
` (7 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Akinobu Mita
atomic_dec_not_zero is defined through <linux/atomic.h> for all
architectures and fault_inject doesn't need an extra define which may
collide with the global one.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Akinobu Mita <akinobu.mita@gmail.com>
---
lib/fault-inject.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index 2577b12..8ce98c6 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -45,8 +45,6 @@ static void fail_dump(struct fault_attr *attr)
dump_stack();
}
-#define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
-
static bool fail_task(struct fault_attr *attr, struct task_struct *task)
{
return !in_interrupt() && task->make_it_fail;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
2011-07-27 9:47 ` [PATCHv4 02/11] batman-adv: Remove private define of atomic_dec_not_zero Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 03/11] fault_inject: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 19:50 ` Rafael J. Wysocki
2011-07-27 9:47 ` [PATCHv4 05/11] omap3isp: " Sven Eckelmann
` (6 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch
Cc: linux-kernel, Sven Eckelmann, Len Brown, Pavel Machek,
Rafael J. Wysocki, linux-pm
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Len Brown <len.brown@intel.com>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Rafael J. Wysocki <rjw@sisk.pl>
Cc: linux-pm@lists.linux-foundation.org
---
drivers/base/power/runtime.c | 4 ++--
include/linux/pm_runtime.h | 2 +-
kernel/power/hibernate.c | 4 ++--
kernel/power/user.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
index 8dc247c..bda10d9 100644
--- a/drivers/base/power/runtime.c
+++ b/drivers/base/power/runtime.c
@@ -401,7 +401,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
if (dev->parent) {
parent = dev->parent;
- atomic_add_unless(&parent->power.child_count, -1, 0);
+ atomic_dec_not_zero(&parent->power.child_count);
}
}
wake_up_all(&dev->power.wait_queue);
@@ -841,7 +841,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
if (status == RPM_SUSPENDED) {
/* It always is possible to set the status to 'suspended'. */
if (parent) {
- atomic_add_unless(&parent->power.child_count, -1, 0);
+ atomic_dec_not_zero(&parent->power.child_count);
notify_parent = !parent->power.ignore_children;
}
goto out_set;
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index daac05d..3b4931c 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -63,7 +63,7 @@ static inline void pm_runtime_get_noresume(struct device *dev)
static inline void pm_runtime_put_noidle(struct device *dev)
{
- atomic_add_unless(&dev->power.usage_count, -1, 0);
+ atomic_dec_not_zero(&dev->power.usage_count);
}
static inline bool device_run_wake(struct device *dev)
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 8f7b1db..0ba8d87 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -606,7 +606,7 @@ int hibernate(void)
mutex_lock(&pm_mutex);
/* The snapshot device should not be opened while we're running */
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
+ if (!atomic_dec_not_zero(&snapshot_device_available)) {
error = -EBUSY;
goto Unlock;
}
@@ -756,7 +756,7 @@ static int software_resume(void)
goto Unlock;
/* The snapshot device should not be opened while we're running */
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
+ if (!atomic_dec_not_zero(&snapshot_device_available)) {
error = -EBUSY;
swsusp_close(FMODE_READ);
goto Unlock;
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 42ddbc6..1c1cc01 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -72,7 +72,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
mutex_lock(&pm_mutex);
- if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
+ if (!atomic_dec_not_zero(&snapshot_device_available)) {
error = -EBUSY;
goto Unlock;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless
2011-07-27 9:47 ` [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
@ 2011-07-27 19:50 ` Rafael J. Wysocki
2011-07-27 20:36 ` Pavel Machek
0 siblings, 1 reply; 21+ messages in thread
From: Rafael J. Wysocki @ 2011-07-27 19:50 UTC (permalink / raw)
To: Sven Eckelmann
Cc: linux-arch, linux-kernel, Len Brown, Pavel Machek, linux-pm
On Wednesday, July 27, 2011, Sven Eckelmann wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Rafael J. Wysocki <rjw@sisk.pl>
> Cc: linux-pm@lists.linux-foundation.org
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> drivers/base/power/runtime.c | 4 ++--
> include/linux/pm_runtime.h | 2 +-
> kernel/power/hibernate.c | 4 ++--
> kernel/power/user.c | 2 +-
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> index 8dc247c..bda10d9 100644
> --- a/drivers/base/power/runtime.c
> +++ b/drivers/base/power/runtime.c
> @@ -401,7 +401,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
>
> if (dev->parent) {
> parent = dev->parent;
> - atomic_add_unless(&parent->power.child_count, -1, 0);
> + atomic_dec_not_zero(&parent->power.child_count);
> }
> }
> wake_up_all(&dev->power.wait_queue);
> @@ -841,7 +841,7 @@ int __pm_runtime_set_status(struct device *dev, unsigned int status)
> if (status == RPM_SUSPENDED) {
> /* It always is possible to set the status to 'suspended'. */
> if (parent) {
> - atomic_add_unless(&parent->power.child_count, -1, 0);
> + atomic_dec_not_zero(&parent->power.child_count);
> notify_parent = !parent->power.ignore_children;
> }
> goto out_set;
> diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
> index daac05d..3b4931c 100644
> --- a/include/linux/pm_runtime.h
> +++ b/include/linux/pm_runtime.h
> @@ -63,7 +63,7 @@ static inline void pm_runtime_get_noresume(struct device *dev)
>
> static inline void pm_runtime_put_noidle(struct device *dev)
> {
> - atomic_add_unless(&dev->power.usage_count, -1, 0);
> + atomic_dec_not_zero(&dev->power.usage_count);
> }
>
> static inline bool device_run_wake(struct device *dev)
> diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
> index 8f7b1db..0ba8d87 100644
> --- a/kernel/power/hibernate.c
> +++ b/kernel/power/hibernate.c
> @@ -606,7 +606,7 @@ int hibernate(void)
>
> mutex_lock(&pm_mutex);
> /* The snapshot device should not be opened while we're running */
> - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
> + if (!atomic_dec_not_zero(&snapshot_device_available)) {
> error = -EBUSY;
> goto Unlock;
> }
> @@ -756,7 +756,7 @@ static int software_resume(void)
> goto Unlock;
>
> /* The snapshot device should not be opened while we're running */
> - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
> + if (!atomic_dec_not_zero(&snapshot_device_available)) {
> error = -EBUSY;
> swsusp_close(FMODE_READ);
> goto Unlock;
> diff --git a/kernel/power/user.c b/kernel/power/user.c
> index 42ddbc6..1c1cc01 100644
> --- a/kernel/power/user.c
> +++ b/kernel/power/user.c
> @@ -72,7 +72,7 @@ static int snapshot_open(struct inode *inode, struct file *filp)
>
> mutex_lock(&pm_mutex);
>
> - if (!atomic_add_unless(&snapshot_device_available, -1, 0)) {
> + if (!atomic_dec_not_zero(&snapshot_device_available)) {
> error = -EBUSY;
> goto Unlock;
> }
>
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless
2011-07-27 19:50 ` Rafael J. Wysocki
@ 2011-07-27 20:36 ` Pavel Machek
2011-07-28 21:43 ` Rafael J. Wysocki
0 siblings, 1 reply; 21+ messages in thread
From: Pavel Machek @ 2011-07-27 20:36 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Sven Eckelmann, linux-arch, linux-kernel, Len Brown, linux-pm
Hi!
> > atomic_dec_not_zero is defined for each architecture through
> > <linux/atomic.h> to provide the functionality of
> > atomic_add_unless(x, -1, 0).
> >
> > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > Cc: Len Brown <len.brown@intel.com>
> > Cc: Pavel Machek <pavel@ucw.cz>
> > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > Cc: linux-pm@lists.linux-foundation.org
>
> Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
>
> > ---
> > drivers/base/power/runtime.c | 4 ++--
> > include/linux/pm_runtime.h | 2 +-
> > kernel/power/hibernate.c | 4 ++--
> > kernel/power/user.c | 2 +-
> > 4 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> > index 8dc247c..bda10d9 100644
> > --- a/drivers/base/power/runtime.c
> > +++ b/drivers/base/power/runtime.c
> > @@ -401,7 +401,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
> >
> > if (dev->parent) {
> > parent = dev->parent;
> > - atomic_add_unless(&parent->power.child_count, -1, 0);
> > + atomic_dec_not_zero(&parent->power.child_count);
I'd like to understand... Why not atomic_dec in the first place? Count
should be exact, anyway, or we run into problems, right?
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless
2011-07-27 20:36 ` Pavel Machek
@ 2011-07-28 21:43 ` Rafael J. Wysocki
0 siblings, 0 replies; 21+ messages in thread
From: Rafael J. Wysocki @ 2011-07-28 21:43 UTC (permalink / raw)
To: Pavel Machek
Cc: Sven Eckelmann, linux-arch, linux-kernel, Len Brown, linux-pm
On Wednesday, July 27, 2011, Pavel Machek wrote:
> Hi!
>
> > > atomic_dec_not_zero is defined for each architecture through
> > > <linux/atomic.h> to provide the functionality of
> > > atomic_add_unless(x, -1, 0).
> > >
> > > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > > Cc: Len Brown <len.brown@intel.com>
> > > Cc: Pavel Machek <pavel@ucw.cz>
> > > Cc: Rafael J. Wysocki <rjw@sisk.pl>
> > > Cc: linux-pm@lists.linux-foundation.org
> >
> > Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> >
> > > ---
> > > drivers/base/power/runtime.c | 4 ++--
> > > include/linux/pm_runtime.h | 2 +-
> > > kernel/power/hibernate.c | 4 ++--
> > > kernel/power/user.c | 2 +-
> > > 4 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/drivers/base/power/runtime.c b/drivers/base/power/runtime.c
> > > index 8dc247c..bda10d9 100644
> > > --- a/drivers/base/power/runtime.c
> > > +++ b/drivers/base/power/runtime.c
> > > @@ -401,7 +401,7 @@ static int rpm_suspend(struct device *dev, int rpmflags)
> > >
> > > if (dev->parent) {
> > > parent = dev->parent;
> > > - atomic_add_unless(&parent->power.child_count, -1, 0);
> > > + atomic_dec_not_zero(&parent->power.child_count);
>
> I'd like to understand... Why not atomic_dec in the first place? Count
> should be exact, anyway, or we run into problems, right?
Well, we'll also run into trouble if the count becomes negative. We might
throw a WARN_ON() there if the old value weren't as expected, but that
would be a separate patch.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCHv4 05/11] omap3isp: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (2 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 04/11] PM: Use *_dec_not_zero instead of *_add_unless Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-31 15:00 ` Laurent Pinchart
2011-07-27 9:47 ` [PATCHv4 06/11] qeth: " Sven Eckelmann
` (5 subsequent siblings)
9 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Laurent Pinchart, linux-media
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org
---
drivers/media/video/omap3isp/ispstat.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/omap3isp/ispstat.c b/drivers/media/video/omap3isp/ispstat.c
index b44cb68..81b1ec9 100644
--- a/drivers/media/video/omap3isp/ispstat.c
+++ b/drivers/media/video/omap3isp/ispstat.c
@@ -652,7 +652,7 @@ static int isp_stat_buf_process(struct ispstat *stat, int buf_state)
{
int ret = STAT_NO_BUF;
- if (!atomic_add_unless(&stat->buf_err, -1, 0) &&
+ if (!atomic_dec_not_zero(&stat->buf_err) &&
buf_state == STAT_BUF_DONE && stat->state == ISPSTAT_ENABLED) {
ret = isp_stat_buf_queue(stat);
isp_stat_buf_next(stat);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCHv4 05/11] omap3isp: Use *_dec_not_zero instead of *_add_unless
2011-07-27 9:47 ` [PATCHv4 05/11] omap3isp: " Sven Eckelmann
@ 2011-07-31 15:00 ` Laurent Pinchart
2011-08-01 10:07 ` Sven Eckelmann
0 siblings, 1 reply; 21+ messages in thread
From: Laurent Pinchart @ 2011-07-31 15:00 UTC (permalink / raw)
To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, linux-media
Hi Sven,
Thanks for the patch.
On Wednesday 27 July 2011 11:47:44 Sven Eckelmann wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
I'll queue this to my tree for v3.2. Please let me know if you would rather
push the patch through another tree.
> Cc: linux-media@vger.kernel.org
> ---
> drivers/media/video/omap3isp/ispstat.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/video/omap3isp/ispstat.c
> b/drivers/media/video/omap3isp/ispstat.c index b44cb68..81b1ec9 100644
> --- a/drivers/media/video/omap3isp/ispstat.c
> +++ b/drivers/media/video/omap3isp/ispstat.c
> @@ -652,7 +652,7 @@ static int isp_stat_buf_process(struct ispstat *stat,
> int buf_state) {
> int ret = STAT_NO_BUF;
>
> - if (!atomic_add_unless(&stat->buf_err, -1, 0) &&
> + if (!atomic_dec_not_zero(&stat->buf_err) &&
> buf_state == STAT_BUF_DONE && stat->state == ISPSTAT_ENABLED) {
> ret = isp_stat_buf_queue(stat);
> isp_stat_buf_next(stat);
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: Re: [PATCHv4 05/11] omap3isp: Use *_dec_not_zero instead of *_add_unless
2011-07-31 15:00 ` Laurent Pinchart
@ 2011-08-01 10:07 ` Sven Eckelmann
2011-08-01 11:10 ` Laurent Pinchart
0 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-08-01 10:07 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-arch, linux-kernel, linux-media
[-- Attachment #1: Type: text/plain, Size: 1161 bytes --]
On Sunday 31 July 2011 17:00:43 Laurent Pinchart wrote:
> Hi Sven,
>
> Thanks for the patch.
>
> On Wednesday 27 July 2011 11:47:44 Sven Eckelmann wrote:
> > atomic_dec_not_zero is defined for each architecture through
> > <linux/atomic.h> to provide the functionality of
> > atomic_add_unless(x, -1, 0).
> >
> > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> I'll queue this to my tree for v3.2. Please let me know if you would rather
> push the patch through another tree.
The problem is that until now no one from linux-arch has applied the patch
01/11 in his tree (which is needed before this patch can be applied) and you
tree have to be based on the "yet to be chosen linux-arch tree". Otherwise
your tree will just break and not be acceptable for a pull request.
Maybe it is easier when one person applies 01-11 after 02-11 was Acked-by the
responsible maintainers.
02 is more or less automatically Acked-by us :)
04, 09 and 10 are also Acked.
... and the rest is waiting for actions.
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCHv4 05/11] omap3isp: Use *_dec_not_zero instead of *_add_unless
2011-08-01 10:07 ` Sven Eckelmann
@ 2011-08-01 11:10 ` Laurent Pinchart
0 siblings, 0 replies; 21+ messages in thread
From: Laurent Pinchart @ 2011-08-01 11:10 UTC (permalink / raw)
To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, linux-media
Hi Sven,
On Monday 01 August 2011 12:07:15 Sven Eckelmann wrote:
> On Sunday 31 July 2011 17:00:43 Laurent Pinchart wrote:
> > On Wednesday 27 July 2011 11:47:44 Sven Eckelmann wrote:
> > > atomic_dec_not_zero is defined for each architecture through
> > > <linux/atomic.h> to provide the functionality of
> > > atomic_add_unless(x, -1, 0).
> > >
> > > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> >
> > I'll queue this to my tree for v3.2. Please let me know if you would
> > rather push the patch through another tree.
>
> The problem is that until now no one from linux-arch has applied the patch
> 01/11 in his tree (which is needed before this patch can be applied) and
> you tree have to be based on the "yet to be chosen linux-arch tree".
> Otherwise your tree will just break and not be acceptable for a pull
> request.
>
> Maybe it is easier when one person applies 01-11 after 02-11 was Acked-by
> the responsible maintainers.
>
> 02 is more or less automatically Acked-by us :)
> 04, 09 and 10 are also Acked.
> ... and the rest is waiting for actions.
OK. I'm fine with 05/11 being pushed through any tree with my ack. Please let
me know if/when you want me to apply it to my tree.
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCHv4 06/11] qeth: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (3 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 05/11] omap3isp: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 07/11] ext4: " Sven Eckelmann
` (4 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch
Cc: linux-kernel, Sven Eckelmann, Ursula Braun, Frank Blaschka,
linux390, linux-s390
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Ursula Braun <ursula.braun@de.ibm.com>
Cc: Frank Blaschka <blaschka@linux.vnet.ibm.com>
Cc: linux390@de.ibm.com
Cc: linux-s390@vger.kernel.org
---
drivers/s390/net/qeth_core_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 4550573..56ceed2 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -2765,7 +2765,7 @@ void qeth_queue_input_buffer(struct qeth_card *card, int index)
atomic_set(&card->force_alloc_skb, 3);
count = newcount;
} else {
- atomic_add_unless(&card->force_alloc_skb, -1, 0);
+ atomic_dec_not_zero(&card->force_alloc_skb);
}
/*
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCHv4 07/11] ext4: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (4 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 06/11] qeth: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 08/11] xfs: " Sven Eckelmann
` (3 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch
Cc: linux-kernel, Sven Eckelmann, Theodore Ts'o, Andreas Dilger,
linux-ext4
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>
Cc: linux-ext4@vger.kernel.org
---
fs/ext4/ext4.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index fa44df8..29996e8 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2098,7 +2098,7 @@ static inline void ext4_lock_group(struct super_block *sb, ext4_group_t group)
* We're able to grab the lock right away, so drop the
* lock contention counter.
*/
- atomic_add_unless(&EXT4_SB(sb)->s_lock_busy, -1, 0);
+ atomic_dec_not_zero(&EXT4_SB(sb)->s_lock_busy);
else {
/*
* The lock is busy, so bump the contention counter,
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCHv4 08/11] xfs: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (5 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 07/11] ext4: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 09/11] memcg: " Sven Eckelmann
` (2 subsequent siblings)
9 siblings, 0 replies; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Alex Elder, xfs-masters, xfs
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Alex Elder <aelder@sgi.com>
Cc: xfs-masters@oss.sgi.com
Cc: xfs@oss.sgi.com
---
fs/xfs/linux-2.6/xfs_buf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c
index b2b4119..a68d9bf 100644
--- a/fs/xfs/linux-2.6/xfs_buf.c
+++ b/fs/xfs/linux-2.6/xfs_buf.c
@@ -1429,7 +1429,7 @@ xfs_buftarg_shrink(
* zero. If the value is already zero, we need to reclaim the
* buffer, otherwise it gets another trip through the LRU.
*/
- if (!atomic_add_unless(&bp->b_lru_ref, -1, 0)) {
+ if (!atomic_dec_not_zero(&bp->b_lru_ref)) {
list_move_tail(&bp->b_lru, &btp->bt_lru);
continue;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCHv4 09/11] memcg: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (6 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 08/11] xfs: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 11:58 ` Michal Hocko
2011-07-27 9:47 ` [PATCHv4 10/11] drop_monitor: " Sven Eckelmann
2011-07-27 9:47 ` [PATCHv4 11/11] Phonet: " Sven Eckelmann
9 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch
Cc: linux-kernel, Sven Eckelmann, Balbir Singh, Daisuke Nishimura,
KAMEZAWA Hiroyuki, linux-mm
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: linux-mm@kvack.org
---
mm/memcontrol.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 5f84d23..00a7580 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1909,10 +1909,10 @@ static void mem_cgroup_unmark_under_oom(struct mem_cgroup *mem)
/*
* When a new child is created while the hierarchy is under oom,
* mem_cgroup_oom_lock() may not be called. We have to use
- * atomic_add_unless() here.
+ * atomic_dec_not_zero() here.
*/
for_each_mem_cgroup_tree(iter, mem)
- atomic_add_unless(&iter->under_oom, -1, 0);
+ atomic_dec_not_zero(&iter->under_oom);
}
static DEFINE_SPINLOCK(memcg_oom_lock);
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCHv4 09/11] memcg: Use *_dec_not_zero instead of *_add_unless
2011-07-27 9:47 ` [PATCHv4 09/11] memcg: " Sven Eckelmann
@ 2011-07-27 11:58 ` Michal Hocko
0 siblings, 0 replies; 21+ messages in thread
From: Michal Hocko @ 2011-07-27 11:58 UTC (permalink / raw)
To: Sven Eckelmann
Cc: linux-arch, linux-kernel, Balbir Singh, Daisuke Nishimura,
KAMEZAWA Hiroyuki, linux-mm
On Wed 27-07-11 11:47:48, Sven Eckelmann wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
yes, I like it because atomic_dec_* is more consistent (at least from
the code reading) with atomic_inc used by mem_cgroup_mark_under_oom
which.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
> Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
> Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
> Cc: linux-mm@kvack.org
Acked-by: Michal Hocko <mhocko@suse.cz>
> ---
> mm/memcontrol.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index 5f84d23..00a7580 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1909,10 +1909,10 @@ static void mem_cgroup_unmark_under_oom(struct mem_cgroup *mem)
> /*
> * When a new child is created while the hierarchy is under oom,
> * mem_cgroup_oom_lock() may not be called. We have to use
> - * atomic_add_unless() here.
> + * atomic_dec_not_zero() here.
> */
> for_each_mem_cgroup_tree(iter, mem)
> - atomic_add_unless(&iter->under_oom, -1, 0);
> + atomic_dec_not_zero(&iter->under_oom);
> }
>
> static DEFINE_SPINLOCK(memcg_oom_lock);
> --
> 1.7.5.4
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
--
Michal Hocko
SUSE Labs
SUSE LINUX s.r.o.
Lihovarska 1060/12
190 00 Praha 9
Czech Republic
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (7 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 09/11] memcg: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 10:59 ` Neil Horman
2011-07-27 9:47 ` [PATCHv4 11/11] Phonet: " Sven Eckelmann
9 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Neil Horman, netdev
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev@vger.kernel.org
---
net/core/drop_monitor.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 7f36b38..ef4a05d 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
- if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
+ if (!atomic_dec_not_zero(&data->dm_hit_count)) {
/*
* we're already at zero, discard this hit
*/
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless
2011-07-27 9:47 ` [PATCHv4 10/11] drop_monitor: " Sven Eckelmann
@ 2011-07-27 10:59 ` Neil Horman
2011-07-27 11:52 ` Sven Eckelmann
0 siblings, 1 reply; 21+ messages in thread
From: Neil Horman @ 2011-07-27 10:59 UTC (permalink / raw)
To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, netdev
On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Neil Horman <nhorman@tuxdriver.com>
> Cc: netdev@vger.kernel.org
> ---
> net/core/drop_monitor.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 7f36b38..ef4a05d 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
>
>
> - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> + if (!atomic_dec_not_zero(&data->dm_hit_count)) {
> /*
> * we're already at zero, discard this hit
> */
> --
> 1.7.5.4
>
>
Wheres the patch that creates the per arch definition of this function? I see
the other posts in this series went to lkml, but the archives don't have the
first in the series anywhere, which ostensibly adds the definition.
Neil
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless
2011-07-27 10:59 ` Neil Horman
@ 2011-07-27 11:52 ` Sven Eckelmann
2011-07-27 14:25 ` Neil Horman
0 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 11:52 UTC (permalink / raw)
To: Neil Horman; +Cc: linux-arch, linux-kernel, netdev
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
On Wednesday 27 July 2011 06:59:07 Neil Horman wrote:
> On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote:
> > atomic_dec_not_zero is defined for each architecture through
> > <linux/atomic.h> to provide the functionality of
> > atomic_add_unless(x, -1, 0).
> >
> > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > Cc: Neil Horman <nhorman@tuxdriver.com>
> > Cc: netdev@vger.kernel.org
> > ---
> >
> > net/core/drop_monitor.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 7f36b38..ef4a05d 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
> > @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb,
> > void *location)
> >
> > struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> >
> > - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> > + if (!atomic_dec_not_zero(&data->dm_hit_count)) {
> >
> > /*
> >
> > * we're already at zero, discard this hit
> > */
>
> Wheres the patch that creates the per arch definition of this function? I
> see the other posts in this series went to lkml, but the archives don't
> have the first in the series anywhere, which ostensibly adds the
> definition. Neil
Most architectures don't use a per architecture definition anymore, but a
cross-architecture the definition in include/linux/atomic.h.
The 01/11 can be found in different archives under the message id
1311760070-21532-1-git-send-email-sven@narfation.org ... for example gmane:
http://article.gmane.org/gmane.linux.ports.arm.kernel/126704
Kind regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: Re: [PATCHv4 10/11] drop_monitor: Use *_dec_not_zero instead of *_add_unless
2011-07-27 11:52 ` Sven Eckelmann
@ 2011-07-27 14:25 ` Neil Horman
0 siblings, 0 replies; 21+ messages in thread
From: Neil Horman @ 2011-07-27 14:25 UTC (permalink / raw)
To: Sven Eckelmann; +Cc: linux-arch, linux-kernel, netdev
On Wed, Jul 27, 2011 at 01:52:50PM +0200, Sven Eckelmann wrote:
> On Wednesday 27 July 2011 06:59:07 Neil Horman wrote:
> > On Wed, Jul 27, 2011 at 11:47:49AM +0200, Sven Eckelmann wrote:
> > > atomic_dec_not_zero is defined for each architecture through
> > > <linux/atomic.h> to provide the functionality of
> > > atomic_add_unless(x, -1, 0).
> > >
> > > Signed-off-by: Sven Eckelmann <sven@narfation.org>
> > > Cc: Neil Horman <nhorman@tuxdriver.com>
> > > Cc: netdev@vger.kernel.org
> > > ---
> > >
> > > net/core/drop_monitor.c | 2 +-
> > > 1 files changed, 1 insertions(+), 1 deletions(-)
> > >
> > > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > > index 7f36b38..ef4a05d 100644
> > > --- a/net/core/drop_monitor.c
> > > +++ b/net/core/drop_monitor.c
> > > @@ -137,7 +137,7 @@ static void trace_drop_common(struct sk_buff *skb,
> > > void *location)
> > >
> > > struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > >
> > > - if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> > > + if (!atomic_dec_not_zero(&data->dm_hit_count)) {
> > >
> > > /*
> > >
> > > * we're already at zero, discard this hit
> > > */
> >
> > Wheres the patch that creates the per arch definition of this function? I
> > see the other posts in this series went to lkml, but the archives don't
> > have the first in the series anywhere, which ostensibly adds the
> > definition. Neil
>
> Most architectures don't use a per architecture definition anymore, but a
> cross-architecture the definition in include/linux/atomic.h.
>
> The 01/11 can be found in different archives under the message id
> 1311760070-21532-1-git-send-email-sven@narfation.org ... for example gmane:
> http://article.gmane.org/gmane.linux.ports.arm.kernel/126704
>
> Kind regards,
> Sven
Ok, thank you, I just didn't see the patch that implemented it in the lkml
archive at MARC, and wanted to be sure this wasn't proposed for a different tree
than the patch with the definition.
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCHv4 11/11] Phonet: Use *_dec_not_zero instead of *_add_unless
[not found] <1311760070-21532-1-git-send-email-sven@narfation.org>
` (8 preceding siblings ...)
2011-07-27 9:47 ` [PATCHv4 10/11] drop_monitor: " Sven Eckelmann
@ 2011-07-27 9:47 ` Sven Eckelmann
2011-07-27 10:29 ` Rémi Denis-Courmont
9 siblings, 1 reply; 21+ messages in thread
From: Sven Eckelmann @ 2011-07-27 9:47 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel, Sven Eckelmann, Remi Denis-Courmont
atomic_dec_not_zero is defined for each architecture through
<linux/atomic.h> to provide the functionality of
atomic_add_unless(x, -1, 0).
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Cc: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
---
net/phonet/pep.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index f17fd84..b192c83 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -1013,7 +1013,7 @@ static int pipe_skb_send(struct sock *sk, struct sk_buff *skb)
int err;
if (pn_flow_safe(pn->tx_fc) &&
- !atomic_add_unless(&pn->tx_credits, -1, 0)) {
+ !atomic_dec_not_zero(&pn->tx_credits)) {
kfree_skb(skb);
return -ENOBUFS;
}
--
1.7.5.4
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCHv4 11/11] Phonet: Use *_dec_not_zero instead of *_add_unless
2011-07-27 9:47 ` [PATCHv4 11/11] Phonet: " Sven Eckelmann
@ 2011-07-27 10:29 ` Rémi Denis-Courmont
0 siblings, 0 replies; 21+ messages in thread
From: Rémi Denis-Courmont @ 2011-07-27 10:29 UTC (permalink / raw)
To: linux-arch; +Cc: linux-kernel
On Wednesday 27 July 2011 12:47:50 ext Sven Eckelmann, you wrote:
> atomic_dec_not_zero is defined for each architecture through
> <linux/atomic.h> to provide the functionality of
> atomic_add_unless(x, -1, 0).
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> Cc: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
Acked-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> ---
> net/phonet/pep.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/phonet/pep.c b/net/phonet/pep.c
> index f17fd84..b192c83 100644
> --- a/net/phonet/pep.c
> +++ b/net/phonet/pep.c
> @@ -1013,7 +1013,7 @@ static int pipe_skb_send(struct sock *sk, struct
> sk_buff *skb) int err;
>
> if (pn_flow_safe(pn->tx_fc) &&
> - !atomic_add_unless(&pn->tx_credits, -1, 0)) {
> + !atomic_dec_not_zero(&pn->tx_credits)) {
> kfree_skb(skb);
> return -ENOBUFS;
> }
--
Rémi Denis-Courmont
http://www.remlab.net/
^ permalink raw reply [flat|nested] 21+ messages in thread