From mboxrd@z Thu Jan 1 00:00:00 1970 From: Manuel Reis Date: Wed, 25 Nov 2020 10:19:26 +0000 Subject: [PATCH] added check for ignored =?UTF-8?Q?CONFIG=5FENV=5FEXT4=5FDEVICE=5FAND=5FPART=0D=0A?= definition In-Reply-To: <169cce16a34e41db952152dc3b1c5311@SFHDAG2NODE3.st.com> References: <20201122151939.20005-1-mluis.reis@gmail.com> <169cce16a34e41db952152dc3b1c5311@SFHDAG2NODE3.st.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, thanks for the feedback. Just sent a new corrected patch with fixed commit message title: [PATCH] add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition. regards, Manuel On qua, 25 nov, 2020 at 08:45, Patrick DELAUNAY wrote: > Hi, > >> From: Manuel Reis >> Sent: dimanche 22 novembre 2020 16:20 >> >> Check whether user has explicitly defined device and partition >> where environment >> file will be located. Voids the need to set such partition as >> bootable to work with >> the 'dev:auto' >> >> Signed-off-by: Manuel Reis >> Cc: Patrick Delaunay >> Cc: Patrice Chotard >> --- >> >> board/st/stm32mp1/stm32mp1.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/board/st/stm32mp1/stm32mp1.c >> b/board/st/stm32mp1/stm32mp1.c >> index 4553329b25..4dda70740d 100644 >> --- a/board/st/stm32mp1/stm32mp1.c >> +++ b/board/st/stm32mp1/stm32mp1.c >> @@ -868,6 +868,11 @@ const char *env_ext4_get_intf(void) >> >> const char *env_ext4_get_dev_part(void) { >> + static char *const env_dev_part = >> CONFIG_ENV_EXT4_DEVICE_AND_PART; >> + >> + if (strlen(env_dev_part) > 0) >> + return env_dev_part; >> + >> static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; >> u32 bootmode = get_bootmode(); >> >> -- >> 2.27.0 > > Behavior seems ok, but patch mixes code and variables. > can you move the code part after the variables definitions ? > > const char *env_ext4_get_dev_part(void) { > static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; > u32 bootmode = get_bootmode(); > + static char *const env_dev_part = > CONFIG_ENV_EXT4_DEVICE_AND_PART; > + > + if (strlen(env_dev_part) > 0) > + return env_dev_part; > + > > Regards > > PAtrick