Re: Linux-2.6.13 : __check_region is deprecated

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

 



On 8/30/05, Stephane Wirtel <[email protected]> wrote:
> Hi,
> 
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
> 
[snip]
> 
> Is there a function to replace this deprecated function ?
> 
Yes, you just call request_region() and check its return value.


> Why is it deprecated ?
> 
In the past you first called check_region() followed by
request_region() if the region was available. That is not safe as you
could get interrupted between the two calls and something else might
have already grabbed the region you thought was free by the time you
get to calling request_region().  So, request_region() was rewritten
to do the checking internally and let the caller know via its return
value if
acquiring the region failed or succeded. 
So these days check_region should no longer be used. It's a historic
relic. request_region() should be used directly instead. That's why it
is deprecated.


-- 
Jesper Juhl <[email protected]>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html
-
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