linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Fwd: Re: [PATCH] Get rid of __check_region in drivers/pnp/resource.c [2.6.0-test1][2.5.75-kj1]
       [not found] <200307261806.41091.bellucda@tiscali.it>
@ 2003-07-26 20:29 ` Adam Belay
  0 siblings, 0 replies; only message in thread
From: Adam Belay @ 2003-07-26 20:29 UTC (permalink / raw)
  To: Daniele Bellucci; +Cc: linux-kernel

On Sat, Jul 26, 2003 at 06:06:41PM +0200, Daniele Bellucci wrote:
> 
> Hi Adam,
> could you double check this patch?
> 
> tnx.
> 
> 
> diff -urN 1.0/drivers/pnp/resource.c 1.1/drivers/pnp/resource.c
> --- 1.0/drivers/pnp/resource.c	2003-07-26 13:56:18.000000000 +0200
> +++ 1.1/drivers/pnp/resource.c	2003-07-26 14:05:30.000000000 +0200
> @@ -258,7 +258,9 @@
>  	/* check if the resource is already in use, skip if the
>  	 * device is active because it itself may be in use */
>  	if(!dev->active) {
> -		if (__check_region(&ioport_resource, *port, length(port,end)))
> +
> +		if (__request_region(&ioport_resource, *port, length(port,end),
> +				     dev->dev.name))
>  			return 0;
>  	}
>  
> 
> 
> 
> ----------  Forwarded Message  ----------
> 
> Subject: Re: [PATCH] Get rid of __check_region in drivers/pnp/resource.c 
[2.6.0-test1][2.5.75-kj1]> Date: Sat, 26 Jul 2003 11:50:40 -0400
> From: Greg KH <greg@kroah.com>
> To: Daniele Bellucci <bellucda@tiscali.it>
> Cc: kernel-janitor-discuss@lists.sourceforge.net
> 
> On Sat, Jul 26, 2003 at 02:10:15PM +0200, Daniele Bellucci wrote:
> > Hi all,
> > the following patch  compile and boot fine but i'm not sure if this is the
> > right fix.
> >
> > Please tellme if correct.
> 
> It doesn't look correct.  You should also cc: the pnp maintainer about
> this.
> 
> thanks,
> 
> greg k-h
> 
> -------------------------------------------------------
>

We only want to check if the resource is in use, not reserve it.  Therefore I 
see __check_region as being appropriate.  As long as it isn't printing a compile
warning, I'd prefer to leave it.  In this particular case it is not creating a 
race condition but for most cases it should be removed.

Also simply requesting the resource without releasing it will cause many of the
drivers that actually call request_region to fail.

Thanks,
Adam

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-27  0:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200307261806.41091.bellucda@tiscali.it>
2003-07-26 20:29 ` Fwd: Re: [PATCH] Get rid of __check_region in drivers/pnp/resource.c [2.6.0-test1][2.5.75-kj1] Adam Belay

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