Message ID | 20231018074155.68775-1-jiapeng.chong@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4625538vqb; Wed, 18 Oct 2023 00:42:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBfQR07tS3q1mIrXSX6OBfEYqg4iB9tY/y+jDpZHniilcigghwxeaB9UjClTaa0Vmkb5CX X-Received: by 2002:a05:6a20:8f28:b0:172:55c1:f1d4 with SMTP id b40-20020a056a208f2800b0017255c1f1d4mr5097387pzk.4.1697614946699; Wed, 18 Oct 2023 00:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697614946; cv=none; d=google.com; s=arc-20160816; b=WI7YBccleRsXya3m6PSF7Kr5kyY635+jQu7hA+jtSzbeiyEtdTl9IstjceuHkHd2KF UZ/gfMmlAOuA4z+49ORx1EZH2O5uC+xJtya2mpeSLZYm95cQjPIhqn7yRzA/+XS9cwuF YHoLBQJns25gQ/EhK0/L88fgYJ3rBRFt/mmj99B5IDHNkTpuhmNgQmJJZGVImdj1ZI5z ekI3yZJwl+OpYN4A9qB/7rcgHc2u12k6EWOY82r4QEdvJnm5hXLvC5Rm1CRZqHnOX5wK WLmP31ip2aAVjCklyTo+aWS+SC/eNYc8UtH0/Q3sOf1rH/1PEDFObdgtE5r0N0etMV05 8oew== 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=4o5rY58v6jm34/f1URAbySbD3/Gadp5IL9ibYXO/D1o=; fh=0VuHv1ZlObXZ/AHP9yc1x7vAFlbENsSqo0R8x8ZF8Yg=; b=kO7QITDd8fC79d4P4i4FSLa1rLVeZeK8gBjdCkcOWn7Av3K+k+3Wp2I4GJL9t97TTW 9h6dH5QWF9UPMT4MgBtylyne2TqF9C8Rf+RZCs6bePNHF6gAavWYbXbDW6EYJ2dTLV1G RvDwEcGh5zcNUQ87S4IGFpelKn4+P5sJ+Fs6Gfs1/tCLW5hRSI2ETot2L634CDqPMvBU f1XRcNVdKptdsJJtZqQBMigmQoxIJ3k67Mm+p0wtXbQJhggJ3sQxgip/Li47a49Er8NW bHRmQXuRe5BuwuRqOtBJdfCjxapt6hci/8ccT0TpjR5DLP0YPSzmyXRUSl5wbqxZHXev rX6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id i4-20020a170902eb4400b001c9e3c866casi3440968pli.19.2023.10.18.00.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 00:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8B08080FE95E; Wed, 18 Oct 2023 00:42:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344577AbjJRHmL (ORCPT <rfc822;zwp10758@gmail.com> + 23 others); Wed, 18 Oct 2023 03:42:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229638AbjJRHmJ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 18 Oct 2023 03:42:09 -0400 Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26F6BB6 for <linux-kernel@vger.kernel.org>; Wed, 18 Oct 2023 00:42:06 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046060;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VuPvrwo_1697614917; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0VuPvrwo_1697614917) by smtp.aliyun-inc.com; Wed, 18 Oct 2023 15:42:03 +0800 From: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> To: tglx@linutronix.de Cc: mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, jgross@suse.com, linux-kernel@vger.kernel.org, Jiapeng Chong <jiapeng.chong@linux.alibaba.com>, Abaci Robot <abaci@linux.alibaba.com> Subject: [PATCH] x86/mtrr: Remove redundant code Date: Wed, 18 Oct 2023 15:41:55 +0800 Message-Id: <20231018074155.68775-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.7 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email 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 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 00:42:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780078290202188270 X-GMAIL-MSGID: 1780078290202188270 |
Series |
x86/mtrr: Remove redundant code
|
|
Commit Message
Jiapeng Chong
Oct. 18, 2023, 7:41 a.m. UTC
arch/x86/kernel/cpu/mtrr/cleanup.c:943:4: warning: Value stored to 'highest_pfn' is never read.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6912
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
arch/x86/kernel/cpu/mtrr/cleanup.c | 2 --
1 file changed, 2 deletions(-)
Comments
* Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote: > arch/x86/kernel/cpu/mtrr/cleanup.c:943:4: warning: Value stored to 'highest_pfn' is never read. > > Reported-by: Abaci Robot <abaci@linux.alibaba.com> > Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=6912 > Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> > --- > arch/x86/kernel/cpu/mtrr/cleanup.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c > index 18cf79d6e2c5..c4ec295cebbc 100644 > --- a/arch/x86/kernel/cpu/mtrr/cleanup.c > +++ b/arch/x86/kernel/cpu/mtrr/cleanup.c > @@ -939,8 +939,6 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn) > if (mtrr_tom2) { > range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT)); > range[nr_range].end = mtrr_tom2 >> PAGE_SHIFT; > - if (highest_pfn < range[nr_range].end) > - highest_pfn = range[nr_range].end; > nr_range++; > } > nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0); Please explain in the changelog how that redundant code got there and why there's no underlying bug to be concerned about. [ I just did that myself and could share the results - but this kind of analysis has to be done when submitting "cleanup" patches changing such type of code ... or at least it has to be flagged, not just mindlessly removing code ... ] Thanks, Ingo
diff --git a/arch/x86/kernel/cpu/mtrr/cleanup.c b/arch/x86/kernel/cpu/mtrr/cleanup.c index 18cf79d6e2c5..c4ec295cebbc 100644 --- a/arch/x86/kernel/cpu/mtrr/cleanup.c +++ b/arch/x86/kernel/cpu/mtrr/cleanup.c @@ -939,8 +939,6 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn) if (mtrr_tom2) { range[nr_range].start = (1ULL<<(32 - PAGE_SHIFT)); range[nr_range].end = mtrr_tom2 >> PAGE_SHIFT; - if (highest_pfn < range[nr_range].end) - highest_pfn = range[nr_range].end; nr_range++; } nr_range = x86_get_mtrr_mem_range(range, nr_range, 0, 0);