diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2017-05-26 11:32:05 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2017-05-29 09:22:22 +1000 |
commit | 485c15c90370e7b56881e13844d1e96f64045783 (patch) | |
tree | 551d50018c8a2f30587f103aaa909cebe96a36c1 | |
parent | e85191bb9eb597f27effb4b5e6fc52fe2f3149a8 (diff) |
mm/zswap.c: improve a size determination in zswap_frontswap_init()
Replace the specification of a data structure by a pointer dereference as
the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Link: http://lkml.kernel.org/r/19f9da22-092b-f867-bdf6-f4dbad7ccf1f@users.sourceforge.net
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Seth Jennings <sjenning@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r-- | mm/zswap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/zswap.c b/mm/zswap.c index 18d8e87119a6..a6e67633be03 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -1156,7 +1156,7 @@ static void zswap_frontswap_init(unsigned type) { struct zswap_tree *tree; - tree = kzalloc(sizeof(struct zswap_tree), GFP_KERNEL); + tree = kzalloc(sizeof(*tree), GFP_KERNEL); if (!tree) { pr_err("alloc failed, zswap disabled for swap type %d\n", type); return; |