mm/zswap.c: improve a size determination in zswap_frontswap_init()
Subsystems (2)
[email protected]
maintainerPATCH 99/108 mm/zswap.c: improve a size determination in zswap_frontswap_init()
From: Markus Elfring <[email protected]>
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.
Signed-off-by Markus Elfring <[email protected]>
Cc Dan Streetman <[email protected]>
Cc Seth Jennings <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/zswap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/zswap.c renamed from mm/zswap.c~zswap-improve-a-size-determination-in-zswap_frontswap_init +1 -1
@@ -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 ;
_