Re: [PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Viresh Kumar
On 25 September 2012 23:17, Tejun Heo  wrote:
> On Tue, Sep 25, 2012 at 04:06:07PM +0530, Viresh Kumar wrote:
>> flush_delayed_work() and flush_delayed_work_sync() had major portion of code
>> similar. This patch introduces another routine __flush_delayed_work() which
>> contains the common part to avoid code duplication.
>
> This part has seen a lot of update in pending wq/for-3.7 branch.
> Please rebase on top of that.
>
>  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-3.7

So, this patch is not required anymore. As they are already merged :)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Tejun Heo
On Tue, Sep 25, 2012 at 04:06:07PM +0530, Viresh Kumar wrote:
> flush_delayed_work() and flush_delayed_work_sync() had major portion of code
> similar. This patch introduces another routine __flush_delayed_work() which
> contains the common part to avoid code duplication.

This part has seen a lot of update in pending wq/for-3.7 branch.
Please rebase on top of that.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-3.7

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Viresh Kumar
flush_delayed_work() and flush_delayed_work_sync() had major portion of code
similar. This patch introduces another routine __flush_delayed_work() which
contains the common part to avoid code duplication.

Signed-off-by: Viresh Kumar 
---
 kernel/workqueue.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 692d976..692a55b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2820,6 +2820,13 @@ bool cancel_work_sync(struct work_struct *work)
 }
 EXPORT_SYMBOL_GPL(cancel_work_sync);
 
+static inline void __flush_delayed_work(struct delayed_work *dwork)
+{
+   if (del_timer_sync(>timer))
+   __queue_work(raw_smp_processor_id(),
+get_work_cwq(>work)->wq, >work);
+}
+
 /**
  * flush_delayed_work - wait for a dwork to finish executing the last queueing
  * @dwork: the delayed work to flush
@@ -2834,9 +2841,7 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
  */
 bool flush_delayed_work(struct delayed_work *dwork)
 {
-   if (del_timer_sync(>timer))
-   __queue_work(raw_smp_processor_id(),
-get_work_cwq(>work)->wq, >work);
+   __flush_delayed_work(dwork);
return flush_work(>work);
 }
 EXPORT_SYMBOL(flush_delayed_work);
@@ -2855,9 +2860,7 @@ EXPORT_SYMBOL(flush_delayed_work);
  */
 bool flush_delayed_work_sync(struct delayed_work *dwork)
 {
-   if (del_timer_sync(>timer))
-   __queue_work(raw_smp_processor_id(),
-get_work_cwq(>work)->wq, >work);
+   __flush_delayed_work(dwork);
return flush_work_sync(>work);
 }
 EXPORT_SYMBOL(flush_delayed_work_sync);
-- 
1.7.12.rc2.18.g61b472e


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Viresh Kumar
flush_delayed_work() and flush_delayed_work_sync() had major portion of code
similar. This patch introduces another routine __flush_delayed_work() which
contains the common part to avoid code duplication.

Signed-off-by: Viresh Kumar viresh.ku...@linaro.org
---
 kernel/workqueue.c | 15 +--
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 692d976..692a55b 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -2820,6 +2820,13 @@ bool cancel_work_sync(struct work_struct *work)
 }
 EXPORT_SYMBOL_GPL(cancel_work_sync);
 
+static inline void __flush_delayed_work(struct delayed_work *dwork)
+{
+   if (del_timer_sync(dwork-timer))
+   __queue_work(raw_smp_processor_id(),
+get_work_cwq(dwork-work)-wq, dwork-work);
+}
+
 /**
  * flush_delayed_work - wait for a dwork to finish executing the last queueing
  * @dwork: the delayed work to flush
@@ -2834,9 +2841,7 @@ EXPORT_SYMBOL_GPL(cancel_work_sync);
  */
 bool flush_delayed_work(struct delayed_work *dwork)
 {
-   if (del_timer_sync(dwork-timer))
-   __queue_work(raw_smp_processor_id(),
-get_work_cwq(dwork-work)-wq, dwork-work);
+   __flush_delayed_work(dwork);
return flush_work(dwork-work);
 }
 EXPORT_SYMBOL(flush_delayed_work);
@@ -2855,9 +2860,7 @@ EXPORT_SYMBOL(flush_delayed_work);
  */
 bool flush_delayed_work_sync(struct delayed_work *dwork)
 {
-   if (del_timer_sync(dwork-timer))
-   __queue_work(raw_smp_processor_id(),
-get_work_cwq(dwork-work)-wq, dwork-work);
+   __flush_delayed_work(dwork);
return flush_work_sync(dwork-work);
 }
 EXPORT_SYMBOL(flush_delayed_work_sync);
-- 
1.7.12.rc2.18.g61b472e


--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Tejun Heo
On Tue, Sep 25, 2012 at 04:06:07PM +0530, Viresh Kumar wrote:
 flush_delayed_work() and flush_delayed_work_sync() had major portion of code
 similar. This patch introduces another routine __flush_delayed_work() which
 contains the common part to avoid code duplication.

This part has seen a lot of update in pending wq/for-3.7 branch.
Please rebase on top of that.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-3.7

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/3] workqueue: create __flush_delayed_work to avoid duplicating code

2012-09-25 Thread Viresh Kumar
On 25 September 2012 23:17, Tejun Heo t...@kernel.org wrote:
 On Tue, Sep 25, 2012 at 04:06:07PM +0530, Viresh Kumar wrote:
 flush_delayed_work() and flush_delayed_work_sync() had major portion of code
 similar. This patch introduces another routine __flush_delayed_work() which
 contains the common part to avoid code duplication.

 This part has seen a lot of update in pending wq/for-3.7 branch.
 Please rebase on top of that.

  git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git for-3.7

So, this patch is not required anymore. As they are already merged :)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/