mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-17 20:44:37 +00:00
idr: reduce the unneeded check in free_layer()
If "idr->hint == p" is true, it also implies "idr->hint" is true(not NULL). Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
aefb768297
commit
15f3ec3f23
1 changed files with 1 additions and 1 deletions
|
@ -145,7 +145,7 @@ static void idr_layer_rcu_free(struct rcu_head *head)
|
||||||
|
|
||||||
static inline void free_layer(struct idr *idr, struct idr_layer *p)
|
static inline void free_layer(struct idr *idr, struct idr_layer *p)
|
||||||
{
|
{
|
||||||
if (idr->hint && idr->hint == p)
|
if (idr->hint == p)
|
||||||
RCU_INIT_POINTER(idr->hint, NULL);
|
RCU_INIT_POINTER(idr->hint, NULL);
|
||||||
call_rcu(&p->rcu_head, idr_layer_rcu_free);
|
call_rcu(&p->rcu_head, idr_layer_rcu_free);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue