Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp452593rwr; Thu, 20 Apr 2023 01:34:19 -0700 (PDT) X-Google-Smtp-Source: AKy350bMB+neF0sZ179ZH89MjF/ngijXpgm6/VzL8xSG3j4Uyy5jPoU4/Ewglcyr/h8t+pt/rhtj X-Received: by 2002:a05:6a20:8f27:b0:f0:718f:8eeb with SMTP id b39-20020a056a208f2700b000f0718f8eebmr1184605pzk.60.1681979659657; Thu, 20 Apr 2023 01:34:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681979659; cv=none; d=google.com; s=arc-20160816; b=0hoJmLgk7nk5E06CkDTsZWETNbJGP7lXTXgcIMQJU5IDNFIEWJZTZ6bmQgRgAvk6/C EwjPhKcRI26csQIHbGbp07z7xD+QoiE/a3W3DII68TY2l3wHGLHs1LvCr7Y/ycP+EHqO jgONE1wPmvM96naa6EEfWLnLSaOUPlwn/XxJRU0iuKhDwu+Wvre+GsnAJ/Msp9N2lSMG QG6INg3vDCfor1fIBsTb1WnjAJmlp87XUVYksiWS+jNp7AGurJf3edQUloKewXyMY4ZF Wt/qk1ShzijWX7WDu4W+/AupSr8GX+pYE6nzlSJfHMK6YFiXtqOJmU3YA7w+C1jGMPx1 uIfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=50mbGfxRR1oqDuw7VMe16Z0DZDQCiyfOfyW3zvtMxTY=; b=ijQNmDCOIcg+DvO/d4nbLUjLjNduL1f5ymiH5+1MHqJ9EfGRrpvh+YV+oWhZS5KuZT IhAipySXWUvMDF1+RUrDdVFdThIBpCdHodQOaJtDd8z+B5zgzEFyopC5JuMH69Hy2xP5 LX8dFp9clBnGrVW/2H3rTvOmwEAhLSuYjIshvV495mwHb9x5Wv6ovn41rCSClFQX6QKG YmLwWbPqyCjRrNu7L6IgnlSlKgDp8M7mIbGYcC+Vb9GYS8H0J+ZubY5dE9WI0cUwnEfQ cFBh1qM29Loc+Ip/q4mNwWrVfTGeCMEhTlNBfwUzZUcETqj+HHpNzu7Az019ki+vPkuC aawQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rbm+N3Rn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t14-20020aa7946e000000b0063b895e9781si1156129pfq.138.2023.04.20.01.34.07; Thu, 20 Apr 2023 01:34:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Rbm+N3Rn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234424AbjDTIXg (ORCPT + 99 others); Thu, 20 Apr 2023 04:23:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234440AbjDTIXZ (ORCPT ); Thu, 20 Apr 2023 04:23:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 984BD4C3A; Thu, 20 Apr 2023 01:23:06 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E442C61435; Thu, 20 Apr 2023 08:23:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9D19C433EF; Thu, 20 Apr 2023 08:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681978985; bh=Ab68JqQLfY+jSqDEDD3C5HmCaqo0RsufHI6L372P1gM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=Rbm+N3RnJJevpEOSi49wnJA0CEF/1wW9Z9RjYvx5Do52m/c7wazbxQFIif7SoKsii qmeP65bmlV0cgvftyZaFCszAkwoVtUVXKNeANuJuJKjsbowN9sx7tovJnRpE8t1o7P vjHswVMRsSxvOkDXysDMjbievi9eCSLK8XLptOwvMk2BdHyO3KMahhDUS+7zGxIhTx YvmYXMWM/WBuXVapHG4C1D19lyhskkBIUG5N+hPZhWnfzzL4ckBBHCW2QGT++2HLtQ KqdKh/j28c+DMIiHBsd7ZLvbCu/Ly/z8TT6Le+2DxhIqkX9QDD1msyIRBuEkfy/ADp TZQ1uYkAWdDaA== Message-ID: <3b711d73-ac46-7a37-e835-f9dadeb96dd3@kernel.org> Date: Thu, 20 Apr 2023 17:23:02 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] PCI: vmd: Fix two issues reported by Smatch Content-Language: en-US To: korantwork@gmail.com, helgaas@kernel.org, nirmal.patel@linux.intel.com, kbusch@kernel.org, jonathan.derrick@linux.dev, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Xinghui Li , Dan Carpenter References: <20230420081957.1440423-1-korantwork@gmail.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20230420081957.1440423-1-korantwork@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org On 4/20/23 17:19, korantwork@gmail.com wrote: > From: Xinghui Li > > There is one uninitialized symbol error reported by smatch: > "drivers/pci/controller/vmd.c:931 vmd_enable_domain() > error: uninitialized symbol 'ret'." > > Fix it by assigning ret with pci_reset_bus return. This is a bug so clearly needs a fixes tag. > > And one inconsistent indenting warning: > "drivers/pci/controller/vmd.c:1058 vmd_resume() > warn: inconsistent indenting" > > Fix it by formating its indenting. But this is cosmetic and does not need backporting/fixes tag in my opinion. So better split this into 2 different patches. > > Fixes: 0a584655ef89 ("PCI: vmd: Fix secondary bus reset for Intel bridges") > Fixes: d899aa668498 ("PCI: vmd: Disable MSI remapping after suspend") > Reported-by: Dan Carpenter > Signed-off-by: Xinghui Li > --- > drivers/pci/controller/vmd.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c > index 7e1fd959e00d..0a7c1fdfeec0 100644 > --- a/drivers/pci/controller/vmd.c > +++ b/drivers/pci/controller/vmd.c > @@ -943,7 +943,8 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features) > if (!list_empty(&child->devices)) { > dev = list_first_entry(&child->devices, > struct pci_dev, bus_list); > - if (pci_reset_bus(dev)) > + ret = pci_reset_bus(dev); > + if (ret) > pci_warn(dev, "can't reset device: %d\n", ret); > > break; > @@ -1084,10 +1085,10 @@ static int vmd_resume(struct device *dev) > struct vmd_dev *vmd = pci_get_drvdata(pdev); > int err, i; > > - if (vmd->irq_domain) > - vmd_set_msi_remapping(vmd, true); > - else > - vmd_set_msi_remapping(vmd, false); > + if (vmd->irq_domain) > + vmd_set_msi_remapping(vmd, true); > + else > + vmd_set_msi_remapping(vmd, false); > > for (i = 0; i < vmd->msix_count; i++) { > err = devm_request_irq(dev, vmd->irqs[i].virq,