033-02-MIPS-BCM47xx-Fix-some-WARNINGs-pointed-in-sprom.c-by.patch 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. From 2f94acde42b70c81129b398c44aa09411974a16d Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
  3. Date: Sun, 25 Oct 2015 22:16:48 +0100
  4. Subject: [PATCH 2/3] MIPS: BCM47xx: Fix some WARNINGs pointed in sprom.c by
  5. checkpatch.pl
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=UTF-8
  8. Content-Transfer-Encoding: 8bit
  9. There are still few left:
  10. 1) Most of them about lines over 80 chars (increased readability exception)
  11. 2) Wrong parsing of preprocessor macros
  12. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
  13. Cc: linux-mips@linux-mips.org
  14. Cc: Hauke Mehrtens <hauke@hauke-m.de>
  15. Patchwork: https://patchwork.linux-mips.org/patch/11356/
  16. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
  17. ---
  18. arch/mips/bcm47xx/sprom.c | 25 ++++++++++++++++---------
  19. 1 file changed, 16 insertions(+), 9 deletions(-)
  20. --- a/arch/mips/bcm47xx/sprom.c
  21. +++ b/arch/mips/bcm47xx/sprom.c
  22. @@ -60,9 +60,9 @@ static int get_nvram_var(const char *pre
  23. }
  24. #define NVRAM_READ_VAL(type) \
  25. -static void nvram_read_ ## type (const char *prefix, \
  26. - const char *postfix, const char *name, \
  27. - type *val, type allset, bool fallback) \
  28. +static void nvram_read_ ## type(const char *prefix, \
  29. + const char *postfix, const char *name, \
  30. + type *val, type allset, bool fallback) \
  31. { \
  32. char buf[100]; \
  33. int err; \
  34. @@ -422,7 +422,10 @@ static void bcm47xx_fill_sprom_path_r458
  35. int i;
  36. for (i = 0; i < ARRAY_SIZE(sprom->core_pwr_info); i++) {
  37. - struct ssb_sprom_core_pwr_info *pwr_info = &sprom->core_pwr_info[i];
  38. + struct ssb_sprom_core_pwr_info *pwr_info;
  39. +
  40. + pwr_info = &sprom->core_pwr_info[i];
  41. +
  42. snprintf(postfix, sizeof(postfix), "%i", i);
  43. nvram_read_u8(prefix, postfix, "maxp2ga",
  44. &pwr_info->maxpwr_2g, 0, fallback);
  45. @@ -470,7 +473,10 @@ static void bcm47xx_fill_sprom_path_r45(
  46. int i;
  47. for (i = 0; i < ARRAY_SIZE(sprom->core_pwr_info); i++) {
  48. - struct ssb_sprom_core_pwr_info *pwr_info = &sprom->core_pwr_info[i];
  49. + struct ssb_sprom_core_pwr_info *pwr_info;
  50. +
  51. + pwr_info = &sprom->core_pwr_info[i];
  52. +
  53. snprintf(postfix, sizeof(postfix), "%i", i);
  54. nvram_read_u16(prefix, postfix, "pa2gw3a",
  55. &pwr_info->pa_2g[3], 0, fallback);
  56. @@ -535,10 +541,11 @@ static void bcm47xx_fill_sprom_ethernet(
  57. nvram_read_macaddr(prefix, "il0macaddr", sprom->il0mac, fallback);
  58. /* The address prefix 00:90:4C is used by Broadcom in their initial
  59. - configuration. When a mac address with the prefix 00:90:4C is used
  60. - all devices from the same series are sharing the same mac address.
  61. - To prevent mac address collisions we replace them with a mac address
  62. - based on the base address. */
  63. + * configuration. When a mac address with the prefix 00:90:4C is used
  64. + * all devices from the same series are sharing the same mac address.
  65. + * To prevent mac address collisions we replace them with a mac address
  66. + * based on the base address.
  67. + */
  68. if (!bcm47xx_is_valid_mac(sprom->il0mac)) {
  69. u8 mac[6];