From: Venkatesh Yadav Abbarapu Date: Thu, 29 Sep 2022 04:52:49 +0000 (+0530) Subject: mmc: Fix static checker warnings X-Git-Tag: v2023.07~286^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=337af54a36c6409b7eeb49619c796178b3c22372;p=platform%2Fkernel%2Fu-boot.git mmc: Fix static checker warnings 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 Reviewed-by: Michal Simek Reviewed-by: Jaehoon Chung --- diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 0b7c0be..210703e 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);