Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1637499
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/3] mtdswap: Improve a size determination in mtdswap_erase_block() |
| Date | 2017-05-08 17:20 +0200 |
| Message-ID | <tESC6-5Ad-13@gated-at.bofh.it> (permalink) |
| References | <tESsp-5wT-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/3] mtdswap: Fine-tuning for three function implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:10 +0200 [PATCH 1/3] mtdswap: Reduce function calls for sequence output in mtdswap_show() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:10 +0200 [PATCH 3/3] mtdswap: Improve a size determination in mtdswap_erase_block() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:20 +0200 [PATCH 2/3] mtdswap: Improve two size determinations in mtdswap_add_mtd() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-05-08 17:20 +0200
csiph-web