mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 08/27] PCI: replace devm_ioremap_nocache with devm_ioremap
@ 2017-12-23 10:58 Yisheng Xie
  2017-12-23 12:23 ` Fabio Estevam
  0 siblings, 1 reply; 3+ messages in thread
From: Yisheng Xie @ 2017-12-23 10:58 UTC (permalink / raw)
  To: linux-kernel, gregkh; +Cc: ysxie, Yisheng Xie, Bjorn Helgaas, linux-pci

Default ioremap is ioremap_nocache, so devm_ioremap has the same
function with devm_ioremap_nocache, which can just be killed to
save the size of devres.o

This patch is to use use devm_ioremap instead of devm_ioremap_nocache,
which should not have any function change but prepare for killing
devm_ioremap_nocache.

Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
 drivers/pci/dwc/pci-dra7xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
index e77a4cee..3f3712a 100644
--- a/drivers/pci/dwc/pci-dra7xx.c
+++ b/drivers/pci/dwc/pci-dra7xx.c
@@ -637,7 +637,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ti_conf");
-	base = devm_ioremap_nocache(dev, res->start, resource_size(res));
+	base = devm_ioremap(dev, res->start, resource_size(res));
 	if (!base)
 		return -ENOMEM;
 
-- 
1.8.3.1

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

* Re: [PATCH v3 08/27] PCI: replace devm_ioremap_nocache with devm_ioremap
  2017-12-23 10:58 [PATCH v3 08/27] PCI: replace devm_ioremap_nocache with devm_ioremap Yisheng Xie
@ 2017-12-23 12:23 ` Fabio Estevam
  2017-12-25  1:38   ` Yisheng Xie
  0 siblings, 1 reply; 3+ messages in thread
From: Fabio Estevam @ 2017-12-23 12:23 UTC (permalink / raw)
  To: Yisheng Xie
  Cc: linux-kernel, Greg Kroah-Hartman, ysxie, Bjorn Helgaas, linux-pci

On Sat, Dec 23, 2017 at 8:58 AM, Yisheng Xie <xieyisheng1@huawei.com> wrote:
> Default ioremap is ioremap_nocache, so devm_ioremap has the same
> function with devm_ioremap_nocache, which can just be killed to
> save the size of devres.o
>
> This patch is to use use devm_ioremap instead of devm_ioremap_nocache,
> which should not have any function change but prepare for killing
> devm_ioremap_nocache.
>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: linux-pci@vger.kernel.org
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
> ---
>  drivers/pci/dwc/pci-dra7xx.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
> index e77a4cee..3f3712a 100644
> --- a/drivers/pci/dwc/pci-dra7xx.c
> +++ b/drivers/pci/dwc/pci-dra7xx.c
> @@ -637,7 +637,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
>         }
>
>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ti_conf");
> -       base = devm_ioremap_nocache(dev, res->start, resource_size(res));
> +       base = devm_ioremap(dev, res->start, resource_size(res));

You could also consider using devm_ioremap_resource(), which checks
whether the resource is NULL and it is a bit shorter:

base = devm_ioremap_resource(dev, res);
if (IS_ERR(base))
   return PTR_ERR(base);


>
> --
> 1.8.3.1
>

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

* Re: [PATCH v3 08/27] PCI: replace devm_ioremap_nocache with devm_ioremap
  2017-12-23 12:23 ` Fabio Estevam
@ 2017-12-25  1:38   ` Yisheng Xie
  0 siblings, 0 replies; 3+ messages in thread
From: Yisheng Xie @ 2017-12-25  1:38 UTC (permalink / raw)
  To: Fabio Estevam
  Cc: linux-kernel, Greg Kroah-Hartman, ysxie, Bjorn Helgaas, linux-pci

Hi Fabio,

Thanks for you reviewing and comment!

On 2017/12/23 20:23, Fabio Estevam wrote:
> On Sat, Dec 23, 2017 at 8:58 AM, Yisheng Xie <xieyisheng1@huawei.com> wrote:
>> Default ioremap is ioremap_nocache, so devm_ioremap has the same
>> function with devm_ioremap_nocache, which can just be killed to
>> save the size of devres.o
>>
>> This patch is to use use devm_ioremap instead of devm_ioremap_nocache,
>> which should not have any function change but prepare for killing
>> devm_ioremap_nocache.
>>
>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>> Cc: linux-pci@vger.kernel.org
>> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
>> ---
>>  drivers/pci/dwc/pci-dra7xx.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/dwc/pci-dra7xx.c b/drivers/pci/dwc/pci-dra7xx.c
>> index e77a4cee..3f3712a 100644
>> --- a/drivers/pci/dwc/pci-dra7xx.c
>> +++ b/drivers/pci/dwc/pci-dra7xx.c
>> @@ -637,7 +637,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
>>         }
>>
>>         res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ti_conf");
>> -       base = devm_ioremap_nocache(dev, res->start, resource_size(res));
>> +       base = devm_ioremap(dev, res->start, resource_size(res));
> 
> You could also consider using devm_ioremap_resource(), which checks
> whether the resource is NULL and it is a bit shorter:
> 
> base = devm_ioremap_resource(dev, res);
> if (IS_ERR(base))
>    return PTR_ERR(base);

Yeah, I will check if all the archs have the same ioremap and ioremap_noache, first.
If it is so, I will take your suggestion.

Thanks
Yisheng

> 
> 
>>
>> --
>> 1.8.3.1
>>
> 
> .
> 

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

end of thread, other threads:[~2017-12-25  1:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-23 10:58 [PATCH v3 08/27] PCI: replace devm_ioremap_nocache with devm_ioremap Yisheng Xie
2017-12-23 12:23 ` Fabio Estevam
2017-12-25  1:38   ` Yisheng Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®