From patchwork Thu Dec 28 03:17:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li kunyu X-Patchwork-Id: 183625 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:6f82:b0:100:9c79:88ff with SMTP id tb2csp1784645dyb; Wed, 27 Dec 2023 19:18:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1OoGSGmRFHcsOyU73z2sirVfT9RmclAkDKeL09ddNDFvKjFP07Dg9qyEIZ5dMDJ5bWRxX X-Received: by 2002:a05:6808:19a4:b0:3b9:d75e:f972 with SMTP id bj36-20020a05680819a400b003b9d75ef972mr11757061oib.85.1703733501140; Wed, 27 Dec 2023 19:18:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703733501; cv=none; d=google.com; s=arc-20160816; b=uoutUgziwEgoN4GpzR5jWVr1KbbHDkllqBRubAMmHUB5ChdMLhM31krOuR435PAPzH cC3/EhWPTZQG4qRMyfanAIrXhMzkFD5C1wlmMn9X4vNN9y8VyytsUVW7wWf/t5hNGPa1 uEGmLpIy0MjrkdPVDBkApDQ/Or71bsbQHqsZV+akMaeMf8C7COdHLPO8NJBKqTk4blyf q2hh88Ceoaw6L0FKnVauvBcHjfuAMj35flSuBf6A4/K/v+WkxUcJy3QsdQBHOS051+f/ YXkYQ77gwZUWvbKn/R09fU2UoUMghxoQBQxfa8CAG2G/9wffgHPgj912lswuQ1dKnypC WIRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=F43yzqvdmqVm9+lBJxQ2Rh6x8twQbl5a5/GyywrAEJ0=; fh=IzSFRxsoHPKAHnIzT9loNGJhteyATfBRyrWDG5y974k=; b=gWMnfDcNSKAAS3zqvE8yh03ubduSR8UjQ4n/Ngi+9noK9XltCsLwYhiWu3a/s28gxQ J5LOked0yccOeFCFfLDPww83eH371jn5bA6Oo/oJaBIcYB1lyVjbkBb6YXbZ1bEhkbNs cbDra4PyVx038TsaozZ/8ZGp+6h5DK3u0ktG7sHbVY9/P79jB74F5Cq65Xo3mk7oClvv aCwNCGFNK/Bkin9TlA9P/ErqzDRrKpKlgPe1LNhj8Wr8+goqqK+KqMzDuF0f28cWCM+o PkRntKS1YdoeD3Rpbn5KJzTdEGZGotKEqaKlbLQVbw4hAlFuKXtfTUPmFSgZEmQVw99O fdzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12404-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12404-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c6-20020a0ce7c6000000b0067f8498fdabsi14445189qvo.408.2023.12.27.19.18.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 19:18:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12404-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-12404-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12404-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E93011C216DF for ; Thu, 28 Dec 2023 03:18:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5710763B6; Thu, 28 Dec 2023 03:18:03 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 6546F5244 for ; Thu, 28 Dec 2023 03:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 9929F6019ED87; Thu, 28 Dec 2023 11:17:52 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: tglx@linutronix.de, peterz@infradead.org Cc: linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH] =?utf-8?q?kernel=3A_cpu=3A_Remove_unnecessary_=E2=80=980?= =?utf-8?q?=E2=80=99_values_from_ret?= Date: Thu, 28 Dec 2023 11:17:50 +0800 Message-Id: <20231228031750.12941-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1786494059747908840 X-GMAIL-MSGID: 1786494059747908840 The ret variable is assigned when it does not need to be defined, as it has already been assigned before use. Signed-off-by: Li kunyu --- kernel/cpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 6de7c6bb74eee..c1f331ddf0dc7 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -998,7 +998,7 @@ static int cpuhp_up_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st, enum cpuhp_state target) { enum cpuhp_state prev_state = st->state; - int ret = 0; + int ret; ret = cpuhp_invoke_callback_range(true, cpu, st, target); if (ret) { @@ -1402,7 +1402,7 @@ static int cpuhp_down_callbacks(unsigned int cpu, struct cpuhp_cpu_state *st, enum cpuhp_state target) { enum cpuhp_state prev_state = st->state; - int ret = 0; + int ret; ret = cpuhp_invoke_callback_range(false, cpu, st, target); if (ret) { @@ -2488,7 +2488,7 @@ int __cpuhp_setup_state_cpuslocked(enum cpuhp_state state, int (*teardown)(unsigned int cpu), bool multi_instance) { - int cpu, ret = 0; + int cpu, ret; bool dynstate; lockdep_assert_cpus_held();