All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09  7:43 ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09  7:43 UTC (permalink / raw)
  To: Karsten Keil, isdn4linux, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

request_region should be used with release_region, not request_mem_region.

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

// <smpl>
@r1@
expression start;
@@

request_region(start,...)

@b1@
expression r1.start;
@@

request_mem_region(start,...)

@depends on !b1@
expression r1.start;
expression E;
@@

- release_mem_region
+ release_region
  (start,E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/isdn/hisax/isurf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
 {
 	release_region(cs->hw.isurf.reset, 1);
 	iounmap(cs->hw.isurf.isar);
-	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
+	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
 }
 
 static void

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

* [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09  7:43 ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09  7:43 UTC (permalink / raw)
  To: Karsten Keil, isdn4linux, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

request_region should be used with release_region, not request_mem_region.

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

// <smpl>
@r1@
expression start;
@@

request_region(start,...)

@b1@
expression r1.start;
@@

request_mem_region(start,...)

@depends on !b1@
expression r1.start;
expression E;
@@

- release_mem_region
+ release_region
  (start,E)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/isdn/hisax/isurf.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
 {
 	release_region(cs->hw.isurf.reset, 1);
 	iounmap(cs->hw.isurf.isar);
-	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
+	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
 }
 
 static void

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of
  2009-08-09  7:43 ` Julia Lawall
@ 2009-08-09  9:51   ` Julia Lawall
  -1 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09  9:51 UTC (permalink / raw)
  To: Karsten Keil, isdn4linux, linux-kernel, kernel-janitors

Or perhaps it is the request_region that is incorrect, since the same 
value is later used with ioremap?

julia


On Sun, 9 Aug 2009, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
> 
> request_region should be used with release_region, not request_mem_region.
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r1@
> expression start;
> @@
> 
> request_region(start,...)
> 
> @b1@
> expression r1.start;
> @@
> 
> request_mem_region(start,...)
> 
> @depends on !b1@
> expression r1.start;
> expression E;
> @@
> 
> - release_mem_region
> + release_region
>   (start,E)
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>
> 
> ---
>  drivers/isdn/hisax/isurf.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
> --- a/drivers/isdn/hisax/isurf.c
> +++ b/drivers/isdn/hisax/isurf.c
> @@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
>  {
>  	release_region(cs->hw.isurf.reset, 1);
>  	iounmap(cs->hw.isurf.isar);
> -	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> +	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
>  }
>  
>  static void
> 

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09  9:51   ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09  9:51 UTC (permalink / raw)
  To: Karsten Keil, isdn4linux, linux-kernel, kernel-janitors

Or perhaps it is the request_region that is incorrect, since the same 
value is later used with ioremap?

julia


On Sun, 9 Aug 2009, Julia Lawall wrote:

> From: Julia Lawall <julia@diku.dk>
> 
> request_region should be used with release_region, not request_mem_region.
> 
> The semantic patch that fixes this problem is as follows:
> (http://coccinelle.lip6.fr/)
> 
> // <smpl>
> @r1@
> expression start;
> @@
> 
> request_region(start,...)
> 
> @b1@
> expression r1.start;
> @@
> 
> request_mem_region(start,...)
> 
> @depends on !b1@
> expression r1.start;
> expression E;
> @@
> 
> - release_mem_region
> + release_region
>   (start,E)
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@diku.dk>
> 
> ---
>  drivers/isdn/hisax/isurf.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
> --- a/drivers/isdn/hisax/isurf.c
> +++ b/drivers/isdn/hisax/isurf.c
> @@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
>  {
>  	release_region(cs->hw.isurf.reset, 1);
>  	iounmap(cs->hw.isurf.isar);
> -	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> +	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
>  }
>  
>  static void
> 

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
  2009-08-09  9:51   ` [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region Julia Lawall
@ 2009-08-09 12:20     ` Karsten Keil
  -1 siblings, 0 replies; 10+ messages in thread
From: Karsten Keil @ 2009-08-09 12:20 UTC (permalink / raw)
  To: Julia Lawall, isdn4linux, linux-kernel, kernel-janitors

On Sonntag, 9. August 2009 11:51:14 you wrote:
> Or perhaps it is the request_region that is incorrect, since the same
> value is later used with ioremap?

Yes this is the real error, these cards have one IO port (hw.isurf.reset) and 
one memory mapped IO area (
hw.isurf.phymem).


>
> julia
>
> On Sun, 9 Aug 2009, Julia Lawall wrote:
> > From: Julia Lawall <julia@diku.dk>
> >
> > request_region should be used with release_region, not
> > request_mem_region.
> >
> > The semantic patch that fixes this problem is as follows:
> > (http://coccinelle.lip6.fr/)
> >
> > // <smpl>
> > @r1@
> > expression start;
> > @@
> >
> > request_region(start,...)
> >
> > @b1@
> > expression r1.start;
> > @@
> >
> > request_mem_region(start,...)
> >
> > @depends on !b1@
> > expression r1.start;
> > expression E;
> > @@
> >
> > - release_mem_region
> > + release_region
> >   (start,E)
> > // </smpl>
> >
> > Signed-off-by: Julia Lawall <julia@diku.dk>
> >
> > ---
> >  drivers/isdn/hisax/isurf.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
> > --- a/drivers/isdn/hisax/isurf.c
> > +++ b/drivers/isdn/hisax/isurf.c
> > @@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
> >  {
> >  	release_region(cs->hw.isurf.reset, 1);
> >  	iounmap(cs->hw.isurf.isar);
> > -	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> > +	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> >  }
> >
> >  static void


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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09 12:20     ` Karsten Keil
  0 siblings, 0 replies; 10+ messages in thread
From: Karsten Keil @ 2009-08-09 12:20 UTC (permalink / raw)
  To: Julia Lawall, isdn4linux, linux-kernel, kernel-janitors

On Sonntag, 9. August 2009 11:51:14 you wrote:
> Or perhaps it is the request_region that is incorrect, since the same
> value is later used with ioremap?

Yes this is the real error, these cards have one IO port (hw.isurf.reset) and 
one memory mapped IO area (
hw.isurf.phymem).


>
> julia
>
> On Sun, 9 Aug 2009, Julia Lawall wrote:
> > From: Julia Lawall <julia@diku.dk>
> >
> > request_region should be used with release_region, not
> > request_mem_region.
> >
> > The semantic patch that fixes this problem is as follows:
> > (http://coccinelle.lip6.fr/)
> >
> > // <smpl>
> > @r1@
> > expression start;
> > @@
> >
> > request_region(start,...)
> >
> > @b1@
> > expression r1.start;
> > @@
> >
> > request_mem_region(start,...)
> >
> > @depends on !b1@
> > expression r1.start;
> > expression E;
> > @@
> >
> > - release_mem_region
> > + release_region
> >   (start,E)
> > // </smpl>
> >
> > Signed-off-by: Julia Lawall <julia@diku.dk>
> >
> > ---
> >  drivers/isdn/hisax/isurf.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff -u -p a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
> > --- a/drivers/isdn/hisax/isurf.c
> > +++ b/drivers/isdn/hisax/isurf.c
> > @@ -125,7 +125,7 @@ release_io_isurf(struct IsdnCardState *c
> >  {
> >  	release_region(cs->hw.isurf.reset, 1);
> >  	iounmap(cs->hw.isurf.isar);
> > -	release_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> > +	release_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE);
> >  }
> >
> >  static void


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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of
  2009-08-09 12:20     ` Karsten Keil
@ 2009-08-09 12:28       ` Julia Lawall
  -1 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09 12:28 UTC (permalink / raw)
  To: Karsten Keil; +Cc: isdn4linux, linux-kernel, kernel-janitors

On Sun, 9 Aug 2009, Karsten Keil wrote:

> On Sonntag, 9. August 2009 11:51:14 you wrote:
> > Or perhaps it is the request_region that is incorrect, since the same
> > value is later used with ioremap?
> 
> Yes this is the real error, these cards have one IO port (hw.isurf.reset) and 
> one memory mapped IO area (
> hw.isurf.phymem).

OK, I will send a corrected patch shortly.

julia

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09 12:28       ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09 12:28 UTC (permalink / raw)
  To: Karsten Keil; +Cc: isdn4linux, linux-kernel, kernel-janitors

On Sun, 9 Aug 2009, Karsten Keil wrote:

> On Sonntag, 9. August 2009 11:51:14 you wrote:
> > Or perhaps it is the request_region that is incorrect, since the same
> > value is later used with ioremap?
> 
> Yes this is the real error, these cards have one IO port (hw.isurf.reset) and 
> one memory mapped IO area (
> hw.isurf.phymem).

OK, I will send a corrected patch shortly.

julia

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of
  2009-08-09 12:20     ` Karsten Keil
@ 2009-08-09 12:44       ` Julia Lawall
  -1 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09 12:44 UTC (permalink / raw)
  To: Karsten Keil; +Cc: isdn4linux, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

request_mem_region should be used when ioremap is used subsequently.
In this case, release_mem_region was already used where needed.

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

// <smpl>
@@
expression start,E;
@@

- request_region
+ request_mem_region
    (start,...)
  ... when != request_mem_region(start,...)
      when != start = E
  ioremap(start,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/isdn/hisax/isurf.c          |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index ca41617..e1c3434 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -259,7 +259,8 @@ setup_isurf(struct IsdnCard *card)
 			cs->hw.isurf.reset);
 			return (0);
 	}
-	if (!request_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, "isurf iomem")) {
+	if (!request_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE,
+				"isurf iomem")) {
 		printk(KERN_WARNING "HiSax: Siemens I-Surf memory region "
 			"%lx-%lx already in use\n",
 			cs->hw.isurf.phymem,

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

* Re: [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region
@ 2009-08-09 12:44       ` Julia Lawall
  0 siblings, 0 replies; 10+ messages in thread
From: Julia Lawall @ 2009-08-09 12:44 UTC (permalink / raw)
  To: Karsten Keil; +Cc: isdn4linux, linux-kernel, kernel-janitors

From: Julia Lawall <julia@diku.dk>

request_mem_region should be used when ioremap is used subsequently.
In this case, release_mem_region was already used where needed.

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

// <smpl>
@@
expression start,E;
@@

- request_region
+ request_mem_region
    (start,...)
  ... when != request_mem_region(start,...)
      when != start = E
  ioremap(start,...)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>

---
 drivers/isdn/hisax/isurf.c          |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/hisax/isurf.c b/drivers/isdn/hisax/isurf.c
index ca41617..e1c3434 100644
--- a/drivers/isdn/hisax/isurf.c
+++ b/drivers/isdn/hisax/isurf.c
@@ -259,7 +259,8 @@ setup_isurf(struct IsdnCard *card)
 			cs->hw.isurf.reset);
 			return (0);
 	}
-	if (!request_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE, "isurf iomem")) {
+	if (!request_mem_region(cs->hw.isurf.phymem, ISURF_IOMEM_SIZE,
+				"isurf iomem")) {
 		printk(KERN_WARNING "HiSax: Siemens I-Surf memory region "
 			"%lx-%lx already in use\n",
 			cs->hw.isurf.phymem,

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

end of thread, other threads:[~2009-08-09 12:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-09  7:43 [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region Julia Lawall
2009-08-09  7:43 ` Julia Lawall
2009-08-09  9:51 ` [PATCH 1/3] drivers/isdn/hisax: Correct use of Julia Lawall
2009-08-09  9:51   ` [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region Julia Lawall
2009-08-09 12:20   ` Karsten Keil
2009-08-09 12:20     ` Karsten Keil
2009-08-09 12:28     ` [PATCH 1/3] drivers/isdn/hisax: Correct use of Julia Lawall
2009-08-09 12:28       ` [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region Julia Lawall
2009-08-09 12:44     ` [PATCH 1/3] drivers/isdn/hisax: Correct use of Julia Lawall
2009-08-09 12:44       ` [PATCH 1/3] drivers/isdn/hisax: Correct use of request_region/request_mem_region Julia Lawall

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.