Linux-mtd Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Cheng Ming Lin <linchengming884@gmail.com>
Cc: richard@nod.at,  chengzhihao1@huawei.com,  vigneshr@ti.com,
	linux-mtd@lists.infradead.org,  linux-kernel@vger.kernel.org,
	alvinzhou@mxic.com.tw,  leoyu@mxic.com.tw,
	 Cheng Ming Lin <chengminglin@mxic.com.tw>
Subject: Re: [PATCH v2 1/1] mtd: ubi: skip programming unused bits in ubi headers
Date: Fri, 14 Nov 2025 09:31:47 +0100	[thread overview]
Message-ID: <87qzu1f218.fsf@bootlin.com> (raw)
In-Reply-To: <20251114024452.2927429-2-linchengming884@gmail.com> (Cheng Ming Lin's message of "Fri, 14 Nov 2025 10:44:52 +0800")

Hi Cheng Ming,

> @@ -1150,6 +1152,14 @@ int ubi_io_write_vid_hdr(struct ubi_device *ubi, int pnum,
>  		return -EROFS;
>  	}
>  
> +	if (ubi->vid_hdr_shift) {
> +		memset((char *)p, 0xFF, ubi->vid_hdr_shift);
> +		memset((char *)p + ubi->vid_hdr_shift + UBI_VID_HDR_SIZE, 0xFF,
> +		       ubi->vid_hdr_alsize - (ubi->vid_hdr_shift + UBI_VID_HDR_SIZE));
> +	} else {
> +		memset((char *)p + UBI_VID_HDR_SIZE, 0xFF, ubi->vid_hdr_alsize - UBI_VID_HDR_SIZE);
> +	}
> +

Is it not possible to memset() the buffer before writing the VID header?
I haven't found quickly a good place to do that, so in any case,

Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2025-11-14  8:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14  2:44 [PATCH v2 0/1] mtd: ubi: skip programming unused bits in ubi headers Cheng Ming Lin
2025-11-14  2:44 ` [PATCH v2 1/1] " Cheng Ming Lin
2025-11-14  8:31   ` Miquel Raynal [this message]
2025-11-14  8:47     ` Cheng Ming Lin
2025-11-14  9:24       ` Zhihao Cheng
2025-11-14  9:28   ` Zhihao Cheng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87qzu1f218.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=alvinzhou@mxic.com.tw \
    --cc=chengminglin@mxic.com.tw \
    --cc=chengzhihao1@huawei.com \
    --cc=leoyu@mxic.com.tw \
    --cc=linchengming884@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox