From: Chunhe Lan <b25806@freescale.com>
To: <jbarnes@virtuousgeek.org>
Cc: <linux-pci@vger.kernel.org>
Subject: Re: [PATCH] PCI: PCIe: Fix uninitialized variable 'cap_mask'
Date: Mon, 9 Apr 2012 11:08:48 +0800 [thread overview]
Message-ID: <4F8252C0.9060002@freescale.com> (raw)
In-Reply-To: <1331104586-5720-1-git-send-email-Chunhe.Lan@freescale.com>
Chunhe Lan wrote:
> Get rid of these:
>
> drivers/pci/pcie/portdrv_core.c: In function 'pcie_port_device_register':
> drivers/pci/pcie/portdrv_core.c:275:16: warning: 'cap_mask' may be used
> uninitialized in this function [-Wuninitialized]
> drivers/pci/pcie/portdrv_core.c:240:6: note: 'cap_mask' was declared here
>
> In some cases, 'cap_mask' may be not set in pcie_port_platform_notify,
> holding a garbage value.
>
> Signed-off-by: Chunhe Lan <Chunhe.Lan@freescale.com>
> ---
> drivers/pci/pcie/portdrv_core.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/pci/pcie/portdrv_core.c b/drivers/pci/pcie/portdrv_core.c
> index 595654a..751b464 100644
> --- a/drivers/pci/pcie/portdrv_core.c
> +++ b/drivers/pci/pcie/portdrv_core.c
> @@ -237,7 +237,7 @@ static int get_port_device_capability(struct pci_dev *dev)
> int services = 0, pos;
> u16 reg16;
> u32 reg32;
> - int cap_mask;
> + int cap_mask = 0;
> int err;
>
> if (pcie_ports_disabled)
>
Hello Jesse Barnes,
Have you any comment about this patch?
It locates at http://article.gmane.org/gmane.linux.kernel.pci/14062
If it has not question, can you merge it to your git tree?
Thanks.
-Lan
next prev parent reply other threads:[~2012-04-09 3:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 7:16 [PATCH] PCI: PCIe: Fix uninitialized variable 'cap_mask' Chunhe Lan
2012-04-09 3:08 ` Chunhe Lan [this message]
2012-04-09 15:16 ` Jesse Barnes
[not found] ` <4F83D109.4000702@freescale.com>
2012-04-11 0:30 ` Bjorn Helgaas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F8252C0.9060002@freescale.com \
--to=b25806@freescale.com \
--cc=jbarnes@virtuousgeek.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.