* PORT POINT: cannot call this if WQ is statically allocated w/in
* structure since it calls kfree(wq);
*/
- if (pi->wq_port)
- {
+ if (pi->wq_port) {
destroy_workqueue(pi->wq_port); /* this also calls
* flush_workqueue() */
pi->wq_port = NULL;
/* allocate then fill in private data structure */
priv = OS_kmalloc(sizeof(struct c4_priv));
- if (!priv)
- {
+ if (!priv) {
pr_warning("%s: no memory for net_device !\n",
ci->devname);
return NULL;
}
dev = alloc_hdlcdev(priv);
- if (!dev)
- {
+ if (!dev) {
pr_warning("%s: no memory for hdlc_device !\n",
ci->devname);
OS_kfree(priv);
*dev->name = 0; /* default ifconfig name = "hdlc" */
hi = (hdw_info_t *)ci->hdw_info;
- if (hi->mfg_info_sts == EEPROM_OK)
- {
- switch (hi->promfmt)
- {
+ if (hi->mfg_info_sts == EEPROM_OK) {
+ switch (hi->promfmt) {
case PROM_FORMAT_TYPE1:
memcpy(dev->dev_addr,
(FLD_TYPE1 *) (hi->mfg_info.pft1.Serial), 6);
break;
}
} else
- {
memset(dev->dev_addr, 0, 6);
- }
hdlc->xmit = c4_linux_xmit;
/* needed due to Ioctl calling sequence */
rtnl_lock();
- if (ret)
- {
+ if (ret) {
if (cxt1e1_log_level >= LOG_WARN)
pr_info("%s: create_chan[%d] registration error = %d.\n",
ci->devname, cp->channum, ret);
if (!dev)
return -EBUSY;
ret = mkret(c4_new_chan(ci, cp.port, cp.channum, dev));
- if (ret)
- {
+ if (ret) {
/* needed due to Ioctl calling sequence */
rtnl_unlock();
unregister_hdlc_device(dev);
const struct c4_priv *priv;
int i;
- for (i = 0; i < 128; i++)
- {
+ for (i = 0; i < 128; i++) {
struct net_device *ndev;
char buf[sizeof(CHANNAME) + 3];
priv = dev_to_hdlc(ndev)->priv;
if ((unsigned long) (priv->ci) ==
- (unsigned long) (netdev_priv(musycc_dev)))
- {
+ (unsigned long) (netdev_priv(musycc_dev))) {
ndev->flags &= ~IFF_UP;
netif_stop_queue(ndev);
do_deluser(ndev, 1);
void *data;
int iocmd, iolen;
status_t ret;
- static struct data
- {
- union
- {
+ static struct data {
+ union {
u_int8_t c;
u_int32_t i;
struct sbe_brd_info bip;
return -EFAULT;
ret = 0;
- switch (iocmd)
- {
+ switch (iocmd) {
case SBE_IOC_PORT_GET:
//pr_info(">> SBE_IOC_PORT_GET Ioctl...\n");
ret = do_get_port(ndev, data);
ci_t *ci;
ndev = alloc_netdev(sizeof(ci_t), SBE_IFACETMPL, c4_setup);
- if (!ndev)
- {
+ if (!ndev) {
pr_warning("%s: no memory for struct net_device !\n",
hi->devname);
error_flag = ENOMEM;
if (register_netdev(ndev) ||
- (c4_init(ci, (u_char *) f0, (u_char *) f1) != SBE_DRVR_SUCCESS))
- {
+ (c4_init(ci, (u_char *) f0, (u_char *) f1) != SBE_DRVR_SUCCESS)) {
OS_kfree(netdev_priv(ndev));
OS_kfree(ndev);
error_flag = ENODEV;
if (request_irq(irq0, &c4_linux_interrupt,
IRQF_SHARED,
- ndev->name, ndev))
- {
+ ndev->name, ndev)) {
pr_warning("%s: MUSYCC could not get irq: %d\n",
ndev->name, irq0);
unregister_netdev(ndev);
return NULL;
}
#ifdef CONFIG_SBE_PMCC4_NCOMM
- if (request_irq(irq1, &c4_ebus_interrupt, IRQF_SHARED, ndev->name, ndev))
- {
+ if (request_irq(irq1, &c4_ebus_interrupt, IRQF_SHARED, ndev->name, ndev)) {
pr_warning("%s: EBUS could not get irq: %d\n", hi->devname, irq1);
unregister_netdev(ndev);
free_irq(irq0, ndev);
/* also sets PROM format type (promfmt) for later usage */
hdw_sn_get(hi, brdno);
- switch (hi->promfmt)
- {
+ switch (hi->promfmt) {
case PROM_FORMAT_TYPE1:
memcpy(ndev->dev_addr,
(FLD_TYPE1 *) (hi->mfg_info.pft1.Serial), 6);
if (cxt1e1_max_mtu != max_mtu_default)
pr_info("NOTE: driver parameter <cxt1e1_max_mtu> changed from default %d to %d.\n",
max_mtu_default, cxt1e1_max_mtu);
- if (max_rxdesc_used != max_rxdesc_default)
- {
+ if (max_rxdesc_used != max_rxdesc_default) {
if (max_rxdesc_used > 2000)
max_rxdesc_used = 2000; /* out-of-bounds reset */
pr_info("NOTE: driver parameter <max_rxdesc_used> changed from default %d to %d.\n",
max_rxdesc_default, max_rxdesc_used);
}
- if (max_txdesc_used != max_txdesc_default)
- {
+ if (max_txdesc_used != max_txdesc_default) {
if (max_txdesc_used > 1000)
max_txdesc_used = 1000; /* out-of-bounds reset */
pr_info("NOTE: driver parameter <max_txdesc_used> changed from default %d to %d.\n",
struct net_device *ndev;
int i, j, k;
- for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++)
- {
- if (hi->ndev) /* a board has been attached */
- {
+ for (i = 0, hi = hdw_info; i < MAX_BOARDS; i++, hi++) {
+ if (hi->ndev) { /* a board has been attached */
ci = (ci_t *)(netdev_priv(hi->ndev));
for (j = 0; j < ci->max_port; j++)
for (k = 0; k < MUSYCC_NCHANS; k++) {
ndev = ci->port[j].chan[k]->user;
if (ndev)
- {
do_deluser(ndev, 0);
- }
}
}
}