workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO.
Replace inline function PTR_ERR_OR_ZERO with IS_ERR and PTR_ERR to remove redundant parameter definitions and checks. Reduce code size. Before: text data bss dec hex filename 47510 5979 840 54329 d439 kernel/workqueue.o After: text data bss dec hex filename 47474 5979 840 54293 d415 kernel/workqueue.o Signed-off-by: Sean Fu <fxinrong@gmail.com> Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
parent
47cf1b422e
commit
f187b6974f
@ -4197,7 +4197,6 @@ static int wq_clamp_max_active(int max_active, unsigned int flags,
|
|||||||
static int init_rescuer(struct workqueue_struct *wq)
|
static int init_rescuer(struct workqueue_struct *wq)
|
||||||
{
|
{
|
||||||
struct worker *rescuer;
|
struct worker *rescuer;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (!(wq->flags & WQ_MEM_RECLAIM))
|
if (!(wq->flags & WQ_MEM_RECLAIM))
|
||||||
return 0;
|
return 0;
|
||||||
@ -4208,10 +4207,9 @@ static int init_rescuer(struct workqueue_struct *wq)
|
|||||||
|
|
||||||
rescuer->rescue_wq = wq;
|
rescuer->rescue_wq = wq;
|
||||||
rescuer->task = kthread_create(rescuer_thread, rescuer, "%s", wq->name);
|
rescuer->task = kthread_create(rescuer_thread, rescuer, "%s", wq->name);
|
||||||
ret = PTR_ERR_OR_ZERO(rescuer->task);
|
if (IS_ERR(rescuer->task)) {
|
||||||
if (ret) {
|
|
||||||
kfree(rescuer);
|
kfree(rescuer);
|
||||||
return ret;
|
return PTR_ERR(rescuer->task);
|
||||||
}
|
}
|
||||||
|
|
||||||
wq->rescuer = rescuer;
|
wq->rescuer = rescuer;
|
||||||
|
Loading…
Reference in New Issue
Block a user