linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/10] use resource_size
@ 2020-01-01 17:49 Julia Lawall
  2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
  2020-01-01 17:49 ` [PATCH 10/10] powerpc/powernv: " Julia Lawall
  0 siblings, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2020-01-01 17:49 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: linux-fbdev, Fabio Estevam, alsa-devel, netdev, linux-usb,
	kernel-janitors, linux-kernel, dri-devel, linux-mips,
	NXP Linux Team, Pengutronix Kernel Team, linuxppc-dev,
	linux-arm-kernel

Use resource_size rather than a verbose computation on
the end and start fields.

The semantic patch that makes these changes is as follows:
(http://coccinelle.lip6.fr/)

<smpl>
@@
struct resource ptr;
@@

- ((ptr.end) - (ptr.start) + 1)
+ resource_size(&ptr)

@@
struct resource *ptr;
@@

- ((ptr->end) - (ptr->start) + 1)
+ resource_size(ptr)

@@
struct resource ptr;
@@

- ((ptr.end) + 1 - (ptr.start))
+ resource_size(&ptr)

@@
struct resource *ptr;
@@

- ((ptr->end) + 1 - (ptr->start))
+ resource_size(ptr)
</smpl>

---

 arch/mips/kernel/setup.c                  |    6 ++----
 arch/powerpc/platforms/83xx/km83xx.c      |    2 +-
 arch/powerpc/platforms/powernv/pci-ioda.c |    4 ++--
 arch/x86/kernel/crash.c                   |    2 +-
 drivers/net/ethernet/freescale/fman/mac.c |    4 ++--
 drivers/usb/gadget/udc/omap_udc.c         |    6 +++---
 drivers/video/fbdev/cg14.c                |    3 +--
 drivers/video/fbdev/s1d13xxxfb.c          |   16 ++++++++--------
 sound/drivers/ml403-ac97cr.c              |    4 +---
 sound/soc/sof/imx/imx8.c                  |    3 +--
 10 files changed, 22 insertions(+), 28 deletions(-)

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

* [PATCH 05/10] powerpc/83xx: use resource_size
  2020-01-01 17:49 [PATCH 00/10] use resource_size Julia Lawall
@ 2020-01-01 17:49 ` Julia Lawall
  2020-01-06 18:06   ` Scott Wood
  2020-01-29  5:17   ` Michael Ellerman
  2020-01-01 17:49 ` [PATCH 10/10] powerpc/powernv: " Julia Lawall
  1 sibling, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2020-01-01 17:49 UTC (permalink / raw)
  To: Scott Wood; +Cc: kernel-janitors, linux-kernel, Paul Mackerras, linuxppc-dev

Use resource_size rather than a verbose computation on
the end and start fields.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

<smpl>
@@ struct resource ptr; @@
- (ptr.end - ptr.start + 1)
+ resource_size(&ptr)
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 arch/powerpc/platforms/83xx/km83xx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/83xx/km83xx.c b/arch/powerpc/platforms/83xx/km83xx.c
index 3d89569e9e71..ada42f03915a 100644
--- a/arch/powerpc/platforms/83xx/km83xx.c
+++ b/arch/powerpc/platforms/83xx/km83xx.c
@@ -63,7 +63,7 @@ static void quirk_mpc8360e_qe_enet10(void)
 		return;
 	}
 
-	base = ioremap(res.start, res.end - res.start + 1);
+	base = ioremap(res.start, resource_size(&res));
 
 	/*
 	 * set output delay adjustments to default values according


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

* [PATCH 10/10] powerpc/powernv: use resource_size
  2020-01-01 17:49 [PATCH 00/10] use resource_size Julia Lawall
  2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
@ 2020-01-01 17:49 ` Julia Lawall
  2020-01-29  5:17   ` Michael Ellerman
  1 sibling, 1 reply; 6+ messages in thread
From: Julia Lawall @ 2020-01-01 17:49 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Paul Mackerras, kernel-janitors, linuxppc-dev, linux-kernel

Use resource_size rather than a verbose computation on
the end and start fields.

The semantic patch that makes these changes is as follows:
(http://coccinelle.lip6.fr/)

<smpl>
@@ struct resource ptr; @@
- (ptr.end - ptr.start + 1)
+ resource_size(&ptr)
</smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

---
 arch/powerpc/platforms/powernv/pci-ioda.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index da1068a9c263..364140145ce0 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -792,7 +792,7 @@ static int pnv_ioda_deconfigure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
 		fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
 		parent = pe->pbus->self;
 		if (pe->flags & PNV_IODA_PE_BUS_ALL)
-			count = pe->pbus->busn_res.end - pe->pbus->busn_res.start + 1;
+			count = resource_size(&pe->pbus->busn_res);
 		else
 			count = 1;
 
@@ -874,7 +874,7 @@ static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
 		fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
 		parent = pe->pbus->self;
 		if (pe->flags & PNV_IODA_PE_BUS_ALL)
-			count = pe->pbus->busn_res.end - pe->pbus->busn_res.start + 1;
+			count = resource_size(&pe->pbus->busn_res);
 		else
 			count = 1;
 


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

* Re: [PATCH 05/10] powerpc/83xx: use resource_size
  2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
@ 2020-01-06 18:06   ` Scott Wood
  2020-01-29  5:17   ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Scott Wood @ 2020-01-06 18:06 UTC (permalink / raw)
  To: Julia Lawall; +Cc: kernel-janitors, linux-kernel, Paul Mackerras, linuxppc-dev

