From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> Subject: 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@xxxxxxxxxxxxxxxxxxxxx Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx> Cc: Dan Streetman <ddstreet@xxxxxxxx> Cc: Seth Jennings <sjenning@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/zswap.c~zswap-improve-a-size-determination-in-zswap_frontswap_init mm/zswap.c --- a/mm/zswap.c~zswap-improve-a-size-determination-in-zswap_frontswap_init +++ a/mm/zswap.c @@ -1156,7 +1156,7 @@ static void zswap_frontswap_init(unsigne { 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; _ -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html