/* Send down the multicast list first. */
buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETHER_ADDR_LEN);
- if (!(bufp = buf = MALLOC(dhd->pub.osh, buflen))) {
+ bufp = buf = MALLOC(dhd->pub.osh, buflen);
+ if (!bufp) {
DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
dhd_ifname(&dhd->pub, ifidx), cnt));
return;
*/
buflen = sizeof("allmulti") + sizeof(allmulti);
- if (!(buf = MALLOC(dhd->pub.osh, buflen))) {
+ buf = MALLOC(dhd->pub.osh, buflen);
+ if (!buf) {
DHD_ERROR(("%s: out of memory for allmulti\n",
dhd_ifname(&dhd->pub, ifidx)));
return;
free_netdev(ifp->net);
}
/* Allocate etherdev, including space for private structure */
- if (!(ifp->net = alloc_etherdev(sizeof(dhd)))) {
+ ifp->net = alloc_etherdev(sizeof(dhd));
+ if (!ifp->net) {
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
ret = -ENOMEM;
}
if (ret == 0) {
strcpy(ifp->net->name, ifp->name);
memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
- if ((err = dhd_net_attach(&dhd->pub, ifp->idx)) != 0) {
+ err = dhd_net_attach(&dhd->pub, ifp->idx);
+ if (err != 0) {
DHD_ERROR(("%s: dhd_net_attach failed, "
"err %d\n",
__func__, err));
dhd->pub.tx_realloc++;
skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen);
dev_kfree_skb(skb);
- if ((skb = skb2) == NULL) {
+ skb = skb2;
+ if (skb == NULL) {
DHD_ERROR(("%s: skb_realloc_headroom failed\n",
dhd_ifname(&dhd->pub, ifidx)));
ret = -ENOMEM;
}
/* Convert to packet */
- if (!(pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb))) {
+ pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb);
+ if (!pktbuf) {
DHD_ERROR(("%s: PKTFRMNATIVE failed\n",
dhd_ifname(&dhd->pub, ifidx)));
dev_kfree_skb_any(skb);
ioc.set = FALSE;
strcpy(buf, "toe_ol");
- if ((ret =
- dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len)) < 0) {
+ ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ if (ret < 0) {
/* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) {
DHD_ERROR(("%s: toe not supported by device\n",
strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(uint32));
- if ((ret =
- dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len)) < 0) {
+ ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ if (ret < 0) {
DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
dhd_ifname(&dhd->pub, ifidx), ret));
return ret;
strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(uint32));
- if ((ret =
- dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len)) < 0) {
+ ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ if (ret < 0) {
DHD_ERROR(("%s: could not set toe: ret=%d\n",
dhd_ifname(&dhd->pub, ifidx), ret));
return ret;
/* Get toe offload components from dongle */
case ETHTOOL_GRXCSUM:
case ETHTOOL_GTXCSUM:
- if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0)
+ ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+ if (ret < 0)
return ret;
csum_dir =
return -EFAULT;
/* Read the current settings, update and write back */
- if ((ret = dhd_toe_get(dhd, 0, &toe_cmpnt)) < 0)
+ ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+ if (ret < 0)
return ret;
csum_dir =
else
toe_cmpnt &= ~csum_dir;
- if ((ret = dhd_toe_set(dhd, 0, toe_cmpnt)) < 0)
+ ret = dhd_toe_set(dhd, 0, toe_cmpnt);
+ if (ret < 0)
return ret;
/* If setting TX checksum mode, tell Linux the new mode */
} else {
*/
{
- if (!(buf = (char *)MALLOC(dhd->pub.osh, buflen))) {
+ buf = (char *)MALLOC(dhd->pub.osh, buflen);
+ if (!buf) {
bcmerror = -BCME_NOMEM;
goto done;
}
if (ifidx == 0) { /* do it only for primary eth0 */
/* try to bring up bus */
- if ((ret = dhd_bus_start(&dhd->pub)) != 0) {
+ ret = dhd_bus_start(&dhd->pub);
+ if (ret != 0) {
DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
return -1;
}
strcpy(nv_path, nvram_path);
/* Allocate etherdev, including space for private structure */
- if (!(net = alloc_etherdev(sizeof(dhd)))) {
+ net = alloc_etherdev(sizeof(dhd));
+ if (!net) {
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
goto fail;
}
/* Allocate primary dhd_info */
- if (!(dhd = MALLOC(osh, sizeof(dhd_info_t)))) {
+ dhd = MALLOC(osh, sizeof(dhd_info_t));
+ if (!dhd) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
goto fail;
}
dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
/* Bring up the bus */
- if ((ret = dhd_bus_init(&dhd->pub, TRUE)) != 0) {
+ ret = dhd_bus_init(&dhd->pub, TRUE);
+ if (ret != 0) {
DHD_ERROR(("%s, dhd_bus_init failed %d\n", __func__, ret));
return ret;
}
#endif /* EMBEDDED_PLATFORM */
/* Bus is ready, do any protocol initialization */
- if ((ret = dhd_prot_init(&dhd->pub)) < 0)
+ ret = dhd_prot_init(&dhd->pub);
+ if (ret < 0)
return ret;
return 0;