Message ID | 20230919014126.8168-1-zeming@nfschina.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3070892vqi; Mon, 18 Sep 2023 18:45:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEUG1OUiqXGiOglBMTkMvRepnFwLfxjlBmb8Yr1cAUeYFnKArIkNzLHVdVlYNpnpibeRhYb X-Received: by 2002:a17:90b:2248:b0:268:dad:2fdc with SMTP id hk8-20020a17090b224800b002680dad2fdcmr9859038pjb.21.1695087913812; Mon, 18 Sep 2023 18:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695087913; cv=none; d=google.com; s=arc-20160816; b=pduLdGHqoeYqga6tE3OWvccca1Ao1mCQwSSGeq0rJdqopohTjV26DvyKE9neWVpanu UYktGX09mp9eVr/9i1m/8ZMdpxLDFXcWe1G77uSrLhPVoL9GAj3uE3nKpVh3gzwMZyOk rg9aZl1KEUBbCRsbt2ri3A5b9V9kfhdnWCBFq4+ecsYDuDjrix9IU9IsTSv23YIyQ5Sy 5Wmp7dPh5Bu1Dxya6Efkjn1Fjkc/mjdAMYxXVXdqVyDaWr7+dTLrXoscF1szT/uoFRj6 9PvTSrD61cVI9Tnx1G6JDyiM3dLclBJj33ID1ytI3f22Lu7QBpU8hixpbxnILfHEwpbC 40rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gI3UZLstAq/14G5ifOvn0kzR29tTf4wJzjILMyiSgVg=; fh=8XpIR3SRSGpiTuoD3koJVBchjt4kyPMccuJ+vR8LWyU=; b=hHzEPZBP/QiwZDvAw8GdDKxL0sN3zvTYb5Lzohge/O5mywhyhE4CMNeqBq2KqEh5Qg R0F7Nc2iX0vSMaMq3/Z/MFQHiqxyG/9D063wI0teK7/oHZAoAUGCp9ZHxvd7UU2ooOXx eQLnnpSgRjGvrQIBwWL1bwmUu74XijsMQY3rLtO+EBJcc6lxHCh+Rcj54xUNE4s930oX n7AQhztO/JVr93ihZeocvgX75hnPUvW28CFK7xFaFjSULE6mI2bXNc0nV7a/DNzFVCRJ DvXWX1+++00GiJXLkjqOP0T+/6IhRCFdOfoRHUM93ND85wAZ1J4AUY2wGAhHZf7MmbAr L7gA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id b4-20020a17090a9bc400b002768cfbe6desi1078271pjw.112.2023.09.18.18.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:45:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CD56B80713F5; Mon, 18 Sep 2023 18:42:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230465AbjISBlx (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Mon, 18 Sep 2023 21:41:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230453AbjISBlw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 21:41:52 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 5FE3910D for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 18:41:46 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id D3F6460292BAF; Tue, 19 Sep 2023 09:41:43 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming <zeming@nfschina.com> To: linux-kernel@vger.kernel.org Cc: Li zeming <zeming@nfschina.com> Subject: [PATCH] =?utf-8?q?profile=3A_Remove_unnecessary_=E2=80=980=E2=80=99?= =?utf-8?q?_values_from_err?= Date: Tue, 19 Sep 2023 09:41:26 +0800 Message-Id: <20230919014126.8168-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 18:42:02 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777428504124141297 X-GMAIL-MSGID: 1777428504124141297 |
Series |
profile: Remove unnecessary ‘0’ values from err
|
|
Commit Message
Li zeming
Sept. 19, 2023, 1:41 a.m. UTC
err is assigned first, so it does not need to initialize the assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
kernel/profile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Hi Li, kernel test robot noticed the following build warnings: https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Li-zeming/profile-Remove-unnecessary-0-values-from-err/20230919-094202 base: linus/master patch link: https://lore.kernel.org/r/20230919014126.8168-1-zeming%40nfschina.com patch subject: [PATCH] profile: Remove unnecessary ‘0’ values from err config: i386-randconfig-141-20230921 (https://download.01.org/0day-ci/archive/20231012/202310120931.henXte1M-lkp@intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: (https://download.01.org/0day-ci/archive/20231012/202310120931.henXte1M-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org> | Closes: https://lore.kernel.org/r/202310120931.henXte1M-lkp@intel.com/ smatch warnings: kernel/profile.c:491 create_proc_profile() error: uninitialized symbol 'err'. vim +/err +491 kernel/profile.c ^1da177e4c3f41 Linus Torvalds 2005-04-16 467 1997ab2b2a8d46 Li zeming 2023-09-19 468 int err; ^1da177e4c3f41 Linus Torvalds 2005-04-16 469 ^1da177e4c3f41 Linus Torvalds 2005-04-16 470 if (!prof_on) ^1da177e4c3f41 Linus Torvalds 2005-04-16 471 return 0; e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 472 #ifdef CONFIG_SMP e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 473 err = cpuhp_setup_state(CPUHP_PROFILE_PREPARE, "PROFILE_PREPARE", e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 474 profile_prepare_cpu, profile_dead_cpu); e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 475 if (err) e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 476 return err; c270a817196a93 Srivatsa S. Bhat 2014-03-11 477 e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 478 err = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "AP_PROFILE_ONLINE", e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 479 profile_online_cpu, NULL); e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 480 if (err < 0) e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 481 goto err_state_prep; e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 482 online_state = err; e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 483 err = 0; e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 484 #endif err is uninitialized on single processor systems. c33fff0afbef4f Denis V. Lunev 2008-04-29 485 entry = proc_create("profile", S_IWUSR | S_IRUGO, 97a32539b9568b Alexey Dobriyan 2020-02-03 486 NULL, &profile_proc_ops); 1ad82fd547c716 Paolo Ciarrocchi 2008-01-25 487 if (!entry) e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 488 goto err_state_onl; 271a15eabe0945 David Howells 2013-04-12 489 proc_set_size(entry, (1 + prof_len) * sizeof(atomic_t)); c270a817196a93 Srivatsa S. Bhat 2014-03-11 490 e722d8daafb974 Sebastian Andrzej Siewior 2016-07-13 @491 return err;
diff --git a/kernel/profile.c b/kernel/profile.c index 8a77769bc4b4..87acc7a9d7e2 100644 --- a/kernel/profile.c +++ b/kernel/profile.c @@ -465,7 +465,7 @@ int __ref create_proc_profile(void) enum cpuhp_state online_state; #endif - int err = 0; + int err; if (!prof_on) return 0;