Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp107200ybz; Tue, 28 Apr 2020 19:22:37 -0700 (PDT) X-Google-Smtp-Source: APiQypK2TSC+SbVgJGyC2VQv7SIrl6By8dAokclLPfqf7UNeFVWDul2vRcF849b67sHVQZ2KnQlR X-Received: by 2002:a17:906:5e50:: with SMTP id b16mr604343eju.331.1588126957195; Tue, 28 Apr 2020 19:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588126957; cv=none; d=google.com; s=arc-20160816; b=STU+POHRpPmQ3fFYXihXB9518Er2E+p+GSF+aF3cAAJ4jS62HNqc1+Yh0auitip9zP 1zDeJd+cAiu396H3RMbDNMw31FIGyMZRuFav8sn+hDlpwnS656RnMtg7tCnf2PwyMA+d LSaDszsYgh5X7mkg0kHjPctQpSdoyPv9ctLWaNRNin7lqH0B19VFpad3WOIuGGtLpIzW ZvUd0SAe1p1Zx4s+dXHiv7LvIk+WLKE98Dv5uGggqKvzkAOfllKwj+0xFIz32IMsSXl7 SJRbLdVVgpiAkkYLXfoBqA2hQFUEZNQeAcItbRBryT6meKaXfh7hg9YfowwgI4kwFtO0 SkZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=yliQJbnfEYsEii+8z3aBoGQQNvsBG+whiVnwBChCNWA=; b=N7wVdU0paCTCTvMWoWaW5Otg9wYjluICHc/HdiKCg+bq7hyM6iek2Ooljz83oD/OZQ QkKshAp74vFlUcbw++uehD3Tw6S34Vh2RnbTzfUa3lGoSVuyPbvcY6Bzw+K9S3i4SeSE gy9ExKveQfI1G//RGJY3qkXRsotLu5jfxxmRI+Lf1hlfj+jJsDpJNjGEBnsqeVU/nb+F 9kDmq4fPuoQjdlzZdgppfLAo+zJavfjTf4SZ4qQYoMak92Vz7LYaIn/eU1qGUKDQB7/2 rDChyIVD6MDLSH3BBjLTGfsiNXMR2oRuDxVvXuHRXGdt/1I9a0o+Wb6sxmuyDqjIWy9S zscg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tAavYxYK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id aq26si2977789ejc.26.2020.04.28.19.22.14; Tue, 28 Apr 2020 19:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tAavYxYK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726551AbgD2CTb (ORCPT + 99 others); Tue, 28 Apr 2020 22:19:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726430AbgD2CTb (ORCPT ); Tue, 28 Apr 2020 22:19:31 -0400 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11E49C03C1AC for ; Tue, 28 Apr 2020 19:19:30 -0700 (PDT) Received: by mail-pf1-x442.google.com with SMTP id p25so332837pfn.11 for ; Tue, 28 Apr 2020 19:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yliQJbnfEYsEii+8z3aBoGQQNvsBG+whiVnwBChCNWA=; b=tAavYxYKE34MWcTAGwCgbZhjvK5+1sZ7DqCjjiXZXFa/9BNhjZrjSdl0aOjT0yt8v0 CKS/78B0KHpc9T6KhW29Tv3rkRayHtSAaZx5s0XdqLwAYkq8+2sj4aa8jzu5dpe5x8Ua g8ptE/gNDz+lHsAUfQFQECiOLG++ZiHJDi3xIrMsGF8yBwqOM+anZEVoof7Y16jLorLV mSPZamxrkzlMLtVXwozc1X2y15wKPJwAT5ZfMjPWfeqHBKI1ITyQEZR/WGIy3yh3i0JZ D7nLc7xqG0ZxUAodKgrzeBD4W+gqgsfzPK167kW/IALFX8pjKFNOy0TbwsSAv9/gzIs8 Az2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yliQJbnfEYsEii+8z3aBoGQQNvsBG+whiVnwBChCNWA=; b=D/yRYiAtvY3dZ4GsAijACkXPOsxtMsmz/6GI6y4N34F3NcvAzWSs9Jr7t49hyzdEVh DO0eJLgJCQMo1IvmG02xascFTxiv0gExBL/Uz99d7Trd+YP2ts0pW2bs0+xDVQhrP8Lr wgtfwKooNvbSTUm9PtK7HfffKZWP298Fzs8S1J1lJZExgORXYH56FxB/ZMx2PUNsSSXO 3h26S2sDereDRJ55NHJ5lN8WCqcWk1LCt4AqknJciUAH31LAb3Ea64ecyiKgmjPAd9eo nmt1pI5tBg4ZMi1AhJGnMqN2x2wjkbLwMohRUsVl8HOaFF8ECHj8U/Nr3WRYmOJy3HWM JD3w== X-Gm-Message-State: AGi0PuYeXtnKqT4vFvg7pzr3GDd004o89qESQrPu918sPB758JJ2zTWk xC2dos8xj/qe1kL2euDhyfg= X-Received: by 2002:aa7:9724:: with SMTP id k4mr33177893pfg.309.1588126768306; Tue, 28 Apr 2020 19:19:28 -0700 (PDT) Received: from localhost ([159.203.232.101]) by smtp.gmail.com with ESMTPSA id b24sm16257206pfd.175.2020.04.28.19.19.26 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 28 Apr 2020 19:19:27 -0700 (PDT) From: Sean Fu To: tj@kernel.org Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, Sean Fu Subject: [PATCH] workqueue: Use IS_ERR and PTR_ERR instead of PTR_ERR_OR_ZERO to remove redundant definitions and checks. Date: Wed, 29 Apr 2020 10:19:05 +0800 Message-Id: <20200429021905.10639-1-fxinrong@gmail.com> X-Mailer: git-send-email 2.16.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- kernel/workqueue.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 891ccad5f271..ddf0537dce14 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -4197,7 +4197,6 @@ static int wq_clamp_max_active(int max_active, unsigned int flags, static int init_rescuer(struct workqueue_struct *wq) { struct worker *rescuer; - int ret; if (!(wq->flags & WQ_MEM_RECLAIM)) return 0; @@ -4208,10 +4207,9 @@ static int init_rescuer(struct workqueue_struct *wq) rescuer->rescue_wq = wq; rescuer->task = kthread_create(rescuer_thread, rescuer, "%s", wq->name); - ret = PTR_ERR_OR_ZERO(rescuer->task); - if (ret) { + if (IS_ERR(rescuer->task)) { kfree(rescuer); - return ret; + return PTR_ERR(rescuer->task); } wq->rescuer = rescuer; -- 2.16.4