spl: mmc: Avoid size growth in spl_mmc_find_device() debug

The for() loop ends up being in the code even if the log_debug() does
nothing. Add a condition to fix this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
This commit is contained in:
Simon Glass 2024-12-07 10:23:54 -07:00 committed by Tom Rini
parent 62224280d9
commit a2c90dc371

View File

@ -81,8 +81,10 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev)
struct uclass *uc; struct uclass *uc;
log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev); log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev);
uclass_id_foreach_dev(UCLASS_MMC, dev, uc) if (_LOG_DEBUG) {
log_debug("%d: %s\n", dev_seq(dev), dev->name); uclass_id_foreach_dev(UCLASS_MMC, dev, uc)
log_debug("%d: %s\n", dev_seq(dev), dev->name);
}
ret = mmc_init_device(mmc_dev); ret = mmc_init_device(mmc_dev);
#else #else
ret = mmc_initialize(NULL); ret = mmc_initialize(NULL);