linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap
@ 2023-01-21 17:04 Lizhe
  2023-01-22 10:47 ` Marc Zyngier
  0 siblings, 1 reply; 3+ messages in thread
From: Lizhe @ 2023-01-21 17:04 UTC (permalink / raw)
  To: bhelgaas, tglx, darwi, jgg, maz; +Cc: linux-pci, linux-kernel, Lizhe

use devm_ioremap replace ioremap

Signed-off-by: Lizhe <sensor1010@163.com>
---
 drivers/pci/msi/msi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
index 1f716624ca56..184eca85b88b 100644
--- a/drivers/pci/msi/msi.c
+++ b/drivers/pci/msi/msi.c
@@ -566,7 +566,7 @@ static void __iomem *msix_map_region(struct pci_dev *dev,
 	table_offset &= PCI_MSIX_TABLE_OFFSET;
 	phys_addr = pci_resource_start(dev, bir) + table_offset;
 
-	return ioremap(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
+	return devm_ioremap(&dev->dev, phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
 }
 
 /**
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap
  2023-01-21 17:04 [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap Lizhe
@ 2023-01-22 10:47 ` Marc Zyngier
  2023-01-22 12:52   ` Leon Romanovsky
  0 siblings, 1 reply; 3+ messages in thread
From: Marc Zyngier @ 2023-01-22 10:47 UTC (permalink / raw)
  To: Lizhe; +Cc: bhelgaas, tglx, darwi, jgg, linux-pci, linux-kernel

On Sat, 21 Jan 2023 17:04:20 +0000,
Lizhe <sensor1010@163.com> wrote:
> 
> use devm_ioremap replace ioremap
> 
> Signed-off-by: Lizhe <sensor1010@163.com>
> ---
>  drivers/pci/msi/msi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
> index 1f716624ca56..184eca85b88b 100644
> --- a/drivers/pci/msi/msi.c
> +++ b/drivers/pci/msi/msi.c
> @@ -566,7 +566,7 @@ static void __iomem *msix_map_region(struct pci_dev *dev,
>  	table_offset &= PCI_MSIX_TABLE_OFFSET;
>  	phys_addr = pci_resource_start(dev, bir) + table_offset;
>  
> -	return ioremap(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
> +	return devm_ioremap(&dev->dev, phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
>  }

And where is the unmap dealt with? From what I can see, this will
probably explode when the device is removed...

	 M.

-- 
Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap
  2023-01-22 10:47 ` Marc Zyngier
@ 2023-01-22 12:52   ` Leon Romanovsky
  0 siblings, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2023-01-22 12:52 UTC (permalink / raw)
  To: Marc Zyngier; +Cc: Lizhe, bhelgaas, tglx, darwi, jgg, linux-pci, linux-kernel

On Sun, Jan 22, 2023 at 10:47:21AM +0000, Marc Zyngier wrote:
> On Sat, 21 Jan 2023 17:04:20 +0000,
> Lizhe <sensor1010@163.com> wrote:
> > 
> > use devm_ioremap replace ioremap
> > 
> > Signed-off-by: Lizhe <sensor1010@163.com>
> > ---
> >  drivers/pci/msi/msi.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
> > index 1f716624ca56..184eca85b88b 100644
> > --- a/drivers/pci/msi/msi.c
> > +++ b/drivers/pci/msi/msi.c
> > @@ -566,7 +566,7 @@ static void __iomem *msix_map_region(struct pci_dev *dev,
> >  	table_offset &= PCI_MSIX_TABLE_OFFSET;
> >  	phys_addr = pci_resource_start(dev, bir) + table_offset;
> >  
> > -	return ioremap(phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
> > +	return devm_ioremap(&dev->dev, phys_addr, nr_entries * PCI_MSIX_ENTRY_SIZE);
> >  }
> 
> And where is the unmap dealt with? From what I can see, this will
> probably explode when the device is removed...

Right, he/she sends many random patches like this.
https://lore.kernel.org/all/Y8Pt+IdfWBVy8nIA@unreal/

Thanks

> 
> 	 M.
> 
> -- 
> Without deviation from the norm, progress is not possible.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-01-22 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-21 17:04 [PATCH v1] drivers/msi.c : use devm_ioremap replace ioremap Lizhe
2023-01-22 10:47 ` Marc Zyngier
2023-01-22 12:52   ` Leon Romanovsky

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).