* [PATCH] tools: PCI: Zero-initialize param
@ 2021-06-27 0:39 Shunyong Yang
2021-07-11 1:48 ` Shunyong Yang
0 siblings, 1 reply; 4+ messages in thread
From: Shunyong Yang @ 2021-06-27 0:39 UTC (permalink / raw)
To: kishon, lorenzo.pieralisi, kw
Cc: bhelgaas, linux-pci, linux-kernel, Shunyong Yang
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};
int ret = -EINVAL;
int fd;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tools: PCI: Zero-initialize param
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
0 siblings, 1 reply; 4+ messages in thread
From: Shunyong Yang @ 2021-07-11 1:48 UTC (permalink / raw)
To: bhelgaas, kishon, lorenzo.pieralisi, kw; +Cc: linux-pci, linux-kernel
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};
> int ret = -EINVAL;
> int fd;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools: PCI: Zero-initialize param
2021-07-11 1:48 ` Shunyong Yang
@ 2021-07-11 11:56 ` Leon Romanovsky
2021-07-13 13:24 ` Shunyong Yang
0 siblings, 1 reply; 4+ messages in thread
From: Leon Romanovsky @ 2021-07-11 11:56 UTC (permalink / raw)
To: Shunyong Yang
Cc: bhelgaas, kishon, lorenzo.pieralisi, kw, linux-pci, linux-kernel
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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tools: PCI: Zero-initialize param
2021-07-11 11:56 ` Leon Romanovsky
@ 2021-07-13 13:24 ` Shunyong Yang
0 siblings, 0 replies; 4+ messages in thread
From: Shunyong Yang @ 2021-07-13 13:24 UTC (permalink / raw)
To: Leon Romanovsky
Cc: bhelgaas, kishon, lorenzo.pieralisi, kw, linux-pci, linux-kernel
Hi, Romanovsky,
On 2021/7/11 19:56, Leon Romanovsky wrote:
> 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
Will change as you said.
Thanks.
Shunyong.
>>> int ret = -EINVAL;
>>> int fd;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-07-13 13:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2021-07-13 13:24 ` Shunyong Yang
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).