linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Shunyong Yang <yang.shunyong@gmail.com>
Cc: bhelgaas@google.com, kishon@ti.com, lorenzo.pieralisi@arm.com,
	kw@linux.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools: PCI: Zero-initialize param
Date: Sun, 11 Jul 2021 14:56:01 +0300	[thread overview]
Message-ID: <YOrcUcx2PdaBxRQi@unreal> (raw)
In-Reply-To: <d4c250af-aa50-0ec0-c66a-104092646e15@gmail.com>

On Sun, Jul 11, 2021 at 09:48:17AM +0800, Shunyong Yang wrote:
> Hi, Bjorn and Kishon,
> 
>   Gentle ping. Would you please help to review and merge this tiny change?
> 
> Thansk.
> 
> Shunyong.
> 
> On 2021/6/27 8:39, Shunyong Yang wrote:
> > The values in param may be random if they are not initialized, which
> > may cause use_dma flag set even when "-d" option is not provided
> > in command line. Initializing all members to 0 to solve this.
> > 
> > Signed-off-by: Shunyong Yang <yang.shunyong@gmail.com>
> > ---
> >   tools/pci/pcitest.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c
> > index 0a1344c45213..59bcd6220a58 100644
> > --- a/tools/pci/pcitest.c
> > +++ b/tools/pci/pcitest.c
> > @@ -40,7 +40,7 @@ struct pci_test {
> >   static int run_test(struct pci_test *test)
> >   {
> > -	struct pci_endpoint_test_xfer_param param;
> > +	struct pci_endpoint_test_xfer_param param = {0};

You can simply write {} instead of {0} - zero is not needed.

Thanks

> >   	int ret = -EINVAL;
> >   	int fd;

  reply	other threads:[~2021-07-11 11:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27  0:39 [PATCH] tools: PCI: Zero-initialize param Shunyong Yang
2021-07-11  1:48 ` Shunyong Yang
2021-07-11 11:56   ` Leon Romanovsky [this message]
2021-07-13 13:24     ` Shunyong Yang

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=YOrcUcx2PdaBxRQi@unreal \
    --to=leon@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kishon@ti.com \
    --cc=kw@linux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=yang.shunyong@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).