diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2014-04-23 08:27:41 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2014-04-23 08:27:41 +1000 |
commit | ac365850ec47b2d629d03c13301fea57e9e09e3d (patch) | |
tree | 3805bb1f324d393f4803d87a8529e028d03de786 /lib | |
parent | 4826873ca02bf5d019d8ba667fc82e0615d9759d (diff) |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/idr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/idr.c b/lib/idr.c index 9ed37a7a031d..39158abebad1 100644 --- a/lib/idr.c +++ b/lib/idr.c @@ -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) { - if (idr->hint && idr->hint == p) + if (idr->hint == p) RCU_INIT_POINTER(idr->hint, NULL); call_rcu(&p->rcu_head, idr_layer_rcu_free); } |