}
#endif /* defined(OOB_INTR_ONLY) */
/* allocate SDIO Host Controller state info */
- if (!(osh = osl_attach(dev, PCI_BUS, FALSE))) {
+ osh = osl_attach(dev, PCI_BUS, FALSE);
+ if (!osh) {
SDLX_MSG(("%s: osl_attach failed\n", __func__));
goto err;
}
- if (!(sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t)))) {
+ sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t));
+ if (!sdhc) {
SDLX_MSG(("%s: out of memory, allocated %d bytes\n",
__func__, MALLOCED(osh)));
goto err;
sdhc->dev = (void *)dev;
#ifdef BCMLXSDMMC
- if (!(sdh = bcmsdh_attach(osh, (void *)0,
- (void **)®s, irq))) {
+ sdh = bcmsdh_attach(osh, (void *)0, (void **)®s, irq);
+ if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
#else
- if (!(sdh = bcmsdh_attach(osh, (void *)r->start,
- (void **)®s, irq))) {
+ sdh = bcmsdh_attach(osh, (void *)r->start, (void **)®s, irq);
+ if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
vendevid = bcmsdh_query_device(sdh);
/* try to attach to the target device */
- if (!(sdhc->ch = drvinfo.attach((vendevid >> 16),
- (vendevid & 0xFFFF), 0, 0, 0, 0,
- (void *)regs, NULL, sdh))) {
+ sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
+ 0, 0, 0, 0, (void *)regs, NULL, sdh);
+ if (!sdhc->ch) {
SDLX_MSG(("%s: device attach failed\n", __func__));
goto err;
}
SDLX_MSG(("%s: Disabling TI FlashMedia Controller.\n",
__func__));
- if (!(osh = osl_attach(pdev, PCI_BUS, FALSE))) {
+ osh = osl_attach(pdev, PCI_BUS, FALSE);
+ if (!osh) {
SDLX_MSG(("%s: osl_attach failed\n", __func__));
goto err;
}
*/
/* allocate SDIO Host Controller state info */
- if (!(osh = osl_attach(pdev, PCI_BUS, FALSE))) {
+ osh = osl_attach(pdev, PCI_BUS, FALSE);
+ if (!osh) {
SDLX_MSG(("%s: osl_attach failed\n", __func__));
goto err;
}
- if (!(sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t)))) {
+ sdhc = MALLOC(osh, sizeof(bcmsdh_hc_t));
+ if (!sdhc) {
SDLX_MSG(("%s: out of memory, allocated %d bytes\n",
__func__, MALLOCED(osh)));
goto err;
SDLX_MSG(("%s: Cannot enable PCI device\n", __func__));
goto err;
}
- if (!
- (sdh =
- bcmsdh_attach(osh, (void *)(uintptr) pci_resource_start(pdev, 0),
- (void **)®s, pdev->irq))) {
+ sdh = bcmsdh_attach(osh, (void *)(uintptr) pci_resource_start(pdev, 0),
+ (void **)®s, pdev->irq);
+ if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
sdhc->sdh = sdh;
/* try to attach to the target device */
- if (!(sdhc->ch = drvinfo.attach(VENDOR_BROADCOM, /* pdev->vendor, */
- bcmsdh_query_device(sdh) & 0xFFFF, 0, 0,
- 0, 0, (void *)regs, NULL, sdh))) {
+ sdhc->ch = drvinfo.attach(VENDOR_BROADCOM, /* pdev->vendor, */
+ bcmsdh_query_device(sdh) & 0xFFFF, 0, 0, 0, 0,
+ (void *)regs, NULL, sdh);
+ if (!sdhc->ch) {
SDLX_MSG(("%s: device attach failed\n", __func__));
goto err;
}
#endif /* defined(BCMPLATFORM_BUS) */
#if !defined(BCMPLATFORM_BUS) && !defined(BCMLXSDMMC)
- if (!(error = pci_register_driver(&bcmsdh_pci_driver)))
+ error = pci_register_driver(&bcmsdh_pci_driver);
+ if (!error)
return 0;
SDLX_MSG(("%s: pci_module_init failed 0x%x\n", __func__, error));
char *arg_save = 0, *arg_org = 0;
#define BUF_SIZE 2048
- if (!(arg_save = MALLOC(dhd->osh, strlen(arg) + 1))) {
+ arg_save = MALLOC(dhd->osh, strlen(arg) + 1);
+ if (!arg_save) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
arg_org = arg_save;
- if (!(buf = MALLOC(dhd->osh, BUF_SIZE))) {
+ buf = MALLOC(dhd->osh, BUF_SIZE);
+ if (!buf) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
}
/* Disable pfn */
iov_len =
bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf, sizeof(iovbuf));
- if ((ret =
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf))) >= 0) {
+ ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ if (ret >= 0) {
/* clear pfn */
iov_len = bcm_mkiovar("pfnclear", 0, 0, iovbuf, sizeof(iovbuf));
if (iov_len) {
- if ((ret =
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- iov_len)) < 0) {
+ ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ iov_len);
+ if (ret < 0) {
DHD_ERROR(("%s failed code %d\n", __func__,
ret));
}
}
/* Enable/disable PNO */
- if ((ret =
- bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
- sizeof(iovbuf))) > 0) {
- if ((ret =
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf))) < 0) {
+ ret = bcm_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
+ sizeof(iovbuf));
+ if (ret > 0) {
+ ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ sizeof(iovbuf));
+ if (ret < 0) {
DHD_ERROR(("%s failed for error=%d\n", __func__, ret));
return ret;
} else {
#endif /* PNO_DUMP */
/* clean up everything */
- if ((err = dhd_pno_clean(dhd)) < 0) {
+ err = dhd_pno_clean(dhd);
+ if (err < 0) {
DHD_ERROR(("%s failed error=%d\n", __func__, err));
return err;
}
ssids_local[i].SSID_len);
pfn_element.ssid.SSID_len = ssids_local[i].SSID_len;
- if ((err =
- bcm_mkiovar("pfn_add", (char *)&pfn_element,
- sizeof(pfn_element), iovbuf,
- sizeof(iovbuf))) > 0) {
- if ((err =
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf))) < 0) {
+ err = bcm_mkiovar("pfn_add", (char *)&pfn_element,
+ sizeof(pfn_element), iovbuf, sizeof(iovbuf));
+ if (err > 0) {
+ err = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ sizeof(iovbuf));
+ if (err < 0) {
DHD_ERROR(("%s failed for i=%d error=%d\n",
__func__, i, err));
return err;