]> git.baikalelectronics.ru Git - kernel.git/commit
lib/rhashtable.c: use kvzalloc() in bucket_table_alloc() when possible
authorMichal Hocko <mhocko@suse.com>
Mon, 10 Jul 2017 22:51:55 +0000 (15:51 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 10 Jul 2017 23:32:35 +0000 (16:32 -0700)
commit89f4957436c4556e9029597cd6e254b4c3ec223a
tree1a0c4dd2d97d121288e2120022e23a1d1f5de5e1
parent41c8f3500133fe606e4645d50bc6b601c0cdda34
lib/rhashtable.c: use kvzalloc() in bucket_table_alloc() when possible

bucket_table_alloc() can be currently called with GFP_KERNEL or
GFP_ATOMIC.  For the former we basically have an open coded kvzalloc()
while the later only uses kzalloc().  Let's simplify the code a bit by
the dropping the open coded path and replace it with kvzalloc().

Link: http://lkml.kernel.org/r/20170531155145.17111-3-mhocko@kernel.org
Signed-off-by: Michal Hocko <mhocko@suse.com>
Cc: Thomas Graf <tgraf@suug.ch>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/rhashtable.c