Skip to contentSkip to conversation

mtd: remove unused value for mtdoops

PATCH Superseded Weitao Hou 2 participants 2 messages May 27, 2019 Memory technology devices (MTD)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Weitao Hou

author
#0 lore raw

PATCH 1/1 mtd: remove unused value for mtdoops

since hdr was never used, we need not reserve and init it

---
 drivers/mtd/mtdoops.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/mtd/mtdoops.c +0 -6
index e078fc41aa61..6ae4b70ebdbb 100644
@@ -191,14 +191,8 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)
 {
 	struct mtd_info *mtd = cxt->mtd;
 	size_t retlen;
-	u32 *hdr;
 	int ret;
 
-	/* Add mtdoops header to the buffer */
-	hdr = cxt->oops_buf;
-	hdr[0] = cxt->nextcount;
-	hdr[1] = MTDOOPS_KERNMSG_MAGIC;
-
 	if (panic) {
 		ret = mtd_panic_write(mtd, cxt->nextpage * record_size,
 				      record_size, &retlen, cxt->oops_buf);
Signature · 1 line
2.18.0
maintainer
#1 lore raw

Hi Weitao,

Weitao Hou <[email protected]> wrote on Mon, 27 May 2019 20:14:40 +0800:

Quoted 1 line

since hdr was never used, we need not reserve and init it

What about "MTD oops 'hdr' header is never used, drop its initialization."

Maybe a Fixes tag would be appropriate.

Quoted 15 lines
---
 drivers/mtd/mtdoops.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/mtd/mtdoops.c +0 -1
index e078fc41aa61..6ae4b70ebdbb 100644
@@ -191,14 +191,8 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)
 {
 	struct mtd_info *mtd = cxt->mtd;
 	size_t retlen;
-	u32 *hdr;

drivers/mtd/mtdoops.c static void mtdoops_write(struct mtdoops_context *cxt, int panic) · line 198

Quoted 10 lines
drivers/mtd/mtdoops.c +0 -5
 	int ret;
 
-	/* Add mtdoops header to the buffer */
-	hdr = cxt->oops_buf;
-	hdr[0] = cxt->nextcount;
-	hdr[1] = MTDOOPS_KERNMSG_MAGIC;
-
 	if (panic) {
 		ret = mtd_panic_write(mtd, cxt->nextpage * record_size,
 				      record_size, &retlen, cxt->oops_buf);

Thanks,
Miquèl