0004-mmc-Initialize-clock-variable-in-mmc_recalculate_clo.patch 959 B

12345678910111213141516171819202122232425262728293031
  1. From 925042a09afb9529b112eff2e4d56bf979ff32ec Mon Sep 17 00:00:00 2001
  2. From: Paul Kocialkowski <contact@paulk.fr>
  3. Date: Mon, 19 Dec 2016 14:54:40 +0100
  4. Subject: [PATCH 4/4] mmc: Initialize clock variable in mmc_recalculate_clock
  5. Initializing the variable before it is used (and set to a proper value)
  6. avoids triggering a maybe uninitialized compiler warning.
  7. Change-Id: I0f78e534919e892e23fbe6d38bba6e68c408b0c4
  8. Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
  9. ---
  10. src/drivers/storage/mmc.c | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. diff --git a/src/drivers/storage/mmc.c b/src/drivers/storage/mmc.c
  13. index b877548..54306a1 100644
  14. --- a/src/drivers/storage/mmc.c
  15. +++ b/src/drivers/storage/mmc.c
  16. @@ -509,7 +509,7 @@ static void mmc_set_clock(MmcCtrlr *ctrlr, uint32_t clock)
  17. static void mmc_recalculate_clock(MmcMedia *media)
  18. {
  19. - uint32_t clock;
  20. + uint32_t clock = 0;
  21. if (IS_SD(media)) {
  22. if (media->caps & MMC_MODE_HS)
  23. --
  24. 2.10.2