diff mbox series

[1/1] mmc: fsl_esdhc_spl: remove superfluous free()

Message ID 20201227095026.26501-1-xypron.glpk@gmx.de
State Accepted
Commit f11b38e3aeb77b12f14502ff8eafd21737228c30
Delegated to: Tom Rini
Headers show
Series [1/1] mmc: fsl_esdhc_spl: remove superfluous free() | expand

Commit Message

Heinrich Schuchardt Dec. 27, 2020, 9:50 a.m. UTC
Freeing a buffer before calling hang() is superfluous. Removing the call
reduces the SPL size.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/mmc/fsl_esdhc_spl.c | 3 ---
 1 file changed, 3 deletions(-)

--
2.29.2

Comments

Jaehoon Chung Dec. 27, 2020, 11:01 p.m. UTC | #1
On 12/27/20 6:50 PM, Heinrich Schuchardt wrote:
> Freeing a buffer before calling hang() is superfluous. Removing the call
> reduces the SPL size.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Best Regards,
Jaehoon Chung

> ---
>  drivers/mmc/fsl_esdhc_spl.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
> index afe55fad9d..bee76572ac 100644
> --- a/drivers/mmc/fsl_esdhc_spl.c
> +++ b/drivers/mmc/fsl_esdhc_spl.c
> @@ -91,20 +91,17 @@ void __noreturn mmc_boot(void)
>  					CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
>  	if (err != 1) {
>  		puts("spl: mmc read failed!!\n");
> -		free(tmp_buf);
>  		hang();
>  	}
> 
>  	val = *(tmp_buf + MBRDBR_BOOT_SIG_55);
>  	if (0x55 != val) {
>  		puts("spl: mmc signature is not valid!!\n");
> -		free(tmp_buf);
>  		hang();
>  	}
>  	val = *(tmp_buf + MBRDBR_BOOT_SIG_AA);
>  	if (0xAA != val) {
>  		puts("spl: mmc signature is not valid!!\n");
> -		free(tmp_buf);
>  		hang();
>  	}
> 
> --
> 2.29.2
> 
>
Tom Rini Jan. 19, 2021, 1:05 p.m. UTC | #2
On Sun, Dec 27, 2020 at 10:50:26AM +0100, Heinrich Schuchardt wrote:

> Freeing a buffer before calling hang() is superfluous. Removing the call
> reduces the SPL size.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/drivers/mmc/fsl_esdhc_spl.c b/drivers/mmc/fsl_esdhc_spl.c
index afe55fad9d..bee76572ac 100644
--- a/drivers/mmc/fsl_esdhc_spl.c
+++ b/drivers/mmc/fsl_esdhc_spl.c
@@ -91,20 +91,17 @@  void __noreturn mmc_boot(void)
 					CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
 	if (err != 1) {
 		puts("spl: mmc read failed!!\n");
-		free(tmp_buf);
 		hang();
 	}

 	val = *(tmp_buf + MBRDBR_BOOT_SIG_55);
 	if (0x55 != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}
 	val = *(tmp_buf + MBRDBR_BOOT_SIG_AA);
 	if (0xAA != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}