lkml.org 
[lkml]   [2005]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux-2.6.13 : __check_region is deprecated
On 8/30/05, Stephane Wirtel <stephane.wirtel@belgacom.net> 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 <jesper.juhl@gmail.com>
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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-08-30 01:29    [W:0.061 / U:0.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site