public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@amd.com>
To: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>,
	<u-boot@lists.denx.de>
Cc: <peng.fan@nxp.com>, <jh80.chung@samsung.com>, <git@xilinx.com>
Subject: Re: [PATCH] mmc: Fix static checker warnings
Date: Tue, 4 Oct 2022 14:32:40 +0200	[thread overview]
Message-ID: <93d6ebad-e24b-069d-6051-7149af9d3d50@amd.com> (raw)
In-Reply-To: <20220929045249.23842-1-venkatesh.abbarapu@amd.com>



On 9/29/22 06:52, Venkatesh Yadav Abbarapu wrote:
> Correct pointer dereferencing check to be more consistent.
> 
> Eliminate the below smatch warning:
> drivers/mmc/mmc.c:3118 mmc_init_device()
> warn: variable dereferenced before check 'm' (see line 3116)
> 
> Signed-off-by: Venkatesh Yadav Abbarapu <venkatesh.abbarapu@amd.com>
> ---
> 
>   drivers/mmc/mmc.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
> index 0b7c0be8cb..210703ea46 100644
> --- a/drivers/mmc/mmc.c
> +++ b/drivers/mmc/mmc.c
> @@ -3113,10 +3113,12 @@ int mmc_init_device(int num)
>   	}
>   
>   	m = mmc_get_mmc_dev(dev);
> -	m->user_speed_mode = MMC_MODES_END; /* Initialising user set speed mode */
> -
>   	if (!m)
>   		return 0;
> +
> +	/* Initialising user set speed mode */
> +	m->user_speed_mode = MMC_MODES_END;
> +
>   	if (m->preinit)
>   		mmc_start_init(m);
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal

  reply	other threads:[~2022-10-04 12:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20221025000241epcas1p3a68b2f9154afa86b6f35f6f729d4b644@epcas1p3.samsung.com>
2022-09-29  4:52 ` [PATCH] mmc: Fix static checker warnings Venkatesh Yadav Abbarapu
2022-10-04 12:32   ` Michal Simek [this message]
2022-10-07 12:39   ` Jaehoon Chung
2022-10-25  0:02   ` Jaehoon Chung

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93d6ebad-e24b-069d-6051-7149af9d3d50@amd.com \
    --to=michal.simek@amd.com \
    --cc=git@xilinx.com \
    --cc=jh80.chung@samsung.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    --cc=venkatesh.abbarapu@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox