mmc: core: optimize mmc_calc_max_discard
authorSergio Valverde <vlvrdv@gmail.com>
Thu, 8 Feb 2018 17:41:43 +0000 (11:41 -0600)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 5 Mar 2018 08:01:00 +0000 (09:01 +0100)
commitb305882fbc878f10ad089348da147987c330a2ee
tree31fb0bcde41b9216f7288d69b45a49e19b8a6fd9
parent5a871bf081dd7915ed7b9942a5484ff0c742e2cc
mmc: core: optimize mmc_calc_max_discard

If the max_discard value is zero, the conditional branch that checks the
trim capabilities will never update this value with max_trim.

Change the condition statement to also check the max_discard value in order
to avoid an unnecessary call to mmc_do_calc_max_discard.

Signed-off-by: Sergio Valverde <vlvrdv@gmail.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chip.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/core.c