#endif /*** CONFIG_SBE_WAN256T3_NCOMM ***/
{
- if ((m2 = OS_mem_token_alloc(cxt1e1_max_mru))) {
- /* substitute the mbuf+cluster */
- md->mem_token = m2;
- md->data = cpu_to_le32(OS_vtophys(OS_mem_token_data(m2)));
-
- /* pass the received mbuf upward */
- sd_recv_consume(m, status & LENGTH_MASK, ch->user);
- ch->s.rx_packets++;
- ch->s.rx_bytes += status & LENGTH_MASK;
+ m2 = OS_mem_token_alloc(cxt1e1_max_mru);
+ if (m2) {
+ /* substitute the mbuf+cluster */
+ md->mem_token = m2;
+ md->data = cpu_to_le32(OS_vtophys(
+ OS_mem_token_data(m2)));
+
+ /* pass the received mbuf upward */
+ sd_recv_consume(m, status & LENGTH_MASK, ch->user);
+ ch->s.rx_packets++;
+ ch->s.rx_bytes += status & LENGTH_MASK;
} else
- ch->s.rx_dropped++;
+ ch->s.rx_dropped++;
}
} else if (error == ERR_FCS)
ch->s.rx_crc_errors++;
for (portnum = 0; portnum < ci->max_port; portnum++)
for (gchan = 0; gchan < MUSYCC_NCHANS; gchan++)
{
- if ((ch = ci->port[portnum].chan[gchan]))
- {
- if ((ch->state != UNASSIGNED) &&
- (ch->channum == channum))
- return ch;
- }
+ ch = ci->port[portnum].chan[gchan];
+ if (ch) {
+ if ((ch->state != UNASSIGNED) &&
+ (ch->channum == channum))
+ return ch;
+ }
}
return NULL;
}
status_t ret;
/* PORT POINT: this routine generates first interrupt */
- if ((ret = musycc_init (ci)) != SBE_DRVR_SUCCESS)
- return ret;
+ ret = musycc_init(ci);
+ if (ret != SBE_DRVR_SUCCESS)
+ return ret;
#if 0
ci->p.framing_type = FRAMING_CBP;
{
status_t ret;
- if ((ret = c4_wq_port_init (pi))) /* create/init
- * workqueue_struct */
- return ret;
+ ret = c4_wq_port_init(pi);
+ if (ret) /* create/init workqueue_struct */
+ return ret;
}
init_comet (ci, pi->cometbase, pp->port_mode, 1 /* clockmaster == true */ , pp->portP);
{
status_t ret;
- if ((ret = c4_wk_chan_init (pi, ch)))
- return ret;
+ ret = c4_wk_chan_init(pi, ch);
+ if (ret)
+ return ret;
}
/* save off interface assignments which bound a board */
{
mch_t *ch;
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
if (ch->state == UP)
musycc_chan_down ((ci_t *) 0, channum);
ch->state = UNASSIGNED;
{
mch_t *ch;
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
memset (&ch->s, 0, sizeof (struct sbecom_chan_stats));
return 0;
mch_t *ch;
int i, x = 0;
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
#if 1
if (ch->p.card != p->card ||
{
status_t ret;
- if ((ret = musycc_chan_down ((ci_t *) 0, channum)))
- return ret;
- if ((ret = c4_chan_up (ch->up->up, channum)))
- return ret;
+ ret = musycc_chan_down((ci_t *)0, channum);
+ if (ret)
+ return ret;
+ ret = c4_chan_up(ch->up->up, channum);
+ if (ret)
+ return ret;
sd_enable_xmit (ch->user); /* re-enable to catch flow controlled
* channel */
}
{
mch_t *ch;
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
*p = ch->p;
return 0;
}
{
mch_t *ch;
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
*p = ch->s;
p->tx_pending = atomic_read (&ch->tx_pending);
return 0;
u_int32_t tmp; /* for optimizing conversion across BE
* platform */
- if (!(ch = c4_find_chan (channum)))
- return ENOENT;
+ ch = c4_find_chan(channum);
+ if (!ch)
+ return -ENOENT;
if (ch->state == UP)
{
if (cxt1e1_log_level >= LOG_MONITOR)
}
md->next = cpu_to_le32 (OS_vtophys (md->snext));
- if (!(m = OS_mem_token_alloc (cxt1e1_max_mru)))
- {
- if (cxt1e1_log_level >= LOG_MONITOR)
- pr_info("%s: c4_chan_up[%d] - token alloc failure, size = %d.\n",
- ci->devname, channum, cxt1e1_max_mru);
- goto errfree;
+ m = OS_mem_token_alloc(cxt1e1_max_mru);
+ if (!m) {
+ if (cxt1e1_log_level >= LOG_MONITOR)
+ pr_info(
+ "%s: c4_chan_up[%d] - token alloc failure, size = %d.\n",
+ ci->devname, channum, cxt1e1_max_mru);
+ goto errfree;
}
md->mem_token = m;
md->data = cpu_to_le32 (OS_vtophys (OS_mem_token_data (m)));
struct net_device *dev;
char *np;
- if (!(dev = getuserbychan (iip->channum)))
- return ENOENT;
+ dev = getuserbychan(iip->channum);
+ if (!dev)
+ return -ENOENT;
np = dev->name;
strncpy (iip->iname, np, CHNM_STRLEN - 1);