Re: Linux-2.6.13 : __check_region is deprecated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 30 Aug 2005, Stephane Wirtel wrote:

> Hi,
>
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
>
> With a grep on the source code of the last release, I get this result.
>
> drivers/pnp/resource.c:255:             if (__check_region(&ioport_resource, *port, length(port,end)))
> include/linux/ioport.h:117:#define check_mem_region(start,n) __check_region(&iomem_resource, (start), (n))
> include/linux/ioport.h:120:extern int __check_region(struct resource *, unsigned long, unsigned long);
> include/linux/ioport.h:125:     return __check_region(&ioport_resource, s, n);
> kernel/resource.c:468:int __deprecated __check_region(struct resource *parent, unsigned long start, unsigned long n)
> kernel/resource.c:481:EXPORT_SYMBOL(__check_region);
>
> Is there a function to replace this deprecated function ?

Just restructure the code to use request_region().

> Why is it deprecated ?

because it's racy.  I.e., it's normally used as:

	check_region();
	if (ok)
		request_region();

but between the check_region() and request_region(), the region
could have been allocated by something else.

-- 
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux