[PATCH] mmc: bcm2835-host: Remove duplicate NULL test for cmd

Matthias Brugger mbrugger at suse.com
Thu Jul 31 15:56:41 CEST 2025



On 29/07/2025 14:05, Andrew Goodbody wrote:
> In bcm2835_send_cmd the test for a previous command not being complete
> depends on cmd not being NULL so a second test in the code block is
> redundant as it is guaranteed to be true. Remove the test and the
> unreachable code following it.
> 
> This issue was found by Smatch.
> 
> Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>

Reviewed-by: Matthias Brugger <mbrugger at suse.com>

> ---
>   drivers/mmc/bcm2835_sdhost.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/mmc/bcm2835_sdhost.c b/drivers/mmc/bcm2835_sdhost.c
> index 720127468d3..4ec8c672038 100644
> --- a/drivers/mmc/bcm2835_sdhost.c
> +++ b/drivers/mmc/bcm2835_sdhost.c
> @@ -689,10 +689,7 @@ static int bcm2835_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
>   		       readl(host->ioaddr + SDCMD) & SDCMD_CMD_MASK, edm);
>   		bcm2835_dumpregs(host);
>   
> -		if (cmd)
> -			return -EILSEQ;
> -
> -		return 0;
> +		return -EILSEQ;
>   	}
>   
>   	if (cmd) {
> 
> ---
> base-commit: 182cb30084516c3085d2ca5dde3f105f7625d774
> change-id: 20250729-mmc_bcm2835-c97e9597c25c
> 
> Best regards,



More information about the U-Boot mailing list