Re: Linux-2.6.13 : __check_region is deprecated
From: Jesper Juhl
Date: Mon Aug 29 2005 - 18:26:54 EST
On 8/30/05, Stephane Wirtel <stephane.wirtel@xxxxxxxxxxxx> wrote:
> By compiling my kernel, I can see that the __check_region function (in
> kernel/resource.c) is deprecated.
> 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
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
Jesper Juhl <jesper.juhl@xxxxxxxxx>
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/