From patchwork Sun Dec 4 03:14:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: mawupeng X-Patchwork-Id: 13063724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9036FC352A1 for ; Sun, 4 Dec 2022 03:14:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DF8B78E0002; Sat, 3 Dec 2022 22:14:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DA7FA8E0001; Sat, 3 Dec 2022 22:14:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C6F808E0002; Sat, 3 Dec 2022 22:14:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B31F88E0001 for ; Sat, 3 Dec 2022 22:14:48 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8D49816012A for ; Sun, 4 Dec 2022 03:14:48 +0000 (UTC) X-FDA: 80203156656.21.8914E48 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by imf20.hostedemail.com (Postfix) with ESMTP id 0AB4E1C000F for ; Sun, 4 Dec 2022 03:14:46 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1670123688; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=A94Jx5gpZnDfPPcO1nelBjLpEijULp99U4xEQt4BRR8=; b=O1CD85URZ9nrxvbn9x8w3KJlOG3WfB3nnfQ88M1s5fKfPoBabdBccvwZ44v5tc40kpcWx8 Fl+5CXYFKVK+2EPPcB6WcOXHPOM7aSeBLC3udHFFMN8sMoA4jRRjUfC+GMSgIVizS0W1Ue wJm3zlFS7godseonFID5hFDH5KaQMpE= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf20.hostedemail.com: domain of mawupeng1@huawei.com designates 45.249.212.255 as permitted sender) smtp.mailfrom=mawupeng1@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1670123688; a=rsa-sha256; cv=none; b=ytVTehsgzy34vIyZBO5v+Q3dBddqXSCBt4PuEl1LCb6VWGKJFhWXs2kgwUVzrGgfYwOzJZ Gmz6A/YJx5zXZyqo3nusJUuTMOA4HfNDzptsuFfOWg3LbTzG2pG9t5NzFrYIvxOhxeZLLe IteFMJ3/DRBYYJg3928m+wSmncMtx68= Received: from dggpemm500014.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4NPsGG1pZgz15MvX; Sun, 4 Dec 2022 11:13:58 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sun, 4 Dec 2022 11:14:42 +0800 From: Wupeng Ma To: , , , CC: , , Subject: [PATCH -next 1/1] percpu: cleanup invalid assignment to err in pcpu_alloc Date: Sun, 4 Dec 2022 11:14:30 +0800 Message-ID: <20221204031430.662169-1-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spamd-Result: default: False [-1.40 / 9.00]; BAYES_HAM(-5.20)[98.21%]; R_MISSING_CHARSET(2.50)[]; MID_CONTAINS_FROM(1.00)[]; SUBJECT_HAS_UNDERSCORES(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[huawei.com,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:45.249.212.255]; MIME_GOOD(-0.10)[text/plain]; RCVD_NO_TLS_LAST(0.10)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_COUNT_THREE(0.00)[3]; MIME_TRACE(0.00)[0:+]; HAS_XOIP(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; ARC_SIGNED(0.00)[hostedemail.com:s=arc-20220608:i=1]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[] X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 0AB4E1C000F X-Stat-Signature: tbmtyjfmtjk5jh71pqm6a6scrdax7xwy X-HE-Tag: 1670123686-614687 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Ma Wupeng Assignment to err if is_atomic is true will never be used since warn message can only be shown if is_atomic is false after label fail. So drop it. Signed-off-by: Ma Wupeng --- mm/percpu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/percpu.c b/mm/percpu.c index acd78da0493b..df86d79325b2 100644 --- a/mm/percpu.c +++ b/mm/percpu.c @@ -1817,10 +1817,8 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved, spin_unlock_irqrestore(&pcpu_lock, flags); - if (is_atomic) { - err = "atomic alloc failed, no space left"; + if (is_atomic) goto fail; - } /* No space left. Create a new chunk. */ if (list_empty(&pcpu_chunk_lists[pcpu_free_slot])) {