lkml.org 
[lkml]   [2017]   [May]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 3/3] mtdswap: Improve a size determination in mtdswap_erase_block()
From
Date
From: Markus Elfring <elfring@users.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@users.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
\
 
 \ /
  Last update: 2017-05-08 17:13    [W:0.029 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site