From patchwork Fri Oct 23 20:26:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 11854515 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 79EED1580 for ; Fri, 23 Oct 2020 20:27:11 +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 DCF9420882 for ; Fri, 23 Oct 2020 20:27:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="t8h0w2fe" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCF9420882 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+120+4688437+8417402@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id pebwYY4689772xIMaadLK4XE; Fri, 23 Oct 2020 13:27:10 -0700 X-Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by mx.groups.io with SMTP id smtpd.web08.2569.1603484829654615385 for ; Fri, 23 Oct 2020 13:27:09 -0700 X-Received: by mail-wr1-f68.google.com with SMTP id h5so3635900wrv.7 for ; Fri, 23 Oct 2020 13:27:09 -0700 (PDT) X-Gm-Message-State: BHir6r1LxCVJvYkLFPbC3QH7x4688437AA= X-Google-Smtp-Source: ABdhPJyttmPUYZWfEcUUJwQQK0/KN/H49rNBfGHAbmmQcJHQPgDvFAdo8DDry+TCCMwWLQ3fjvYGig== X-Received: by 2002:adf:ef02:: with SMTP id e2mr4170705wro.381.1603484827730; Fri, 23 Oct 2020 13:27:07 -0700 (PDT) X-Received: from felia.fritz.box ([2001:16b8:2d20:a600:91f0:3b46:85c0:ebc7]) by smtp.gmail.com with ESMTPSA id j13sm5316811wru.86.2020.10.23.13.27.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Oct 2020 13:27:07 -0700 (PDT) From: "Lukas Bulwahn" To: linux-safety@lists.elisa.tech Cc: Lukas Bulwahn Subject: [linux-safety] [PATCH] agp: amd64: remove unneeded initialization Date: Fri, 23 Oct 2020 22:26:58 +0200 Message-Id: <20201023202658.11205-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=1603484830; bh=Sw7zuCibuiovadlWuzOcn7RPhfLMIfG0xmWrO6BQ49I=; h=Cc:Date:From:Subject:To; b=t8h0w2feA0OFMd7ldJDFPx6neAG9Wl+3FgVtUDYkS1aaXqyeUcSlNQQSiUoQna8OibF pi35CmXjGShZmNQs1TN4/BjQIvucrMs5MWhJOaaDJR2LS2oaLr3i+/wbZZJ+3sBUqwxsv 1B1+ghO/VpWjc1uko+dYl/B4NeojSfeu7cs= 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 --- 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) {