[PATCH 1/1] cmd: mmc: don't assign unused values

Don't assign a value to variable speedmode which is never used.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com --- cmd/mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cmd/mmc.c b/cmd/mmc.c index 7464f8d00c..63bf69b0bd 100644 --- a/cmd/mmc.c +++ b/cmd/mmc.c @@ -501,11 +501,12 @@ static int do_mmc_rescan(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct mmc *mmc; - enum bus_mode speed_mode = MMC_MODES_END;
if (argc == 1) { mmc = init_mmc_device(curr_device, true); } else if (argc == 2) { + enum bus_mode speed_mode; + speed_mode = (int)dectoul(argv[1], NULL); mmc = __init_mmc_device(curr_device, true, speed_mode); } else { @@ -543,7 +544,6 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, { int dev, part = 0, ret; struct mmc *mmc; - enum bus_mode speed_mode = MMC_MODES_END;
if (argc == 1) { dev = curr_device; @@ -561,6 +561,8 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, } mmc = init_mmc_device(dev, true); } else if (argc == 4) { + enum bus_mode speed_mode; + dev = (int)dectoul(argv[1], NULL); part = (int)dectoul(argv[2], NULL); if (part > PART_ACCESS_MASK) {

Hi!
2022년 4월 26일 (화) 06:11, Heinrich Schuchardt < heinrich.schuchardt@canonical.com>님이 작성:
Don't assign a value to variable speedmode which is never used.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
cmd/mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cmd/mmc.c b/cmd/mmc.c index 7464f8d00c..63bf69b0bd 100644 --- a/cmd/mmc.c +++ b/cmd/mmc.c @@ -501,11 +501,12 @@ static int do_mmc_rescan(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { struct mmc *mmc;
enum bus_mode speed_mode = MMC_MODES_END; if (argc == 1) { mmc = init_mmc_device(curr_device, true); } else if (argc == 2) {
enum bus_mode speed_mode;
speed_mode = (int)dectoul(argv[1], NULL); mmc = __init_mmc_device(curr_device, true, speed_mode); } else {
@@ -543,7 +544,6 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, { int dev, part = 0, ret; struct mmc *mmc;
enum bus_mode speed_mode = MMC_MODES_END; if (argc == 1) { dev = curr_device;
@@ -561,6 +561,8 @@ static int do_mmc_dev(struct cmd_tbl *cmdtp, int flag, } mmc = init_mmc_device(dev, true); } else if (argc == 4) {
enum bus_mode speed_mode;
dev = (int)dectoul(argv[1], NULL); part = (int)dectoul(argv[2], NULL); if (part > PART_ACCESS_MASK) {
-- 2.34.1
Reviewed-by: Minkyu Kang mk7.kang@samsung.com
Thanks,

On Mon, Apr 25, 2022 at 11:11:06PM +0200, Heinrich Schuchardt wrote:
Don't assign a value to variable speedmode which is never used.
Signed-off-by: Heinrich Schuchardt heinrich.schuchardt@canonical.com
Applied to u-boot/master, thanks!
participants (3)
-
Heinrich Schuchardt
-
Minkyu Kang
-
Tom Rini