On Wed, 2020-01-01 at 18:49 +0100, Julia Lawall wrote:
> Use resource_size rather than a verbose computation on
> the end and start fields.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> <smpl>
> @@ struct resource ptr; @@
> - (ptr.end - ptr.start + 1)
> + resource_size(&ptr)
> </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>
> 
> ---
>  arch/powerpc/platforms/83xx/km83xx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Scott Wood <oss@buserror.net>

-Scott



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

* Re: [PATCH 05/10] powerpc/83xx: use resource_size
  2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
  2020-01-06 18:06   ` Scott Wood
@ 2020-01-29  5:17   ` Michael Ellerman
  1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-01-29  5:17 UTC (permalink / raw)
  To: Julia Lawall, Scott Wood
  Cc: Paul Mackerras, linuxppc-dev, kernel-janitors, linux-kernel

On Wed, 2020-01-01 at 17:49:45 UTC, Julia Lawall wrote:
> Use resource_size rather than a verbose computation on
> the end and start fields.
> 
> The semantic patch that makes this change is as follows:
> (http://coccinelle.lip6.fr/)
> 
> <smpl>
> @@ struct resource ptr; @@
> - (ptr.end - ptr.start + 1)
> + resource_size(&ptr)
> </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/bfbe37f0ce994e7a9945653d7624fadc5c500a9f

cheers

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

* Re: [PATCH 10/10] powerpc/powernv: use resource_size
  2020-01-01 17:49 ` [PATCH 10/10] powerpc/powernv: " Julia Lawall
@ 2020-01-29  5:17   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-01-29  5:17 UTC (permalink / raw)
  To: Julia Lawall, Benjamin Herrenschmidt
  Cc: kernel-janitors, Paul Mackerras, linuxppc-dev, linux-kernel

On Wed, 2020-01-01 at 17:49:50 UTC, Julia Lawall wrote:
> Use resource_size rather than a verbose computation on
> the end and start fields.
> 
> The semantic patch that makes these changes is as follows:
> (http://coccinelle.lip6.fr/)
> 
> <smpl>
> @@ struct resource ptr; @@
> - (ptr.end - ptr.start + 1)
> + resource_size(&ptr)
> </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@inria.fr>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/552aa086944a9aeabd599892007c2c7faedb894e

cheers

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

end of thread, other threads:[~2020-01-29  5:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-01 17:49 [PATCH 00/10] use resource_size Julia Lawall
2020-01-01 17:49 ` [PATCH 05/10] powerpc/83xx: " Julia Lawall
2020-01-06 18:06   ` Scott Wood
2020-01-29  5:17   ` Michael Ellerman
2020-01-01 17:49 ` [PATCH 10/10] powerpc/powernv: " Julia Lawall
2020-01-29  5:17   ` Michael Ellerman

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