diff options
author | Jason Cooper <jason@lakedaemon.net> | 2010-09-30 15:15:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-10-05 12:22:25 -0400 |
commit | 9b890325d6b34354552db5e369698757301d30a7 (patch) | |
tree | b06f3af8b7b44e08e4518c9c66e5cf2d3109421a | |
parent | a618cc28336b8dd1244dc28a251ccc4eff60a726 (diff) |
staging: brcm80211: fix checkpatch error 'assignment in if condition'
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Henry Ptasinski <henryp@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 105 |
1 files changed, 57 insertions, 48 deletions
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c index 04d68646106..b0ea91541be 100644 --- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -1241,7 +1241,8 @@ int dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen) | |||
1241 | 1241 | ||
1242 | /* Add alignment padding (optional for ctl frames) */ | 1242 | /* Add alignment padding (optional for ctl frames) */ |
1243 | if (dhd_alignctl) { | 1243 | if (dhd_alignctl) { |
1244 | if ((doff = ((uintptr) frame % DHD_SDALIGN))) { | 1244 | doff = ((uintptr) frame % DHD_SDALIGN); |
1245 | if (doff) { | ||
1245 | frame -= doff; | 1246 | frame -= doff; |
1246 | len += doff; | 1247 | len += doff; |
1247 | msglen += doff; | 1248 | msglen += doff; |
@@ -1758,9 +1759,8 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh) | |||
1758 | 1759 | ||
1759 | /* Read last word in memory to determine address of | 1760 | /* Read last word in memory to determine address of |
1760 | sdpcm_shared structure */ | 1761 | sdpcm_shared structure */ |
1761 | if ((rv = | 1762 | rv = dhdsdio_membytes(bus, FALSE, bus->ramsize - 4, (uint8 *)&addr, 4); |
1762 | dhdsdio_membytes(bus, FALSE, bus->ramsize - 4, (uint8 *)&addr, | 1763 | if (rv < 0) |
1763 | 4)) < 0) | ||
1764 | return rv; | 1764 | return rv; |
1765 | 1765 | ||
1766 | addr = ltoh32(addr); | 1766 | addr = ltoh32(addr); |
@@ -1831,13 +1831,15 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) | |||
1831 | } | 1831 | } |
1832 | } | 1832 | } |
1833 | 1833 | ||
1834 | if ((str = MALLOC(bus->dhd->osh, maxstrlen)) == NULL) { | 1834 | str = MALLOC(bus->dhd->osh, maxstrlen); |
1835 | if (str == NULL) { | ||
1835 | DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__, maxstrlen)); | 1836 | DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__, maxstrlen)); |
1836 | bcmerror = BCME_NOMEM; | 1837 | bcmerror = BCME_NOMEM; |
1837 | goto done; | 1838 | goto done; |
1838 | } | 1839 | } |
1839 | 1840 | ||
1840 | if ((bcmerror = dhdsdio_readshared(bus, &sdpcm_shared)) < 0) | 1841 | bcmerror = dhdsdio_readshared(bus, &sdpcm_shared); |
1842 | if (bcmerror < 0) | ||
1841 | goto done; | 1843 | goto done; |
1842 | 1844 | ||
1843 | bcm_binit(&strbuf, data, size); | 1845 | bcm_binit(&strbuf, data, size); |
@@ -1869,10 +1871,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) | |||
1869 | bcm_bprintf(&strbuf, "Dongle assert"); | 1871 | bcm_bprintf(&strbuf, "Dongle assert"); |
1870 | if (sdpcm_shared.assert_exp_addr != 0) { | 1872 | if (sdpcm_shared.assert_exp_addr != 0) { |
1871 | str[0] = '\0'; | 1873 | str[0] = '\0'; |
1872 | if ((bcmerror = dhdsdio_membytes(bus, FALSE, | 1874 | bcmerror = dhdsdio_membytes(bus, FALSE, |
1873 | sdpcm_shared.assert_exp_addr, | 1875 | sdpcm_shared.assert_exp_addr, |
1874 | (uint8 *) str, | 1876 | (uint8 *) str, maxstrlen); |
1875 | maxstrlen)) < 0) | 1877 | if (bcmerror < 0) |
1876 | goto done; | 1878 | goto done; |
1877 | 1879 | ||
1878 | str[maxstrlen - 1] = '\0'; | 1880 | str[maxstrlen - 1] = '\0'; |
@@ -1881,10 +1883,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) | |||
1881 | 1883 | ||
1882 | if (sdpcm_shared.assert_file_addr != 0) { | 1884 | if (sdpcm_shared.assert_file_addr != 0) { |
1883 | str[0] = '\0'; | 1885 | str[0] = '\0'; |
1884 | if ((bcmerror = dhdsdio_membytes(bus, FALSE, | 1886 | bcmerror = dhdsdio_membytes(bus, FALSE, |
1885 | sdpcm_shared.assert_file_addr, | 1887 | sdpcm_shared.assert_file_addr, |
1886 | (uint8 *) str, | 1888 | (uint8 *) str, maxstrlen); |
1887 | maxstrlen)) < 0) | 1889 | if (bcmerror < 0) |
1888 | goto done; | 1890 | goto done; |
1889 | 1891 | ||
1890 | str[maxstrlen - 1] = '\0'; | 1892 | str[maxstrlen - 1] = '\0'; |
@@ -1896,10 +1898,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) | |||
1896 | } | 1898 | } |
1897 | 1899 | ||
1898 | if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) { | 1900 | if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) { |
1899 | if ((bcmerror = dhdsdio_membytes(bus, FALSE, | 1901 | bcmerror = dhdsdio_membytes(bus, FALSE, |
1900 | sdpcm_shared.trap_addr, | 1902 | sdpcm_shared.trap_addr, (uint8 *)&tr, |
1901 | (uint8 *)&tr, | 1903 | sizeof(trap_t)); |
1902 | sizeof(trap_t))) < 0) | 1904 | if (bcmerror < 0) |
1903 | goto done; | 1905 | goto done; |
1904 | 1906 | ||
1905 | bcm_bprintf(&strbuf, | 1907 | bcm_bprintf(&strbuf, |
@@ -1994,15 +1996,16 @@ static int dhdsdio_readconsole(dhd_bus_t *bus) | |||
1994 | 1996 | ||
1995 | /* Read console log struct */ | 1997 | /* Read console log struct */ |
1996 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, log); | 1998 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, log); |
1997 | if ((rv = | 1999 | rv = dhdsdio_membytes(bus, FALSE, addr, (uint8 *)&c->log, |
1998 | dhdsdio_membytes(bus, FALSE, addr, (uint8 *)&c->log, | 2000 | sizeof(c->log)); |
1999 | sizeof(c->log))) < 0) | 2001 | if (rv < 0) |
2000 | return rv; | 2002 | return rv; |
2001 | 2003 | ||
2002 | /* Allocate console buffer (one time only) */ | 2004 | /* Allocate console buffer (one time only) */ |
2003 | if (c->buf == NULL) { | 2005 | if (c->buf == NULL) { |
2004 | c->bufsize = ltoh32(c->log.buf_size); | 2006 | c->bufsize = ltoh32(c->log.buf_size); |
2005 | if ((c->buf = MALLOC(bus->dhd->osh, c->bufsize)) == NULL) | 2007 | c->buf = MALLOC(bus->dhd->osh, c->bufsize); |
2008 | if (c->buf == NULL) | ||
2006 | return BCME_NOMEM; | 2009 | return BCME_NOMEM; |
2007 | } | 2010 | } |
2008 | 2011 | ||
@@ -4654,9 +4657,10 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) | |||
4654 | 4657 | ||
4655 | /* Allocate an appropriate-sized packet */ | 4658 | /* Allocate an appropriate-sized packet */ |
4656 | len = bus->pktgen_len; | 4659 | len = bus->pktgen_len; |
4657 | if (!(pkt = PKTGET(osh, | 4660 | pkt = PKTGET(osh, |
4658 | (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + | 4661 | (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN), |
4659 | DHD_SDALIGN), TRUE))) { | 4662 | TRUE); |
4663 | if (!pkt) { | ||
4660 | DHD_ERROR(("%s: PKTGET failed!\n", __func__)); | 4664 | DHD_ERROR(("%s: PKTGET failed!\n", __func__)); |
4661 | break; | 4665 | break; |
4662 | } | 4666 | } |
@@ -4733,10 +4737,9 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start) | |||
4733 | osl_t *osh = bus->dhd->osh; | 4737 | osl_t *osh = bus->dhd->osh; |
4734 | 4738 | ||
4735 | /* Allocate the packet */ | 4739 | /* Allocate the packet */ |
4736 | if (! | 4740 | pkt = PKTGET(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN, |
4737 | (pkt = | 4741 | TRUE); |
4738 | PKTGET(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN, | 4742 | if (!pkt) { |
4739 | TRUE))) { | ||
4740 | DHD_ERROR(("%s: PKTGET failed!\n", __func__)); | 4743 | DHD_ERROR(("%s: PKTGET failed!\n", __func__)); |
4741 | return; | 4744 | return; |
4742 | } | 4745 | } |
@@ -4979,29 +4982,28 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, uchar *msg, uint msglen) | |||
4979 | /* Zero cbuf_index */ | 4982 | /* Zero cbuf_index */ |
4980 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf_idx); | 4983 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf_idx); |
4981 | val = htol32(0); | 4984 | val = htol32(0); |
4982 | if ((rv = | 4985 | rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, sizeof(val)); |
4983 | dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, | 4986 | if (rv < 0) |
4984 | sizeof(val))) < 0) | ||
4985 | goto done; | 4987 | goto done; |
4986 | 4988 | ||
4987 | /* Write message into cbuf */ | 4989 | /* Write message into cbuf */ |
4988 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf); | 4990 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf); |
4989 | if ((rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)msg, msglen)) < 0) | 4991 | rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)msg, msglen); |
4992 | if (rv < 0) | ||
4990 | goto done; | 4993 | goto done; |
4991 | 4994 | ||
4992 | /* Write length into vcons_in */ | 4995 | /* Write length into vcons_in */ |
4993 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, vcons_in); | 4996 | addr = bus->console_addr + OFFSETOF(hndrte_cons_t, vcons_in); |
4994 | val = htol32(msglen); | 4997 | val = htol32(msglen); |
4995 | if ((rv = | 4998 | rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, sizeof(val)); |
4996 | dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, | 4999 | if (rv < 0) |
4997 | sizeof(val))) < 0) | ||
4998 | goto done; | 5000 | goto done; |
4999 | 5001 | ||
5000 | /* Bump dongle by sending an empty event pkt. | 5002 | /* Bump dongle by sending an empty event pkt. |
5001 | * sdpcm_sendup (RX) checks for virtual console input. | 5003 | * sdpcm_sendup (RX) checks for virtual console input. |
5002 | */ | 5004 | */ |
5003 | if (((pkt = PKTGET(bus->dhd->osh, 4 + SDPCM_RESERVE, TRUE)) != NULL) && | 5005 | pkt = PKTGET(bus->dhd->osh, 4 + SDPCM_RESERVE, TRUE); |
5004 | bus->clkstate == CLK_AVAIL) | 5006 | if ((pkt != NULL) && bus->clkstate == CLK_AVAIL) |
5005 | dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, TRUE); | 5007 | dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, TRUE); |
5006 | 5008 | ||
5007 | done: | 5009 | done: |
@@ -5197,7 +5199,8 @@ static void *dhdsdio_probe(uint16 venid, uint16 devid, uint16 bus_no, | |||
5197 | DHD_INFO(("%s: completed!!\n", __func__)); | 5199 | DHD_INFO(("%s: completed!!\n", __func__)); |
5198 | 5200 | ||
5199 | /* if firmware path present try to download and bring up bus */ | 5201 | /* if firmware path present try to download and bring up bus */ |
5200 | if ((ret = dhd_bus_start(bus->dhd)) != 0) { | 5202 | ret = dhd_bus_start(bus->dhd); |
5203 | if (ret != 0) { | ||
5201 | if (ret == BCME_NOTUP) { | 5204 | if (ret == BCME_NOTUP) { |
5202 | DHD_ERROR(("%s: dongle is not responding\n", __func__)); | 5205 | DHD_ERROR(("%s: dongle is not responding\n", __func__)); |
5203 | goto fail; | 5206 | goto fail; |
@@ -5271,16 +5274,17 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, | |||
5271 | OSL_DELAY(65); | 5274 | OSL_DELAY(65); |
5272 | 5275 | ||
5273 | for (fn = 0; fn <= numfn; fn++) { | 5276 | for (fn = 0; fn <= numfn; fn++) { |
5274 | if (!(cis[fn] = MALLOC(osh, SBSDIO_CIS_SIZE_LIMIT))) { | 5277 | cis[fn] = MALLOC(osh, SBSDIO_CIS_SIZE_LIMIT); |
5278 | if (!cis[fn]) { | ||
5275 | DHD_INFO(("dhdsdio_probe: fn %d cis malloc " | 5279 | DHD_INFO(("dhdsdio_probe: fn %d cis malloc " |
5276 | "failed\n", fn)); | 5280 | "failed\n", fn)); |
5277 | break; | 5281 | break; |
5278 | } | 5282 | } |
5279 | bzero(cis[fn], SBSDIO_CIS_SIZE_LIMIT); | 5283 | bzero(cis[fn], SBSDIO_CIS_SIZE_LIMIT); |
5280 | 5284 | ||
5281 | if ((err = | 5285 | err = bcmsdh_cis_read(sdh, fn, cis[fn], |
5282 | bcmsdh_cis_read(sdh, fn, cis[fn], | 5286 | SBSDIO_CIS_SIZE_LIMIT); |
5283 | SBSDIO_CIS_SIZE_LIMIT))) { | 5287 | if (err) { |
5284 | DHD_INFO(("dhdsdio_probe: fn %d cis read " | 5288 | DHD_INFO(("dhdsdio_probe: fn %d cis read " |
5285 | "err %d\n", fn, err)); | 5289 | "err %d\n", fn, err)); |
5286 | MFREE(osh, cis[fn], SBSDIO_CIS_SIZE_LIMIT); | 5290 | MFREE(osh, cis[fn], SBSDIO_CIS_SIZE_LIMIT); |
@@ -5343,10 +5347,14 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, | |||
5343 | } | 5347 | } |
5344 | 5348 | ||
5345 | /* ...but normally deal with the SDPCMDEV core */ | 5349 | /* ...but normally deal with the SDPCMDEV core */ |
5346 | if (!(bus->regs = si_setcore(bus->sih, PCMCIA_CORE_ID, 0)) && | 5350 | bus->regs = si_setcore(bus->sih, PCMCIA_CORE_ID, 0); |
5347 | !(bus->regs = si_setcore(bus->sih, SDIOD_CORE_ID, 0))) { | 5351 | if (!bus->regs) { |
5348 | DHD_ERROR(("%s: failed to find SDIODEV core!\n", __func__)); | 5352 | bus->regs = si_setcore(bus->sih, SDIOD_CORE_ID, 0); |
5349 | goto fail; | 5353 | if (!bus->regs) { |
5354 | DHD_ERROR(("%s: failed to find SDIODEV core!\n", | ||
5355 | __func__)); | ||
5356 | goto fail; | ||
5357 | } | ||
5350 | } | 5358 | } |
5351 | bus->sdpcmrev = si_corerev(bus->sih); | 5359 | bus->sdpcmrev = si_corerev(bus->sih); |
5352 | 5360 | ||
@@ -5360,7 +5368,8 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, | |||
5360 | 5368 | ||
5361 | /* Set the poll and/or interrupt flags */ | 5369 | /* Set the poll and/or interrupt flags */ |
5362 | bus->intr = (bool) dhd_intr; | 5370 | bus->intr = (bool) dhd_intr; |
5363 | if ((bus->poll = (bool) dhd_poll)) | 5371 | bus->poll = (bool) dhd_poll; |
5372 | if (bus->poll) | ||
5364 | bus->pollrate = 1; | 5373 | bus->pollrate = 1; |
5365 | 5374 | ||
5366 | return TRUE; | 5375 | return TRUE; |