2
0

100-MIPS-ath79-Avoid-using-unitialized-reg-variable.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 8b7a76e72fc819753878cd5684e243f33f847c79 Mon Sep 17 00:00:00 2001
  2. From: Markos Chandras <markos.chandras@imgtec.com>
  3. Date: Wed, 21 Aug 2013 11:47:22 +0100
  4. Subject: [PATCH] MIPS: ath79: Avoid using unitialized 'reg' variable
  5. Fixes the following build error:
  6. arch/mips/include/asm/mach-ath79/ath79.h:139:20: error: 'reg' may be used
  7. uninitialized in this function [-Werror=maybe-uninitialized]
  8. arch/mips/ath79/common.c:62:6: note: 'reg' was declared here
  9. In file included from arch/mips/ath79/common.c:20:0:
  10. arch/mips/ath79/common.c: In function 'ath79_device_reset_clear':
  11. arch/mips/include/asm/mach-ath79/ath79.h:139:20:
  12. error: 'reg' may be used uninitialized in this function
  13. [-Werror=maybe-uninitialized]
  14. arch/mips/ath79/common.c:90:6: note: 'reg' was declared here
  15. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
  16. Acked-by: Gabor Juhos <juhosg@openwrt.org>
  17. ---
  18. arch/mips/ath79/common.c | 4 ++--
  19. 1 file changed, 2 insertions(+), 2 deletions(-)
  20. --- a/arch/mips/ath79/common.c
  21. +++ b/arch/mips/ath79/common.c
  22. @@ -106,7 +106,7 @@ void ath79_device_reset_set(u32 mask)
  23. else if (soc_is_qca955x())
  24. reg = QCA955X_RESET_REG_RESET_MODULE;
  25. else
  26. - BUG();
  27. + panic("Reset register not defined for this SOC");
  28. spin_lock_irqsave(&ath79_device_reset_lock, flags);
  29. t = ath79_reset_rr(reg);
  30. @@ -134,7 +134,7 @@ void ath79_device_reset_clear(u32 mask)
  31. else if (soc_is_qca955x())
  32. reg = QCA955X_RESET_REG_RESET_MODULE;
  33. else
  34. - BUG();
  35. + panic("Reset register not defined for this SOC");
  36. spin_lock_irqsave(&ath79_device_reset_lock, flags);
  37. t = ath79_reset_rr(reg);