From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Wed, 14 Mar 2018 10:09:44 -0400 Subject: [U-Boot] [U-Boot, 1/3] cmd: part: Allow passing partition name to start and size In-Reply-To: <20180226211801.16060-2-semen.protsenko@linaro.org> References: <20180226211801.16060-2-semen.protsenko@linaro.org> Message-ID: <20180314140944.GU1770@bill-the-cat.ec.rr.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Feb 26, 2018 at 11:17:59PM +0200, Sam Protsenko wrote: > Allow passing the partition name to "part start" and "part size" > commands, so we can avoid magic numbers in the environment. > > Consider one real use-case: in include/environment/ti/boot.h we have > commands like these: > > setenv boot_part 9 > part start mmc ${mmcdev} ${boot_part} boot_start > part size mmc ${mmcdev} ${boot_part} boot_size > mmc read ${loadaddr} ${boot_start} ${boot_size} > > Now suppose that we have changed the partition table and boot_part now > is 10. We will need to fix commands above. And anyone who relies on > these boot commands, will need to change them accordingly, too (this was > an actual case in our lab while testing Linux boot on Android > environment). > > By providing the option to pass partition name instead, we fix mentioned > issue, by eliminating the necessity to use magic numbers. > > Signed-off-by: Sam Protsenko > Reviewed-by: Lukasz Majewski Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: