From: Markus Elfring Date: Thu, 6 Jul 2017 22:40:37 +0000 (-0700) Subject: mm/zswap.c: improve a size determination in zswap_frontswap_init() X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=9cd1f701ce47599ddfb589afeb88b5513b6915bc;p=openwrt%2Fstaging%2Fblogic.git 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 Cc: Dan Streetman Cc: Seth Jennings Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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;