From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10A322609CC for ; Fri, 14 Nov 2025 08:31:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763109116; cv=none; b=MtzOtho/8onWyyQ5vyilrQnRW61W6zAO0fWCSBlB1R25p9TWCyA8/5HCa40dMW0AeZwWEUoEUgonD+ULMMmZM3MpB3AWDxzv7HyPnZAoQ6ban19qw4NNiqC77jh5xllJppeTB8mirFrEEspoe51Vb1jMm3IbDn9Pu6YwVJfefiA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763109116; c=relaxed/simple; bh=W14K8s8Ohq0igtwAllssPqCN7pCdClcblK9wwEV0jao=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=Lk6Oha4oZVOKoCFcZ13Grt8V5hX5XSmxN5plM4I99Q9qdej5TELIrwiEo7Erk36aJ1p5bmKyXctk2QCE/chtzdH/tk5bl4vHcKVPRW6cBVk37P4kV2qHO2cNJgjz9DcDkzoEo6tZptyymbzzTVrGTOM59eu/iwsvn0j06d35K+8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=mPqF3wiD; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="mPqF3wiD" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 578D34E416B2; Fri, 14 Nov 2025 08:31:53 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 2A9666060E; Fri, 14 Nov 2025 08:31:53 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A1C46102F29CE; Fri, 14 Nov 2025 09:31:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1763109112; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6PpAftnPCjZrCB5oWldRnnnZnYTJ9d955gTmWsXKxsI=; b=mPqF3wiDb3hiEXablEkO+FbWqrMXoQvr4Z2nIWlAP5Y+OlfwiEnItF0/n3SmpGNspg/vH7 U2uvtvHn4fDSCy3Kf6xzhmMbpCZHC5VvzX2wc3BS7bIFT9RJiDHXDTNf89+vggA6pO6eBP BKWXlCW6dQanxtkogIL5oM0yZL3xNYyTfchfaNWDxVJQpv1PLDlP7itWoDTHjltxMs2CYE bSI9NLPshgTcYxAw+xXy/2PlfkvDuEoLujjeLE5CbH7VscEq4YTzHnLgeyTdQiiTR4+i98 54OojWhBuRRNFwGOMB2D8qh1rmQA71zmOvNxFsFBK5vn8K6YuEUE4NvRtXuqkQ== From: Miquel Raynal To: Cheng Ming Lin 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 Subject: Re: [PATCH v2 1/1] mtd: ubi: skip programming unused bits in ubi headers In-Reply-To: <20251114024452.2927429-2-linchengming884@gmail.com> (Cheng Ming Lin's message of "Fri, 14 Nov 2025 10:44:52 +0800") References: <20251114024452.2927429-1-linchengming884@gmail.com> <20251114024452.2927429-2-linchengming884@gmail.com> User-Agent: mu4e 1.12.7; emacs 30.2 Date: Fri, 14 Nov 2025 09:31:47 +0100 Message-ID: <87qzu1f218.fsf@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Hi Cheng Ming, > @@ -1150,6 +1152,14 @@ int ubi_io_write_vid_hdr(struct ubi_device *ubi, i= nt pnum, > return -EROFS; > } >=20=20 > + 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_V= ID_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 Thanks, Miqu=C3=A8l