linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: remove unused value for mtdoops
@ 2019-05-27 12:14 Weitao Hou
  2019-05-27 12:20 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Weitao Hou @ 2019-05-27 12:14 UTC (permalink / raw)
  To: dwmw2, computersforpeace, marek.vasut, miquel.raynal, richard, vigneshr
  Cc: linux-mtd, linux-kernel, Weitao Hou

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

Signed-off-by: Weitao Hou <houweitaoo@gmail.com>
---
 drivers/mtd/mtdoops.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index e078fc41aa61..6ae4b70ebdbb 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -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);
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: remove unused value for mtdoops
  2019-05-27 12:14 [PATCH] mtd: remove unused value for mtdoops Weitao Hou
@ 2019-05-27 12:20 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2019-05-27 12:20 UTC (permalink / raw)
  To: Weitao Hou
  Cc: dwmw2, computersforpeace, marek.vasut, richard, vigneshr,
	linux-mtd, linux-kernel

Hi Weitao,

Weitao Hou <houweitaoo@gmail.com> wrote on Mon, 27 May 2019 20:14:40
+0800:

> 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.

> 
> Signed-off-by: Weitao Hou <houweitaoo@gmail.com>
> ---
>  drivers/mtd/mtdoops.c | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
> index e078fc41aa61..6ae4b70ebdbb 100644
> --- a/drivers/mtd/mtdoops.c
> +++ b/drivers/mtd/mtdoops.c
> @@ -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);

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-27 12:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 12:14 [PATCH] mtd: remove unused value for mtdoops Weitao Hou
2019-05-27 12:20 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).