From patchwork Wed Oct 28 13:31:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 11862751 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8FF97921 for ; Wed, 28 Oct 2020 13:31:22 +0000 (UTC) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1BEB122283 for ; Wed, 28 Oct 2020 13:31:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="EI8Kdjtt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1BEB122283 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+130+4688437+8417402@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id hJSGYY4689772xaY5DQyAwMd; Wed, 28 Oct 2020 06:31:21 -0700 X-Received: from mail-ej1-f68.google.com (mail-ej1-f68.google.com [209.85.218.68]) by mx.groups.io with SMTP id smtpd.web09.8916.1603891880819667457 for ; Wed, 28 Oct 2020 06:31:21 -0700 X-Received: by mail-ej1-f68.google.com with SMTP id gs25so7239173ejb.1 for ; Wed, 28 Oct 2020 06:31:20 -0700 (PDT) X-Gm-Message-State: MS3iY3gjLdLIh1gFExVI2GuWx4688437AA= X-Google-Smtp-Source: ABdhPJxxUMVps4Zr+8JbLjrzekWhd1FMxqWLG6CU91v4PGo6av3pY1PrmLW11eVHAE269DrpgpOWBw== X-Received: by 2002:a17:906:3a55:: with SMTP id a21mr7365323ejf.357.1603891879235; Wed, 28 Oct 2020 06:31:19 -0700 (PDT) X-Received: from felia.fritz.box ([2001:16b8:2d7a:200:a915:6596:e9b0:4f60]) by smtp.gmail.com with ESMTPSA id ce15sm3186691ejc.39.2020.10.28.06.31.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Oct 2020 06:31:18 -0700 (PDT) From: "Lukas Bulwahn" To: David Airlie Cc: Nathan Chancellor , Nick Desaulniers , Tom Rix , clang-built-linux@googlegroups.com, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-safety@lists.elisa.tech, Lukas Bulwahn Subject: [linux-safety] [PATCH] agp: amd64: remove unneeded initialization Date: Wed, 28 Oct 2020 14:31:06 +0100 Message-Id: <20201028133106.5420-1-lukas.bulwahn@gmail.com> Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech Delivered-To: mailing list linux-safety@lists.elisa.tech List-Post: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1603891881; bh=6jupjdxFzuN7Fii+LsUADraUeBdvxmn6V76PpyoX6OI=; h=Cc:Date:From:Subject:To; b=EI8KdjttZWYTW8y1huCr7eMUJ+IXQ/mD/7KXTKJQldwuiwPJGIPBR/uNvQ5eoJTx2Xh Aapwfr1M1DWdsxV2AobL1e+EfdEDdFuvgEXZz1fydU1lHID/qcV4ofdaUNsCJo0v3vpCD 39hP3NWwjxzZcxAHvna1qwCvQUBxSPbZiV4= make clang-analyzer on x86_64 defconfig caught my attention with: drivers/char/agp/amd64-agp.c:336:2: warning: \ Value stored to 'i' is never read [clang-analyzer-deadcode.DeadStores] i = 0; ^ Remove this unneeded initialization to make clang-analyzer happy. Commit a32073bffc65 ("x86_64: Clean and enhance up K8 northbridge access code") refactored cache_nbs() and introduced this unneeded dead-store initialization. As compilers will detect this unneeded assignment and optimize this anyway, the resulting binary is identical before and after this change. No functional change. No change in binary code. Signed-off-by: Lukas Bulwahn Reviewed-by: Tom Rix Reviewed-by: Nathan Chancellor --- applies cleanly on current master and next-20201028 David, please pick this minor non-urgent clean-up patch. drivers/char/agp/amd64-agp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index b40edae32817..0413b3136541 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c @@ -333,7 +333,6 @@ static int cache_nbs(struct pci_dev *pdev, u32 cap_ptr) if (!amd_nb_has_feature(AMD_NB_GART)) return -ENODEV; - i = 0; for (i = 0; i < amd_nb_num(); i++) { struct pci_dev *dev = node_to_amd_nb(i)->misc; if (fix_northbridge(dev, pdev, cap_ptr) < 0) {