[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0afe37eb-71fe-2a40-7ed5-24b910906671@users.sourceforge.net>
Date: Mon, 8 May 2017 17:10:03 +0200
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-mtd@...ts.infradead.org,
Boris Brezillon <boris.brezillon@...e-electrons.com>,
Brian Norris <computersforpeace@...il.com>,
Cyrille Pitchen <cyrille.pitchen@...ev4u.fr>,
David Woodhouse <dwmw2@...radead.org>,
Marek Vasut <marek.vasut@...il.com>,
Richard Weinberger <richard@....at>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 3/3] mtdswap: Improve a size determination in
mtdswap_erase_block()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Mon, 8 May 2017 16:51:30 +0200
Replace the specification of a data structure by a name for
a local variable as the parameter for the operator "sizeof" to make
the corresponding size determination a bit safer.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/mtd/mtdswap.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index f73fb0909b0c..c748515f8533 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -559,8 +559,7 @@ static int mtdswap_erase_block(struct mtdswap_dev *d, struct swap_eb *eb)
retry:
init_waitqueue_head(&wq);
- memset(&erase, 0, sizeof(struct erase_info));
-
+ memset(&erase, 0, sizeof(erase));
erase.mtd = mtd;
erase.callback = mtdswap_erase_callback;
erase.addr = mtdswap_eb_offset(d, eb);
--
2.12.2
Powered by blists - more mailing lists