Commit ac937e1f authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

wan: sbni: Avoid comma separated statements

Use semicolons and braces.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d59079f
...@@ -260,11 +260,12 @@ static int __init sbni_init(struct net_device *dev) ...@@ -260,11 +260,12 @@ static int __init sbni_init(struct net_device *dev)
return sbni_isa_probe( dev ); return sbni_isa_probe( dev );
/* otherwise we have to perform search our adapter */ /* otherwise we have to perform search our adapter */
if( io[ num ] != -1 ) if( io[ num ] != -1 ) {
dev->base_addr = io[ num ], dev->base_addr = io[ num ];
dev->irq = irq[ num ]; dev->irq = irq[ num ];
else if( scandone || io[ 0 ] != -1 ) } else if( scandone || io[ 0 ] != -1 ) {
return -ENODEV; return -ENODEV;
}
/* if io[ num ] contains non-zero address, then that is on ISA bus */ /* if io[ num ] contains non-zero address, then that is on ISA bus */
if( dev->base_addr ) if( dev->base_addr )
...@@ -399,12 +400,13 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) ...@@ -399,12 +400,13 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
nl->maxframe = DEFAULT_FRAME_LEN; nl->maxframe = DEFAULT_FRAME_LEN;
nl->csr1.rate = baud[ num ]; nl->csr1.rate = baud[ num ];
if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) if( (nl->cur_rxl_index = rxl[ num ]) == -1 ) {
/* autotune rxl */ /* autotune rxl */
nl->cur_rxl_index = DEF_RXL, nl->cur_rxl_index = DEF_RXL;
nl->delta_rxl = DEF_RXL_DELTA; nl->delta_rxl = DEF_RXL_DELTA;
else } else {
nl->delta_rxl = 0; nl->delta_rxl = 0;
}
nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ];
if( inb( ioaddr + CSR0 ) & 0x01 ) if( inb( ioaddr + CSR0 ) & 0x01 )
nl->state |= FL_SLOW_MODE; nl->state |= FL_SLOW_MODE;
...@@ -512,13 +514,15 @@ sbni_interrupt( int irq, void *dev_id ) ...@@ -512,13 +514,15 @@ sbni_interrupt( int irq, void *dev_id )
do { do {
repeat = 0; repeat = 0;
if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) if( inb( dev->base_addr + CSR0 ) & (RC_RDY | TR_RDY) ) {
handle_channel( dev ), handle_channel( dev );
repeat = 1; repeat = 1;
}
if( nl->second && /* second channel present */ if( nl->second && /* second channel present */
(inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) (inb( nl->second->base_addr+CSR0 ) & (RC_RDY | TR_RDY)) ) {
handle_channel( nl->second ), handle_channel( nl->second );
repeat = 1; repeat = 1;
}
} while( repeat ); } while( repeat );
if( nl->second ) if( nl->second )
...@@ -610,11 +614,12 @@ recv_frame( struct net_device *dev ) ...@@ -610,11 +614,12 @@ recv_frame( struct net_device *dev )
nl->state |= FL_PREV_OK; nl->state |= FL_PREV_OK;
if( framelen > 4 ) if( framelen > 4 )
nl->in_stats.all_rx_number++; nl->in_stats.all_rx_number++;
} else } else {
nl->state &= ~FL_PREV_OK, nl->state &= ~FL_PREV_OK;
change_level( dev ), change_level( dev );
nl->in_stats.all_rx_number++, nl->in_stats.all_rx_number++;
nl->in_stats.bad_rx_number++; nl->in_stats.bad_rx_number++;
}
return !frame_ok || framelen > 4; return !frame_ok || framelen > 4;
} }
...@@ -689,9 +694,10 @@ download_data( struct net_device *dev, u32 *crc_p ) ...@@ -689,9 +694,10 @@ download_data( struct net_device *dev, u32 *crc_p )
*crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len ); *crc_p = calc_crc32( *crc_p, skb->data + nl->outpos, len );
/* if packet too short we should write some more bytes to pad */ /* if packet too short we should write some more bytes to pad */
for( len = nl->framelen - len; len--; ) for( len = nl->framelen - len; len--; ) {
outb( 0, dev->base_addr + DAT ), outb( 0, dev->base_addr + DAT );
*crc_p = CRC32( 0, *crc_p ); *crc_p = CRC32( 0, *crc_p );
}
} }
...@@ -703,9 +709,10 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, ...@@ -703,9 +709,10 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
int frame_ok; int frame_ok;
if( is_first ) if( is_first ) {
nl->wait_frameno = frameno, nl->wait_frameno = frameno;
nl->inppos = 0; nl->inppos = 0;
}
if( nl->wait_frameno == frameno ) { if( nl->wait_frameno == frameno ) {
...@@ -717,33 +724,35 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno, ...@@ -717,33 +724,35 @@ upload_data( struct net_device *dev, unsigned framelen, unsigned frameno,
* error was occurred... drop entire packet * error was occurred... drop entire packet
*/ */
else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc )) else if( (frame_ok = skip_tail( dev->base_addr, framelen, crc ))
!= 0 ) != 0 ) {
nl->wait_frameno = 0, nl->wait_frameno = 0;
nl->inppos = 0, nl->inppos = 0;
#ifdef CONFIG_SBNI_MULTILINE #ifdef CONFIG_SBNI_MULTILINE
nl->master->stats.rx_errors++, nl->master->stats.rx_errors++;
nl->master->stats.rx_missed_errors++; nl->master->stats.rx_missed_errors++;
#else #else
dev->stats.rx_errors++, dev->stats.rx_errors++;
dev->stats.rx_missed_errors++; dev->stats.rx_missed_errors++;
#endif #endif
}
/* now skip all frames until is_first != 0 */ /* now skip all frames until is_first != 0 */
} else } else
frame_ok = skip_tail( dev->base_addr, framelen, crc ); frame_ok = skip_tail( dev->base_addr, framelen, crc );
if( is_first && !frame_ok ) if( is_first && !frame_ok ) {
/* /*
* Frame has been broken, but we had already stored * Frame has been broken, but we had already stored
* is_first... Drop entire packet. * is_first... Drop entire packet.
*/ */
nl->wait_frameno = 0, nl->wait_frameno = 0;
#ifdef CONFIG_SBNI_MULTILINE #ifdef CONFIG_SBNI_MULTILINE
nl->master->stats.rx_errors++, nl->master->stats.rx_errors++;
nl->master->stats.rx_crc_errors++; nl->master->stats.rx_crc_errors++;
#else #else
dev->stats.rx_errors++, dev->stats.rx_errors++;
dev->stats.rx_crc_errors++; dev->stats.rx_crc_errors++;
#endif #endif
}
return frame_ok; return frame_ok;
} }
...@@ -782,12 +791,12 @@ interpret_ack( struct net_device *dev, unsigned ack ) ...@@ -782,12 +791,12 @@ interpret_ack( struct net_device *dev, unsigned ack )
if( nl->state & FL_WAIT_ACK ) { if( nl->state & FL_WAIT_ACK ) {
nl->outpos += nl->framelen; nl->outpos += nl->framelen;
if( --nl->tx_frameno ) if( --nl->tx_frameno ) {
nl->framelen = min_t(unsigned int, nl->framelen = min_t(unsigned int,
nl->maxframe, nl->maxframe,
nl->tx_buf_p->len - nl->outpos); nl->tx_buf_p->len - nl->outpos);
else } else {
send_complete( dev ), send_complete( dev );
#ifdef CONFIG_SBNI_MULTILINE #ifdef CONFIG_SBNI_MULTILINE
netif_wake_queue( nl->master ); netif_wake_queue( nl->master );
#else #else
...@@ -795,6 +804,7 @@ interpret_ack( struct net_device *dev, unsigned ack ) ...@@ -795,6 +804,7 @@ interpret_ack( struct net_device *dev, unsigned ack )
#endif #endif
} }
} }
}
nl->state &= ~FL_WAIT_ACK; nl->state &= ~FL_WAIT_ACK;
} }
...@@ -872,16 +882,17 @@ drop_xmit_queue( struct net_device *dev ) ...@@ -872,16 +882,17 @@ drop_xmit_queue( struct net_device *dev )
{ {
struct net_local *nl = netdev_priv(dev); struct net_local *nl = netdev_priv(dev);
if( nl->tx_buf_p ) if( nl->tx_buf_p ) {
dev_kfree_skb_any( nl->tx_buf_p ), dev_kfree_skb_any( nl->tx_buf_p );
nl->tx_buf_p = NULL, nl->tx_buf_p = NULL;
#ifdef CONFIG_SBNI_MULTILINE #ifdef CONFIG_SBNI_MULTILINE
nl->master->stats.tx_errors++, nl->master->stats.tx_errors++;
nl->master->stats.tx_carrier_errors++; nl->master->stats.tx_carrier_errors++;
#else #else
dev->stats.tx_errors++, dev->stats.tx_errors++;
dev->stats.tx_carrier_errors++; dev->stats.tx_carrier_errors++;
#endif #endif
}
nl->tx_frameno = 0; nl->tx_frameno = 0;
nl->framelen = 0; nl->framelen = 0;
...@@ -1327,12 +1338,13 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1327,12 +1338,13 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
spin_lock( &nl->lock ); spin_lock( &nl->lock );
flags = *(struct sbni_flags*) &ifr->ifr_ifru; flags = *(struct sbni_flags*) &ifr->ifr_ifru;
if( flags.fixed_rxl ) if( flags.fixed_rxl ) {
nl->delta_rxl = 0, nl->delta_rxl = 0;
nl->cur_rxl_index = flags.rxl; nl->cur_rxl_index = flags.rxl;
else } else {
nl->delta_rxl = DEF_RXL_DELTA, nl->delta_rxl = DEF_RXL_DELTA;
nl->cur_rxl_index = DEF_RXL; nl->cur_rxl_index = DEF_RXL;
}
nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ]; nl->csr1.rxl = rxl_tab[ nl->cur_rxl_index ];
nl->csr1.rate = flags.rate; nl->csr1.rate = flags.rate;
...@@ -1526,14 +1538,17 @@ sbni_setup( char *p ) ...@@ -1526,14 +1538,17 @@ sbni_setup( char *p )
(*dest[ parm ])[ n ] = simple_strtol( p, &p, 0 ); (*dest[ parm ])[ n ] = simple_strtol( p, &p, 0 );
if( !*p || *p == ')' ) if( !*p || *p == ')' )
return 1; return 1;
if( *p == ';' ) if( *p == ';' ) {
++p, ++n, parm = 0; ++p;
else if( *p++ != ',' ) ++n;
parm = 0;
} else if( *p++ != ',' ) {
break; break;
else } else {
if( ++parm >= 5 ) if( ++parm >= 5 )
break; break;
} }
}
bad_param: bad_param:
pr_err("Error in sbni kernel parameter!\n"); pr_err("Error in sbni kernel parameter!\n");
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment