[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87qzu1f218.fsf@bootlin.com>
Date: Fri, 14 Nov 2025 09:31:47 +0100
From: Miquel Raynal <miquel.raynal@...tlin.com>
To: Cheng Ming Lin <linchengming884@...il.com>
Cc: richard@....at, chengzhihao1@...wei.com, vigneshr@...com,
linux-mtd@...ts.infradead.org, linux-kernel@...r.kernel.org,
alvinzhou@...c.com.tw, leoyu@...c.com.tw, Cheng Ming Lin
<chengminglin@...c.com.tw>
Subject: Re: [PATCH v2 1/1] mtd: ubi: skip programming unused bits in ubi
headers
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@...tlin.com>
Thanks,
Miquèl
Powered by blists - more mailing lists