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