* [PATCH] staging: mt7621-pci: fix a multiple assignment code style issue
@ 2021-04-27 17:47 Iain Craig
2021-04-27 17:55 ` Sergio Paracuellos
0 siblings, 1 reply; 3+ messages in thread
From: Iain Craig @ 2021-04-27 17:47 UTC (permalink / raw)
To: Greg Kroah-Hartman, Matthias Brugger, linux-staging, linux-kernel
avoid multiple assignments while setting pcie->io members to NULL.
Signed-off-by: Iain Craig <coldcity@gmail.com>
---
drivers/staging/mt7621-pci/pci-mt7621.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
index 115250115f10..f3b5b8ac03b5 100644
--- a/drivers/staging/mt7621-pci/pci-mt7621.c
+++ b/drivers/staging/mt7621-pci/pci-mt7621.c
@@ -306,7 +306,9 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct pci_host_bridge *host)
* resource manually instead.
*/
pcie->io.name = node->full_name;
- pcie->io.parent = pcie->io.child = pcie->io.sibling = NULL;
+ pcie->io.parent = NULL;
+ pcie->io.child = NULL;
+ pcie->io.sibling = NULL;
for_each_of_pci_range(&parser, &range) {
switch (range.flags & IORESOURCE_TYPE_BITS) {
case IORESOURCE_IO:
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: mt7621-pci: fix a multiple assignment code style issue
2021-04-27 17:47 [PATCH] staging: mt7621-pci: fix a multiple assignment code style issue Iain Craig
@ 2021-04-27 17:55 ` Sergio Paracuellos
2021-04-27 18:09 ` Greg Kroah-Hartman
0 siblings, 1 reply; 3+ messages in thread
From: Sergio Paracuellos @ 2021-04-27 17:55 UTC (permalink / raw)
To: Iain Craig
Cc: Greg Kroah-Hartman, Matthias Brugger, linux-staging, linux-kernel
Hi Iain.
On Tue, Apr 27, 2021 at 7:47 PM Iain Craig <coldcity@gmail.com> wrote:
>
> avoid multiple assignments while setting pcie->io members to NULL.
>
> Signed-off-by: Iain Craig <coldcity@gmail.com>
> ---
> drivers/staging/mt7621-pci/pci-mt7621.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
> index 115250115f10..f3b5b8ac03b5 100644
> --- a/drivers/staging/mt7621-pci/pci-mt7621.c
> +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
> @@ -306,7 +306,9 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct pci_host_bridge *host)
> * resource manually instead.
> */
> pcie->io.name = node->full_name;
> - pcie->io.parent = pcie->io.child = pcie->io.sibling = NULL;
> + pcie->io.parent = NULL;
> + pcie->io.child = NULL;
> + pcie->io.sibling = NULL;
In this particular case I think the original code is correct as it is.
Also this is the style used around different kernel places to assign
these fields.
> for_each_of_pci_range(&parser, &range) {
> switch (range.flags & IORESOURCE_TYPE_BITS) {
> case IORESOURCE_IO:
> --
> 2.25.1
>
Best regards,
Sergio Paracuellos
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] staging: mt7621-pci: fix a multiple assignment code style issue
2021-04-27 17:55 ` Sergio Paracuellos
@ 2021-04-27 18:09 ` Greg Kroah-Hartman
0 siblings, 0 replies; 3+ messages in thread
From: Greg Kroah-Hartman @ 2021-04-27 18:09 UTC (permalink / raw)
To: Sergio Paracuellos
Cc: Iain Craig, Matthias Brugger, linux-staging, linux-kernel
On Tue, Apr 27, 2021 at 07:55:30PM +0200, Sergio Paracuellos wrote:
> Hi Iain.
>
> On Tue, Apr 27, 2021 at 7:47 PM Iain Craig <coldcity@gmail.com> wrote:
> >
> > avoid multiple assignments while setting pcie->io members to NULL.
> >
> > Signed-off-by: Iain Craig <coldcity@gmail.com>
> > ---
> > drivers/staging/mt7621-pci/pci-mt7621.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/mt7621-pci/pci-mt7621.c b/drivers/staging/mt7621-pci/pci-mt7621.c
> > index 115250115f10..f3b5b8ac03b5 100644
> > --- a/drivers/staging/mt7621-pci/pci-mt7621.c
> > +++ b/drivers/staging/mt7621-pci/pci-mt7621.c
> > @@ -306,7 +306,9 @@ static int mt7621_pci_parse_request_of_pci_ranges(struct pci_host_bridge *host)
> > * resource manually instead.
> > */
> > pcie->io.name = node->full_name;
> > - pcie->io.parent = pcie->io.child = pcie->io.sibling = NULL;
> > + pcie->io.parent = NULL;
> > + pcie->io.child = NULL;
> > + pcie->io.sibling = NULL;
>
> In this particular case I think the original code is correct as it is.
> Also this is the style used around different kernel places to assign
> these fields.
THe original is fine.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-27 18:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-27 17:47 [PATCH] staging: mt7621-pci: fix a multiple assignment code style issue Iain Craig
2021-04-27 17:55 ` Sergio Paracuellos
2021-04-27 18:09 ` Greg Kroah-Hartman
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).