public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@gmail.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: Fri, 7 Oct 2022 21:39:29 +0900	[thread overview]
Message-ID: <342911fe-0f22-178e-d44e-c2d3bd7d9ead@gmail.com> (raw)
In-Reply-To: <20220929045249.23842-1-venkatesh.abbarapu@amd.com>



On 9/29/22 13: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>


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

Best Regards,
Jaehoon Chung

> ---
> 
>  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);
>  

  parent reply	other threads:[~2022-10-07 12:39 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
2022-10-07 12:39   ` Jaehoon Chung [this message]
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=342911fe-0f22-178e-d44e-c2d3bd7d9ead@gmail.com \
    --to=jh80.chung@gmail.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