All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 099/108] mm/zswap.c: improve a size determination in zswap_frontswap_init()
@ 2017-07-06 22:40 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2017-07-06 22:40 UTC (permalink / raw)
  To: akpm, ddstreet, elfring, mm-commits, sjenning, torvalds

From: Markus Elfring <elfring@users.sourceforge.net>
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@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>
---

 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;
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-06 22:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-06 22:40 [patch 099/108] mm/zswap.c: improve a size determination in zswap_frontswap_init() akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.