From patchwork Thu Jun 24 07:42:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 12341457 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C982C48BDF for ; Thu, 24 Jun 2021 07:44:45 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F5DD61248 for ; Thu, 24 Jun 2021 07:44:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F5DD61248 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UQLfvHBF0N1F9CHtp+dt8gk31nHju3UDhnYeD2y7rJg=; b=bwBxjJ7M7yFbTn Iv4hemULRoZYopTjFDMSPM+xWnqvJdCsC56nsvaCE2r7KXOD5jGxS+kJPIiLUSnbMOj2Rioe4tZTr J+KebWrmkO7Z+UK7rHa795ImZmhqD2MtRrGsoZGTsaWWU+k37adsE07V5bPhzpSeCWySXwoxamn99 8fH5e8R/0S3jk80jTI9JerI5P2IPc5U7i2ci0WMVuxiNg2QYsB8PuD4Jl7PsHEvNo/h47fZsSJHsK 6gDpiQ1zwBogbGkFne3pPW32pfeQ8wcv2FRE/tFvnncCJhhYC4oWQYt0kutPx04caNIJGn8+Clz0b ZCnSrHEB1mOHJR+x7MhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwK0m-00DJb6-Gh; Thu, 24 Jun 2021 07:42:56 +0000 Received: from cmccmta3.chinamobile.com ([221.176.66.81]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lwK0h-00DJZX-Ge for linux-arm-kernel@lists.infradead.org; Thu, 24 Jun 2021 07:42:53 +0000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.7]) by rmmx-syy-dmz-app09-12009 (RichMail) with SMTP id 2ee960d437580fe-eca96; Thu, 24 Jun 2021 15:42:17 +0800 (CST) X-RM-TRANSID: 2ee960d437580fe-eca96 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[223.112.105.130]) by rmsmtp-syy-appsvr04-12004 (RichMail) with SMTP id 2ee460d43752bc5-e26d2; Thu, 24 Jun 2021 15:42:16 +0800 (CST) X-RM-TRANSID: 2ee460d43752bc5-e26d2 From: Tang Bin To: linux@armlinux.org.uk Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] ARM: bL_switcher: use IS_ERR_OR_NULL() to simplify code Date: Thu, 24 Jun 2021 15:42:23 +0800 Message-Id: <20210624074223.11372-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210624_004252_077752_2D0EC4D0 X-CRM114-Status: UNSURE ( 8.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use IS_ERR_OR_NULL() instead of IS_ERR() to simplify code. Signed-off-by: Tang Bin --- arch/arm/common/bL_switcher.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/arm/common/bL_switcher.c b/arch/arm/common/bL_switcher.c index 9a9aa5354..b8e8e2567 100644 --- a/arch/arm/common/bL_switcher.c +++ b/arch/arm/common/bL_switcher.c @@ -352,11 +352,9 @@ int bL_switch_request_cb(unsigned int cpu, unsigned int new_cluster_id, t = &bL_threads[cpu]; - if (IS_ERR(t->task)) - return PTR_ERR(t->task); - if (!t->task) - return -ESRCH; - + if (IS_ERR_OR_NULL(t->task)) + return t->task ? PTR_ERR(t->task) : -ESRCH; + spin_lock(&t->lock); if (t->completer) { spin_unlock(&t->lock);