提交 9b890325 编写于 作者: J Jason Cooper 提交者: Greg Kroah-Hartman

staging: brcm80211: fix checkpatch error 'assignment in if condition'

Signed-off-by: NJason Cooper <jason@lakedaemon.net>
Acked-by: NHenry Ptasinski <henryp@broadcom.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a618cc28
...@@ -1241,7 +1241,8 @@ int dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen) ...@@ -1241,7 +1241,8 @@ int dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen)
/* Add alignment padding (optional for ctl frames) */ /* Add alignment padding (optional for ctl frames) */
if (dhd_alignctl) { if (dhd_alignctl) {
if ((doff = ((uintptr) frame % DHD_SDALIGN))) { doff = ((uintptr) frame % DHD_SDALIGN);
if (doff) {
frame -= doff; frame -= doff;
len += doff; len += doff;
msglen += doff; msglen += doff;
...@@ -1758,9 +1759,8 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh) ...@@ -1758,9 +1759,8 @@ static int dhdsdio_readshared(dhd_bus_t *bus, sdpcm_shared_t *sh)
/* Read last word in memory to determine address of /* Read last word in memory to determine address of
sdpcm_shared structure */ sdpcm_shared structure */
if ((rv = rv = dhdsdio_membytes(bus, FALSE, bus->ramsize - 4, (uint8 *)&addr, 4);
dhdsdio_membytes(bus, FALSE, bus->ramsize - 4, (uint8 *)&addr, if (rv < 0)
4)) < 0)
return rv; return rv;
addr = ltoh32(addr); addr = ltoh32(addr);
...@@ -1831,13 +1831,15 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) ...@@ -1831,13 +1831,15 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
} }
} }
if ((str = MALLOC(bus->dhd->osh, maxstrlen)) == NULL) { str = MALLOC(bus->dhd->osh, maxstrlen);
if (str == NULL) {
DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__, maxstrlen)); DHD_ERROR(("%s: MALLOC(%d) failed\n", __func__, maxstrlen));
bcmerror = BCME_NOMEM; bcmerror = BCME_NOMEM;
goto done; goto done;
} }
if ((bcmerror = dhdsdio_readshared(bus, &sdpcm_shared)) < 0) bcmerror = dhdsdio_readshared(bus, &sdpcm_shared);
if (bcmerror < 0)
goto done; goto done;
bcm_binit(&strbuf, data, size); bcm_binit(&strbuf, data, size);
...@@ -1869,10 +1871,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) ...@@ -1869,10 +1871,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
bcm_bprintf(&strbuf, "Dongle assert"); bcm_bprintf(&strbuf, "Dongle assert");
if (sdpcm_shared.assert_exp_addr != 0) { if (sdpcm_shared.assert_exp_addr != 0) {
str[0] = '\0'; str[0] = '\0';
if ((bcmerror = dhdsdio_membytes(bus, FALSE, bcmerror = dhdsdio_membytes(bus, FALSE,
sdpcm_shared.assert_exp_addr, sdpcm_shared.assert_exp_addr,
(uint8 *) str, (uint8 *) str, maxstrlen);
maxstrlen)) < 0) if (bcmerror < 0)
goto done; goto done;
str[maxstrlen - 1] = '\0'; str[maxstrlen - 1] = '\0';
...@@ -1881,10 +1883,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) ...@@ -1881,10 +1883,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
if (sdpcm_shared.assert_file_addr != 0) { if (sdpcm_shared.assert_file_addr != 0) {
str[0] = '\0'; str[0] = '\0';
if ((bcmerror = dhdsdio_membytes(bus, FALSE, bcmerror = dhdsdio_membytes(bus, FALSE,
sdpcm_shared.assert_file_addr, sdpcm_shared.assert_file_addr,
(uint8 *) str, (uint8 *) str, maxstrlen);
maxstrlen)) < 0) if (bcmerror < 0)
goto done; goto done;
str[maxstrlen - 1] = '\0'; str[maxstrlen - 1] = '\0';
...@@ -1896,10 +1898,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size) ...@@ -1896,10 +1898,10 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, uint8 *data, uint size)
} }
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) { if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
if ((bcmerror = dhdsdio_membytes(bus, FALSE, bcmerror = dhdsdio_membytes(bus, FALSE,
sdpcm_shared.trap_addr, sdpcm_shared.trap_addr, (uint8 *)&tr,
(uint8 *)&tr, sizeof(trap_t));
sizeof(trap_t))) < 0) if (bcmerror < 0)
goto done; goto done;
bcm_bprintf(&strbuf, bcm_bprintf(&strbuf,
...@@ -1994,15 +1996,16 @@ static int dhdsdio_readconsole(dhd_bus_t *bus) ...@@ -1994,15 +1996,16 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
/* Read console log struct */ /* Read console log struct */
addr = bus->console_addr + OFFSETOF(hndrte_cons_t, log); addr = bus->console_addr + OFFSETOF(hndrte_cons_t, log);
if ((rv = rv = dhdsdio_membytes(bus, FALSE, addr, (uint8 *)&c->log,
dhdsdio_membytes(bus, FALSE, addr, (uint8 *)&c->log, sizeof(c->log));
sizeof(c->log))) < 0) if (rv < 0)
return rv; return rv;
/* Allocate console buffer (one time only) */ /* Allocate console buffer (one time only) */
if (c->buf == NULL) { if (c->buf == NULL) {
c->bufsize = ltoh32(c->log.buf_size); c->bufsize = ltoh32(c->log.buf_size);
if ((c->buf = MALLOC(bus->dhd->osh, c->bufsize)) == NULL) c->buf = MALLOC(bus->dhd->osh, c->bufsize);
if (c->buf == NULL)
return BCME_NOMEM; return BCME_NOMEM;
} }
...@@ -4654,9 +4657,10 @@ static void dhdsdio_pktgen(dhd_bus_t *bus) ...@@ -4654,9 +4657,10 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
/* Allocate an appropriate-sized packet */ /* Allocate an appropriate-sized packet */
len = bus->pktgen_len; len = bus->pktgen_len;
if (!(pkt = PKTGET(osh, pkt = PKTGET(osh,
(len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN),
DHD_SDALIGN), TRUE))) { TRUE);
if (!pkt) {
DHD_ERROR(("%s: PKTGET failed!\n", __func__)); DHD_ERROR(("%s: PKTGET failed!\n", __func__));
break; break;
} }
...@@ -4733,10 +4737,9 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start) ...@@ -4733,10 +4737,9 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start)
osl_t *osh = bus->dhd->osh; osl_t *osh = bus->dhd->osh;
/* Allocate the packet */ /* Allocate the packet */
if (! pkt = PKTGET(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN,
(pkt = TRUE);
PKTGET(osh, SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN, if (!pkt) {
TRUE))) {
DHD_ERROR(("%s: PKTGET failed!\n", __func__)); DHD_ERROR(("%s: PKTGET failed!\n", __func__));
return; return;
} }
...@@ -4979,29 +4982,28 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, uchar *msg, uint msglen) ...@@ -4979,29 +4982,28 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, uchar *msg, uint msglen)
/* Zero cbuf_index */ /* Zero cbuf_index */
addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf_idx); addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf_idx);
val = htol32(0); val = htol32(0);
if ((rv = rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, sizeof(val));
dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, if (rv < 0)
sizeof(val))) < 0)
goto done; goto done;
/* Write message into cbuf */ /* Write message into cbuf */
addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf); addr = bus->console_addr + OFFSETOF(hndrte_cons_t, cbuf);
if ((rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)msg, msglen)) < 0) rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)msg, msglen);
if (rv < 0)
goto done; goto done;
/* Write length into vcons_in */ /* Write length into vcons_in */
addr = bus->console_addr + OFFSETOF(hndrte_cons_t, vcons_in); addr = bus->console_addr + OFFSETOF(hndrte_cons_t, vcons_in);
val = htol32(msglen); val = htol32(msglen);
if ((rv = rv = dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, sizeof(val));
dhdsdio_membytes(bus, TRUE, addr, (uint8 *)&val, if (rv < 0)
sizeof(val))) < 0)
goto done; goto done;
/* Bump dongle by sending an empty event pkt. /* Bump dongle by sending an empty event pkt.
* sdpcm_sendup (RX) checks for virtual console input. * sdpcm_sendup (RX) checks for virtual console input.
*/ */
if (((pkt = PKTGET(bus->dhd->osh, 4 + SDPCM_RESERVE, TRUE)) != NULL) && pkt = PKTGET(bus->dhd->osh, 4 + SDPCM_RESERVE, TRUE);
bus->clkstate == CLK_AVAIL) if ((pkt != NULL) && bus->clkstate == CLK_AVAIL)
dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, TRUE); dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, TRUE);
done: done:
...@@ -5197,7 +5199,8 @@ static void *dhdsdio_probe(uint16 venid, uint16 devid, uint16 bus_no, ...@@ -5197,7 +5199,8 @@ static void *dhdsdio_probe(uint16 venid, uint16 devid, uint16 bus_no,
DHD_INFO(("%s: completed!!\n", __func__)); DHD_INFO(("%s: completed!!\n", __func__));
/* if firmware path present try to download and bring up bus */ /* if firmware path present try to download and bring up bus */
if ((ret = dhd_bus_start(bus->dhd)) != 0) { ret = dhd_bus_start(bus->dhd);
if (ret != 0) {
if (ret == BCME_NOTUP) { if (ret == BCME_NOTUP) {
DHD_ERROR(("%s: dongle is not responding\n", __func__)); DHD_ERROR(("%s: dongle is not responding\n", __func__));
goto fail; goto fail;
...@@ -5271,16 +5274,17 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, ...@@ -5271,16 +5274,17 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
OSL_DELAY(65); OSL_DELAY(65);
for (fn = 0; fn <= numfn; fn++) { for (fn = 0; fn <= numfn; fn++) {
if (!(cis[fn] = MALLOC(osh, SBSDIO_CIS_SIZE_LIMIT))) { cis[fn] = MALLOC(osh, SBSDIO_CIS_SIZE_LIMIT);
if (!cis[fn]) {
DHD_INFO(("dhdsdio_probe: fn %d cis malloc " DHD_INFO(("dhdsdio_probe: fn %d cis malloc "
"failed\n", fn)); "failed\n", fn));
break; break;
} }
bzero(cis[fn], SBSDIO_CIS_SIZE_LIMIT); bzero(cis[fn], SBSDIO_CIS_SIZE_LIMIT);
if ((err = err = bcmsdh_cis_read(sdh, fn, cis[fn],
bcmsdh_cis_read(sdh, fn, cis[fn], SBSDIO_CIS_SIZE_LIMIT);
SBSDIO_CIS_SIZE_LIMIT))) { if (err) {
DHD_INFO(("dhdsdio_probe: fn %d cis read " DHD_INFO(("dhdsdio_probe: fn %d cis read "
"err %d\n", fn, err)); "err %d\n", fn, err));
MFREE(osh, cis[fn], SBSDIO_CIS_SIZE_LIMIT); 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,10 +5347,14 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
} }
/* ...but normally deal with the SDPCMDEV core */ /* ...but normally deal with the SDPCMDEV core */
if (!(bus->regs = si_setcore(bus->sih, PCMCIA_CORE_ID, 0)) && bus->regs = si_setcore(bus->sih, PCMCIA_CORE_ID, 0);
!(bus->regs = si_setcore(bus->sih, SDIOD_CORE_ID, 0))) { if (!bus->regs) {
DHD_ERROR(("%s: failed to find SDIODEV core!\n", __func__)); bus->regs = si_setcore(bus->sih, SDIOD_CORE_ID, 0);
goto fail; if (!bus->regs) {
DHD_ERROR(("%s: failed to find SDIODEV core!\n",
__func__));
goto fail;
}
} }
bus->sdpcmrev = si_corerev(bus->sih); bus->sdpcmrev = si_corerev(bus->sih);
...@@ -5360,7 +5368,8 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva, ...@@ -5360,7 +5368,8 @@ dhdsdio_probe_attach(struct dhd_bus *bus, osl_t *osh, void *sdh, void *regsva,
/* Set the poll and/or interrupt flags */ /* Set the poll and/or interrupt flags */
bus->intr = (bool) dhd_intr; bus->intr = (bool) dhd_intr;
if ((bus->poll = (bool) dhd_poll)) bus->poll = (bool) dhd_poll;
if (bus->poll)
bus->pollrate = 1; bus->pollrate = 1;
return TRUE; return TRUE;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册