Message ID | 20241207172412.1124558-2-sjg@chromium.org |
---|---|
State | Changes Requested |
Delegated to: | Tom Rini |
Headers | show |
Series | vbe: Series part E | expand |
> -----Original Message----- > From: Simon Glass <sjg@chromium.org> > Sent: Sunday, December 8, 2024 2:24 AM > 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> Best Regards, Jaehoon Chung > --- > > Changes in v3: > - Add new patch to avoid size growth in spl_mmc_find_device() debug > > common/spl/spl_mmc.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c > index 1f696593216..fe4230170a0 100644 > --- a/common/spl/spl_mmc.c > +++ b/common/spl/spl_mmc.c > @@ -81,8 +81,10 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev) > struct uclass *uc; > > log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev); > - uclass_id_foreach_dev(UCLASS_MMC, dev, uc) > - log_debug("%d: %s\n", dev_seq(dev), dev->name); > + if (_LOG_DEBUG) { > + uclass_id_foreach_dev(UCLASS_MMC, dev, uc) > + log_debug("%d: %s\n", dev_seq(dev), dev->name); > + } > ret = mmc_init_device(mmc_dev); > #else > ret = mmc_initialize(NULL); > -- > 2.34.1
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c index 1f696593216..fe4230170a0 100644 --- a/common/spl/spl_mmc.c +++ b/common/spl/spl_mmc.c @@ -81,8 +81,10 @@ static int spl_mmc_find_device(struct mmc **mmcp, int mmc_dev) struct uclass *uc; log_debug("Selecting MMC dev %d; seqs:\n", mmc_dev); - uclass_id_foreach_dev(UCLASS_MMC, dev, uc) - log_debug("%d: %s\n", dev_seq(dev), dev->name); + if (_LOG_DEBUG) { + uclass_id_foreach_dev(UCLASS_MMC, dev, uc) + log_debug("%d: %s\n", dev_seq(dev), dev->name); + } ret = mmc_init_device(mmc_dev); #else ret = mmc_initialize(NULL);
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> --- Changes in v3: - Add new patch to avoid size growth in spl_mmc_find_device() debug common/spl/spl_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)