[PATCH 02/08] staging:dgap: Fix all return statments in err as reported by checkpatch
Mark Hounschell
markh at compro.net
Fri Feb 28 17:42:09 UTC 2014
Fix all return staments in err as reported by checkpatch
Signed-off-by: Mark Hounschell <markh at compro.net>
Cc: Greg Kroah-Hartman <gregkh at linuxfoundation.org>
---
drivers/staging/dgap/dgap.c | 672 ++++++++++++++++++++++----------------------
1 file changed, 336 insertions(+), 336 deletions(-)
diff --git a/drivers/staging/dgap/dgap.c b/drivers/staging/dgap/dgap.c
index f234be7..a35ed28 100644
--- a/drivers/staging/dgap/dgap.c
+++ b/drivers/staging/dgap/dgap.c
@@ -535,7 +535,7 @@ int dgap_init_module(void)
rc = dgap_start();
if (rc < 0) {
- return(rc);
+ return rc;
}
/*
@@ -560,7 +560,7 @@ int dgap_init_module(void)
dgap_driver_state = DRIVER_READY;
}
- return (rc);
+ return rc;
}
@@ -594,7 +594,7 @@ static int dgap_start(void)
*/
rc = register_chrdev(DIGI_DGAP_MAJOR, "dgap", &DgapBoardFops);
if (rc < 0)
- return (rc);
+ return rc;
dgap_class = class_create(THIS_MODULE, "dgap_mgmt");
device_create(dgap_class, NULL,
@@ -609,7 +609,7 @@ static int dgap_start(void)
rc = dgap_tty_preinit();
if (rc < 0)
- return(rc);
+ return rc;
/* Start the poller */
DGAP_LOCK(dgap_poll_lock, flags);
@@ -625,7 +625,7 @@ static int dgap_start(void)
dgap_driver_state = DRIVER_NEED_CONFIG_LOAD;
}
- return (rc);
+ return rc;
}
@@ -727,7 +727,7 @@ static void dgap_cleanup_board(struct board_t *brd)
int i = 0;
if(!brd || brd->magic != DGAP_BOARD_MAGIC)
- return;
+ return;
if (brd->intr_used && brd->irq)
free_irq(brd->irq, brd);
@@ -790,14 +790,14 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
brd = dgap_Board[dgap_NumBoards] =
(struct board_t *) kzalloc(sizeof(struct board_t), GFP_KERNEL);
if (!brd)
- return(-ENOMEM);
+ return -ENOMEM;
/* make a temporary message buffer for the boot messages */
brd->msgbuf = brd->msgbuf_head =
(char *) kzalloc(sizeof(char) * 8192, GFP_KERNEL);
if(!brd->msgbuf) {
kfree(brd);
- return(-ENOMEM);
+ return -ENOMEM;
}
/* store the info for the board we've found */
@@ -904,7 +904,7 @@ static int dgap_found_board(struct pci_dev *pdev, int id)
else
brd->state = NEED_RESET;
- return(0);
+ return 0;
}
@@ -913,7 +913,7 @@ static int dgap_finalize_board_init(struct board_t *brd) {
int rc;
if (!brd || brd->magic != DGAP_BOARD_MAGIC)
- return(-ENODEV);
+ return -ENODEV;
brd->use_interrupts = dgap_config_get_useintr(brd);
@@ -932,7 +932,7 @@ static int dgap_finalize_board_init(struct board_t *brd) {
brd->intr_used = 0;
}
- return(0);
+ return 0;
}
static int dgap_firmware_load(struct pci_dev *pdev, int card_type)
@@ -1308,7 +1308,7 @@ static int dgap_ms_sleep(ulong ms)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout((ms * HZ) / 1000);
- return (signal_pending(current));
+ return signal_pending(current);
}
@@ -1341,11 +1341,11 @@ static int dgap_tty_preinit(void)
if (!dgap_TmpWriteBuf) {
DGAP_UNLOCK(dgap_global_lock, flags);
- return (-ENOMEM);
+ return -ENOMEM;
}
DGAP_UNLOCK(dgap_global_lock, flags);
- return(0);
+ return 0;
}
@@ -1374,7 +1374,7 @@ static int dgap_tty_register(struct board_t *brd)
/* The kernel wants space to store pointers to tty_structs */
brd->SerialDriver->ttys = kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
if (!brd->SerialDriver->ttys)
- return(-ENOMEM);
+ return -ENOMEM;
/*
* Entry points for driver. Called by the kernel from
@@ -1403,7 +1403,7 @@ static int dgap_tty_register(struct board_t *brd)
/* The kernel wants space to store pointers to tty_structs */
brd->PrintDriver->ttys = kzalloc(MAXPORTS * sizeof(struct tty_struct *), GFP_KERNEL);
if (!brd->PrintDriver->ttys)
- return(-ENOMEM);
+ return -ENOMEM;
/*
* Entry points for driver. Called by the kernel from
@@ -1415,7 +1415,7 @@ static int dgap_tty_register(struct board_t *brd)
/* Register tty devices */
rc = tty_register_driver(brd->SerialDriver);
if (rc < 0)
- return(rc);
+ return rc;
brd->dgap_Major_Serial_Registered = TRUE;
dgap_BoardsByMajor[brd->SerialDriver->major] = brd;
brd->dgap_Serial_Major = brd->SerialDriver->major;
@@ -1425,13 +1425,13 @@ static int dgap_tty_register(struct board_t *brd)
/* Register Transparent Print devices */
rc = tty_register_driver(brd->PrintDriver);
if (rc < 0)
- return(rc);
+ return rc;
brd->dgap_Major_TransparentPrint_Registered = TRUE;
dgap_BoardsByMajor[brd->PrintDriver->major] = brd;
brd->dgap_TransparentPrint_Major = brd->PrintDriver->major;
}
- return (rc);
+ return rc;
}
@@ -1453,7 +1453,7 @@ static int dgap_tty_init(struct board_t *brd)
struct cm_t *cm;
if (!brd)
- return (-ENXIO);
+ return -ENXIO;
/*
* Initialize board structure elements.
@@ -1489,7 +1489,7 @@ static int dgap_tty_init(struct board_t *brd)
if (!brd->nasync) {
brd->state = BOARD_FAILED;
brd->dpastatus = BD_NOFEP;
- return(-ENXIO);
+ return -ENXIO;
}
}
@@ -1600,7 +1600,7 @@ static int dgap_tty_init(struct board_t *brd)
writeb(1, &(ch->ch_bs->idata));
}
- return (0);
+ return 0;
}
@@ -2263,7 +2263,7 @@ static int dgap_tty_open(struct tty_struct *tty, struct file *file)
un->un_flags |= (UN_ISOPEN);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return (rc);
+ return rc;
}
@@ -2281,12 +2281,12 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
int sleep_on_un_flags = 0;
if (!tty || tty->magic != TTY_MAGIC || !file || !ch || ch->magic != DGAP_CHANNEL_MAGIC) {
- return (-ENXIO);
+ return -ENXIO;
}
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC) {
- return (-ENXIO);
+ return -ENXIO;
}
DGAP_LOCK(ch->ch_lock, lock_flags);
@@ -2396,9 +2396,9 @@ static int dgap_block_til_ready(struct tty_struct *tty, struct file *file, struc
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (retval)
- return(retval);
+ return retval;
- return(0);
+ return 0;
}
@@ -2584,23 +2584,23 @@ static int dgap_tty_chars_in_buffer(struct tty_struct *tty)
ulong lock_flags2 = 0;
if (tty == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return (0);
+ return 0;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -2660,7 +2660,7 @@ static int dgap_tty_chars_in_buffer(struct tty_struct *tty)
}
}
- return(chars);
+ return chars;
}
@@ -2716,7 +2716,7 @@ static int dgap_wait_for_drain(struct tty_struct *tty)
un->un_flags &= ~(UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return (ret);
+ return ret;
}
@@ -2734,22 +2734,22 @@ static int dgap_maxcps_room(struct tty_struct *tty, int bytes_available)
struct un_t *un = NULL;
if (tty == NULL)
- return (bytes_available);
+ return bytes_available;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (bytes_available);
+ return bytes_available;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (bytes_available);
+ return bytes_available;
/*
* If its not the Transparent print device, return
* the full data amount.
*/
if (un->un_type != DGAP_PRINT)
- return (bytes_available);
+ return bytes_available;
if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0 ) {
int cps_limit = 0;
@@ -2774,7 +2774,7 @@ static int dgap_maxcps_room(struct tty_struct *tty, int bytes_available)
bytes_available = min(cps_limit, bytes_available);
}
- return (bytes_available);
+ return bytes_available;
}
@@ -2822,19 +2822,19 @@ static int dgap_tty_write_room(struct tty_struct *tty)
ulong lock_flags = 0;
if (tty == NULL || dgap_TmpWriteBuf == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return (0);
+ return 0;
DGAP_LOCK(ch->ch_lock, lock_flags);
@@ -2875,7 +2875,7 @@ static int dgap_tty_write_room(struct tty_struct *tty)
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(ret);
+ return ret;
}
@@ -2915,22 +2915,22 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
int from_user = 0;
if (tty == NULL || dgap_TmpWriteBuf == NULL)
- return(0);
+ return 0;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return(0);
+ return 0;
bs = ch->ch_bs;
if (!bs)
- return(0);
+ return 0;
if (!count)
- return(0);
+ return 0;
/*
* Store original amount of characters passed in.
@@ -2967,7 +2967,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
if (count <= 0) {
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(0);
+ return 0;
}
/*
@@ -2998,7 +2998,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
if (count <= 0) {
dgap_set_firmware_event(un, UN_LOW | UN_EMPTY);
DGAP_UNLOCK(ch->ch_lock, lock_flags);
- return(0);
+ return 0;
}
if (from_user) {
@@ -3014,7 +3014,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
*/
/* we're allowed to block if it's from_user */
if (down_interruptible(&dgap_TmpWriteSem)) {
- return (-EINTR);
+ return -EINTR;
}
if (copy_from_user(dgap_TmpWriteBuf, (const uchar __user *) buf, count)) {
@@ -3108,7 +3108,7 @@ static int dgap_tty_write(struct tty_struct *tty, const unsigned char *buf, int
DGAP_UNLOCK(ch->ch_lock, lock_flags);
}
- return (count);
+ return count;
}
@@ -3221,7 +3221,7 @@ static int dgap_tty_tiocmset(struct tty_struct *tty,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
@@ -3277,7 +3277,7 @@ static int dgap_tty_send_break(struct tty_struct *tty, int msec)
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
@@ -3367,7 +3367,7 @@ static int dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value)
int rc = 0;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return(-ENXIO);
+ return -ENXIO;
DGAP_LOCK(ch->ch_lock, lock_flags);
@@ -3394,7 +3394,7 @@ static int dgap_get_modem_info(struct channel_t *ch, unsigned int __user *value)
rc = put_user(result, value);
- return(rc);
+ return rc;
}
@@ -3430,7 +3430,7 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns
ret = get_user(arg, value);
if (ret)
- return(ret);
+ return ret;
switch (command) {
case TIOCMBIS:
@@ -3479,7 +3479,7 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns
break;
default:
- return(-EINVAL);
+ return -EINVAL;
}
DGAP_LOCK(bd->bd_lock, lock_flags);
@@ -3490,7 +3490,7 @@ static int dgap_set_modem_info(struct tty_struct *tty, unsigned int command, uns
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return (0);
+ return 0;
}
@@ -3510,18 +3510,18 @@ static int dgap_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
@@ -3530,9 +3530,9 @@ static int dgap_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
@@ -3554,19 +3554,19 @@ static int dgap_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
unsigned long lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_digi, new_info, sizeof(struct digi_t)))
return -EFAULT;
@@ -3602,7 +3602,7 @@ static int dgap_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
}
@@ -3622,18 +3622,18 @@ static int dgap_tty_digigetedelay(struct tty_struct *tty, int __user *retinfo)
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
@@ -3642,9 +3642,9 @@ static int dgap_tty_digigetedelay(struct tty_struct *tty, int __user *retinfo)
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
@@ -3664,19 +3664,19 @@ static int dgap_tty_digisetedelay(struct tty_struct *tty, int __user *new_info)
ulong lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_digi, new_info, sizeof(int)))
return -EFAULT;
@@ -3691,7 +3691,7 @@ static int dgap_tty_digisetedelay(struct tty_struct *tty, int __user *new_info)
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
}
@@ -3708,18 +3708,18 @@ static int dgap_tty_digigetcustombaud(struct tty_struct *tty, int __user *retinf
ulong lock_flags;
if (!retinfo)
- return (-EFAULT);
+ return -EFAULT;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
memset(&tmp, 0, sizeof(tmp));
@@ -3728,9 +3728,9 @@ static int dgap_tty_digigetcustombaud(struct tty_struct *tty, int __user *retinf
DGAP_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(retinfo, &tmp, sizeof(*retinfo)))
- return (-EFAULT);
+ return -EFAULT;
- return (0);
+ return 0;
}
@@ -3749,23 +3749,23 @@ static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_in
ulong lock_flags2;
if (!tty || tty->magic != TTY_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-EFAULT);
+ return -EFAULT;
if (copy_from_user(&new_rate, new_info, sizeof(unsigned int)))
- return(-EFAULT);
+ return -EFAULT;
if (bd->bd_flags & BD_FEP5PLUS) {
@@ -3780,7 +3780,7 @@ static int dgap_tty_digisetcustombaud(struct tty_struct *tty, int __user *new_in
DGAP_UNLOCK(bd->bd_lock, lock_flags);
}
- return(0);
+ return 0;
}
@@ -3845,7 +3845,7 @@ static void dgap_tty_throttle(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -3882,7 +3882,7 @@ static void dgap_tty_unthrottle(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -3919,7 +3919,7 @@ static void dgap_tty_start(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -3953,7 +3953,7 @@ static void dgap_tty_stop(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -4000,7 +4000,7 @@ static void dgap_tty_flush_chars(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -4040,7 +4040,7 @@ static void dgap_tty_flush_buffer(struct tty_struct *tty)
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return;
+ return;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
@@ -4095,19 +4095,19 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
void __user *uarg = (void __user *) arg;
if (!tty || tty->magic != TTY_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
un = tty->driver_data;
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (-ENODEV);
+ return -ENODEV;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4115,7 +4115,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
if (un->un_open_count <= 0) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-EIO);
+ return -EIO;
}
switch (cmd) {
@@ -4135,13 +4135,13 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4153,7 +4153,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
case TCSBRKP:
@@ -4167,12 +4167,12 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4182,7 +4182,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
case TIOCSBRK:
/*
@@ -4195,12 +4195,12 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
if (rc) {
- return(rc);
+ return rc;
}
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4229,7 +4229,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) arg);
- return(rc);
+ return rc;
case TIOCSSOFTCAR:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
@@ -4237,7 +4237,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
rc = get_user(arg, (unsigned long __user *) arg);
if (rc)
- return(rc);
+ return rc;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
@@ -4246,19 +4246,19 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(0);
+ return 0;
case TIOCMGET:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_get_modem_info(ch, uarg));
+ return dgap_get_modem_info(ch, uarg);
case TIOCMBIS:
case TIOCMBIC:
case TIOCMSET:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_set_modem_info(tty, cmd, uarg));
+ return dgap_set_modem_info(tty, cmd, uarg);
/*
* Here are any additional ioctl's that we want to implement
@@ -4278,7 +4278,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
if (rc) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(rc);
+ return rc;
}
if ((arg == TCIFLUSH) || (arg == TCIOFLUSH)) {
@@ -4317,7 +4317,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCSETSF:
case TCSETSW:
@@ -4342,10 +4342,10 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
/* pretend we didn't recognize this */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCSETAW:
@@ -4353,10 +4353,10 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
/* pretend we didn't recognize this */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCXONC:
/*
@@ -4370,7 +4370,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
if (rc) {
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(rc);
+ return rc;
}
switch (arg) {
@@ -4379,33 +4379,33 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
dgap_tty_start(tty);
- return(0);
+ return 0;
case TCOOFF:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
dgap_tty_stop(tty);
- return(0);
+ return 0;
case TCION:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
/* Make the ld do it */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
case TCIOFF:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
/* Make the ld do it */
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
default:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-EINVAL);
+ return -EINVAL;
}
case DIGI_GETA:
/* get information for ditty */
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigeta(tty, uarg));
+ return dgap_tty_digigeta(tty, uarg);
case DIGI_SETAW:
case DIGI_SETAF:
@@ -4417,7 +4417,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(bd->bd_lock, lock_flags);
rc = dgap_wait_for_drain(tty);
if (rc)
- return(-EINTR);
+ return -EINTR;
DGAP_LOCK(bd->bd_lock, lock_flags);
DGAP_LOCK(ch->ch_lock, lock_flags2);
}
@@ -4429,27 +4429,27 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
case DIGI_SETA:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digiseta(tty, uarg));
+ return dgap_tty_digiseta(tty, uarg);
case DIGI_GEDELAY:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigetedelay(tty, uarg));
+ return dgap_tty_digigetedelay(tty, uarg);
case DIGI_SEDELAY:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digisetedelay(tty, uarg));
+ return dgap_tty_digisetedelay(tty, uarg);
case DIGI_GETCUSTOMBAUD:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digigetcustombaud(tty, uarg));
+ return dgap_tty_digigetcustombaud(tty, uarg);
case DIGI_SETCUSTOMBAUD:
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(dgap_tty_digisetcustombaud(tty, uarg));
+ return dgap_tty_digisetcustombaud(tty, uarg);
case DIGI_RESET_PORT:
dgap_firmware_reset_port(ch);
@@ -4462,7 +4462,7 @@ static int dgap_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
DGAP_UNLOCK(ch->ch_lock, lock_flags2);
DGAP_UNLOCK(bd->bd_lock, lock_flags);
- return(-ENOIOCTLCMD);
+ return -ENOIOCTLCMD;
}
}
@@ -6256,13 +6256,13 @@ static void dgap_remove_driver_sysfiles(struct pci_driver *dgap_driver)
#define DGAP_VERIFY_BOARD(p, bd) \
if (!p) \
- return (0); \
+ return 0; \
\
bd = dev_get_drvdata(p); \
if (!bd || bd->magic != DGAP_BOARD_MAGIC) \
- return (0); \
+ return 0; \
if (bd->state != BOARD_READY) \
- return (0); \
+ return 0; \
static ssize_t dgap_ports_state_show(struct device *p, struct device_attribute *attr, char *buf)
@@ -6494,18 +6494,18 @@ static ssize_t dgap_tty_state_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%s", un->un_open_count ? "Open" : "Closed");
}
@@ -6519,18 +6519,18 @@ static ssize_t dgap_tty_baud_show(struct device *d, struct device_attribute *att
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_baud_info);
}
@@ -6544,18 +6544,18 @@ static ssize_t dgap_tty_msignals_show(struct device *d, struct device_attribute
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
if (ch->ch_open_count) {
return snprintf(buf, PAGE_SIZE, "%s %s %s %s %s %s\n",
@@ -6578,18 +6578,18 @@ static ssize_t dgap_tty_iflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_iflag);
}
@@ -6603,18 +6603,18 @@ static ssize_t dgap_tty_cflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_cflag);
}
@@ -6628,18 +6628,18 @@ static ssize_t dgap_tty_oflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_oflag);
}
@@ -6653,18 +6653,18 @@ static ssize_t dgap_tty_lflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_c_lflag);
}
@@ -6678,18 +6678,18 @@ static ssize_t dgap_tty_digi_flag_show(struct device *d, struct device_attribute
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%x\n", ch->ch_digi.digi_flags);
}
@@ -6703,18 +6703,18 @@ static ssize_t dgap_tty_rxcount_show(struct device *d, struct device_attribute *
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_rxcount);
}
@@ -6728,18 +6728,18 @@ static ssize_t dgap_tty_txcount_show(struct device *d, struct device_attribute *
struct un_t *un;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
return snprintf(buf, PAGE_SIZE, "%ld\n", ch->ch_txcount);
}
@@ -6760,18 +6760,18 @@ static ssize_t dgap_tty_name_show(struct device *d, struct device_attribute *att
int i = 0;
if (!d)
- return (0);
+ return 0;
un = dev_get_drvdata(d);
if (!un || un->magic != DGAP_UNIT_MAGIC)
- return (0);
+ return 0;
ch = un->un_ch;
if (!ch || ch->magic != DGAP_CHANNEL_MAGIC)
- return (0);
+ return 0;
bd = ch->ch_bd;
if (!bd || bd->magic != DGAP_BOARD_MAGIC)
- return (0);
+ return 0;
if (bd->state != BOARD_READY)
- return (0);
+ return 0;
bn = bd->boardnum;
cn = ch->ch_portnum;
@@ -6914,7 +6914,7 @@ static int dgap_parsefile(char **in, int Remove)
while ( (rc = dgap_gettok(in,p)) != BEGIN ) {
if (rc == 0) {
dgap_err("unexpected EOF");
- return(-1);
+ return -1;
}
}
@@ -6922,27 +6922,27 @@ static int dgap_parsefile(char **in, int Remove)
rc = dgap_gettok(in,p);
if (rc == 0) {
dgap_err("unexpected EOF");
- return(-1);
+ return -1;
}
switch (rc) {
case 0:
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
case BEGIN: /* should only be 1 begin */
dgap_err("unexpected config_begin\n");
- return(-1);
+ return -1;
case END:
- return(0);
+ return 0;
case BOARD: /* board info */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(BNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
@@ -6955,7 +6955,7 @@ static int dgap_parsefile(char **in, int Remove)
case APORT2_920P: /* AccelePort_4 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_2r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT2_920P;
p->u.board.v_type = 1;
@@ -6964,7 +6964,7 @@ static int dgap_parsefile(char **in, int Remove)
case APORT4_920P: /* AccelePort_4 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_4r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT4_920P;
p->u.board.v_type = 1;
@@ -6973,7 +6973,7 @@ static int dgap_parsefile(char **in, int Remove)
case APORT8_920P: /* AccelePort_8 */
if (p->type != BNODE) {
dgap_err("unexpected Digi_8r_920 string");
- return(-1);
+ return -1;
}
p->u.board.type = APORT8_920P;
p->u.board.v_type = 1;
@@ -6982,7 +6982,7 @@ static int dgap_parsefile(char **in, int Remove)
case PAPORT4: /* AccelePort_4 PCI */
if (p->type != BNODE) {
dgap_err("unexpected Digi_4r(PCI) string");
- return(-1);
+ return -1;
}
p->u.board.type = PAPORT4;
p->u.board.v_type = 1;
@@ -6991,7 +6991,7 @@ static int dgap_parsefile(char **in, int Remove)
case PAPORT8: /* AccelePort_8 PCI */
if (p->type != BNODE) {
dgap_err("unexpected Digi_8r string");
- return(-1);
+ return -1;
}
p->u.board.type = PAPORT8;
p->u.board.v_type = 1;
@@ -7000,7 +7000,7 @@ static int dgap_parsefile(char **in, int Remove)
case PCX: /* PCI C/X */
if (p->type != BNODE) {
dgap_err("unexpected Digi_C/X_(PCI) string");
- return(-1);
+ return -1;
}
p->u.board.type = PCX;
p->u.board.v_type = 1;
@@ -7013,7 +7013,7 @@ static int dgap_parsefile(char **in, int Remove)
case PEPC: /* PCI EPC/X */
if (p->type != BNODE) {
dgap_err("unexpected \"Digi_EPC/X_(PCI)\" string");
- return(-1);
+ return -1;
}
p->u.board.type = PEPC;
p->u.board.v_type = 1;
@@ -7026,7 +7026,7 @@ static int dgap_parsefile(char **in, int Remove)
case PPCM: /* PCI/Xem */
if (p->type != BNODE) {
dgap_err("unexpected PCI/Xem string");
- return(-1);
+ return -1;
}
p->u.board.type = PPCM;
p->u.board.v_type = 1;
@@ -7037,18 +7037,18 @@ static int dgap_parsefile(char **in, int Remove)
case IO: /* i/o port */
if (p->type != BNODE) {
dgap_err("IO port only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.portstr = dgap_savestring(s);
p->u.board.port = (short)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for IO port");
- return(-1);
+ return -1;
}
p->u.board.v_port = 1;
break;
@@ -7056,18 +7056,18 @@ static int dgap_parsefile(char **in, int Remove)
case MEM: /* memory address */
if (p->type != BNODE) {
dgap_err("memory address only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.addrstr = dgap_savestring(s);
p->u.board.addr = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for memory address");
- return(-1);
+ return -1;
}
p->u.board.v_addr = 1;
break;
@@ -7075,30 +7075,30 @@ static int dgap_parsefile(char **in, int Remove)
case PCIINFO: /* pci information */
if (p->type != BNODE) {
dgap_err("memory address only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.pcibusstr = dgap_savestring(s);
p->u.board.pcibus = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for pci bus");
- return(-1);
+ return -1;
}
p->u.board.v_pcibus = 1;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.pcislotstr = dgap_savestring(s);
p->u.board.pcislot = simple_strtoul(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for pci slot");
- return(-1);
+ return -1;
}
p->u.board.v_pcislot = 1;
break;
@@ -7106,12 +7106,12 @@ static int dgap_parsefile(char **in, int Remove)
case METHOD:
if (p->type != BNODE) {
dgap_err("install method only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.method = dgap_savestring(s);
p->u.board.v_method = 1;
@@ -7120,12 +7120,12 @@ static int dgap_parsefile(char **in, int Remove)
case STATUS:
if (p->type != BNODE) {
dgap_err("config status only vaild for boards");
- return(-1);
+ return -1;
}
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.status = dgap_savestring(s);
break;
@@ -7135,41 +7135,41 @@ static int dgap_parsefile(char **in, int Remove)
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.board.v_nport = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.conc.v_nport = 1;
} else if (p->type == MNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.module.nport = (char)simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for number of ports");
- return(-1);
+ return -1;
}
p->u.module.v_nport = 1;
} else {
dgap_err("nports only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
@@ -7177,7 +7177,7 @@ static int dgap_parsefile(char **in, int Remove)
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.status = dgap_savestring(s);
@@ -7190,7 +7190,7 @@ static int dgap_parsefile(char **in, int Remove)
p->u.module.v_id = 1;
} else {
dgap_err("id only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
@@ -7199,95 +7199,95 @@ static int dgap_parsefile(char **in, int Remove)
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.board.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.board.v_start = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.conc.v_start = 1;
} else if (p->type == MNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.module.start = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for start of tty count");
- return(-1);
+ return -1;
}
p->u.module.v_start = 1;
} else {
dgap_err("start only valid for concentrators or modules");
- return(-1);
+ return -1;
}
break;
case TTYN: /* tty name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(TNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.ttyname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case CU: /* cu name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(CUNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.cuname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case LINE: /* line information */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (brd == NULL) {
dgap_err("must specify board before line info");
- return(-1);
+ return -1;
}
switch (brd->u.board.type) {
case PPCM:
dgap_err("line not vaild for PC/em");
- return(-1);
+ return -1;
}
if ( (p->next = dgap_newnode(LNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
conc = NULL;
@@ -7297,14 +7297,14 @@ static int dgap_parsefile(char **in, int Remove)
case CONC: /* concentrator information */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (line == NULL) {
dgap_err("must specify line info before concentrator");
- return(-1);
+ return -1;
}
if ( (p->next = dgap_newnode(CNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
conc = p;
@@ -7318,7 +7318,7 @@ static int dgap_parsefile(char **in, int Remove)
case CX: /* c/x type concentrator */
if (p->type != CNODE) {
dgap_err("cx only valid for concentrators");
- return(-1);
+ return -1;
}
p->u.conc.type = CX;
p->u.conc.v_type = 1;
@@ -7327,7 +7327,7 @@ static int dgap_parsefile(char **in, int Remove)
case EPC: /* epc type concentrator */
if (p->type != CNODE) {
dgap_err("cx only valid for concentrators");
- return(-1);
+ return -1;
}
p->u.conc.type = EPC;
p->u.conc.v_type = 1;
@@ -7335,10 +7335,10 @@ static int dgap_parsefile(char **in, int Remove)
case MOD: /* EBI module */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if (brd == NULL) {
dgap_err("must specify board info before EBI modules");
- return(-1);
+ return -1;
}
switch (brd->u.board.type) {
case PPCM:
@@ -7347,12 +7347,12 @@ static int dgap_parsefile(char **in, int Remove)
default:
if (conc == NULL) {
dgap_err("must specify concentrator info before EBI module");
- return(-1);
+ return -1;
}
}
if ( (p->next = dgap_newnode(MNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if (linecnt)
@@ -7365,7 +7365,7 @@ static int dgap_parsefile(char **in, int Remove)
case PORTS: /* ports type EBI module */
if (p->type != MNODE) {
dgap_err("ports only valid for EBI modules");
- return(-1);
+ return -1;
}
p->u.module.type = PORTS;
p->u.module.v_type = 1;
@@ -7374,7 +7374,7 @@ static int dgap_parsefile(char **in, int Remove)
case MODEM: /* ports type EBI module */
if (p->type != MNODE) {
dgap_err("modem only valid for modem modules");
- return(-1);
+ return -1;
}
p->u.module.type = MODEM;
p->u.module.v_type = 1;
@@ -7384,7 +7384,7 @@ static int dgap_parsefile(char **in, int Remove)
if (p->type == LNODE) {
if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.line.cable = dgap_savestring(s);
p->u.line.v_cable = 1;
@@ -7396,29 +7396,29 @@ static int dgap_parsefile(char **in, int Remove)
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.line.speed = (char)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for line speed");
- return(-1);
+ return -1;
}
p->u.line.v_speed = 1;
} else if (p->type == CNODE) {
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.speed = (char)simple_strtol(s, &s2, 0);
if ((short)strlen(s) > (short)(s2 - s)) {
dgap_err("bad number for line speed");
- return(-1);
+ return -1;
}
p->u.conc.v_speed = 1;
} else {
dgap_err("speed valid only for lines or concentrators.");
- return(-1);
+ return -1;
}
break;
@@ -7426,7 +7426,7 @@ static int dgap_parsefile(char **in, int Remove)
if (p->type == CNODE) {
if ((s = dgap_getword(in)) == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.conc.connect = dgap_savestring(s);
p->u.conc.v_connect = 1;
@@ -7434,199 +7434,199 @@ static int dgap_parsefile(char **in, int Remove)
break;
case PRINT: /* transparent print name prefix */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(PNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
if ( (s = dgap_getword(in)) == NULL ) {
dgap_err("unexpeced end of file");
- return(-1);
+ return -1;
}
if ( (p->u.printname = dgap_savestring(s)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
break;
case CMAJOR: /* major number */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(JNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.majornumber = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for major number");
- return(-1);
+ return -1;
}
break;
case ALTPIN: /* altpin setting */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(ANODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.altpin = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for altpin");
- return(-1);
+ return -1;
}
break;
case USEINTR: /* enable interrupt setting */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(INTRNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.useintr = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for useintr");
- return(-1);
+ return -1;
}
break;
case TTSIZ: /* size of tty structure */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(TSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.ttysize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for ttysize");
- return(-1);
+ return -1;
}
break;
case CHSIZ: /* channel structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(CSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.chsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for chsize");
- return(-1);
+ return -1;
}
break;
case BSSIZ: /* board structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(BSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.bssize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for bssize");
- return(-1);
+ return -1;
}
break;
case UNTSIZ: /* sched structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(USNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.unsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for schedsize");
- return(-1);
+ return -1;
}
break;
case F2SIZ: /* f2200 structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(FSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.f2size = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for f2200size");
- return(-1);
+ return -1;
}
break;
case VPSIZ: /* vpix structure size */
if (dgap_checknode(p))
- return(-1);
+ return -1;
if ( (p->next = dgap_newnode(VSNODE)) == NULL ) {
dgap_err("out of memory");
- return(-1);
+ return -1;
}
p = p->next;
s = dgap_getword(in);
if (s == NULL) {
dgap_err("unexpected end of file");
- return(-1);
+ return -1;
}
p->u.vpixsize = simple_strtol(s, &s2, 0);
if ((int)strlen(s) > (int)(s2 - s)) {
dgap_err("bad number for vpixsize");
- return(-1);
+ return -1;
}
break;
}
@@ -7683,21 +7683,21 @@ static int dgap_gettok(char **in, struct cnode *p)
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
if ( !strcmp(w, t->string)) {
- return(t->token);
+ return t->token;
}
}
dgap_err("board !!type not specified");
- return(1);
+ return 1;
}
else {
while ( (w = dgap_getword(in)) != NULL ) {
snprintf(dgap_cword, MAXCWORD, "%s", w);
for (t = dgap_tlist; t->token != 0; t++) {
if ( !strcmp(w, t->string) )
- return(t->token);
+ return t->token;
}
}
- return(0);
+ return 0;
}
}
@@ -7752,7 +7752,7 @@ static struct cnode *dgap_newnode(int t)
memset((char *)n, 0, sizeof(struct cnode));
n->type = t;
}
- return(n);
+ return n;
}
@@ -7766,53 +7766,53 @@ static int dgap_checknode(struct cnode *p)
case BNODE:
if (p->u.board.v_type == 0) {
dgap_err("board type !not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case LNODE:
if (p->u.line.v_speed == 0) {
dgap_err("line speed not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case CNODE:
if (p->u.conc.v_type == 0) {
dgap_err("concentrator type not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_speed == 0) {
dgap_err("concentrator line speed not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_nport == 0) {
dgap_err("number of ports on concentrator not specified");
- return(1);
+ return 1;
}
if (p->u.conc.v_id == 0) {
dgap_err("concentrator id letter not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
case MNODE:
if (p->u.module.v_type == 0) {
dgap_err("EBI module type not specified");
- return(1);
+ return 1;
}
if (p->u.module.v_nport == 0) {
dgap_err("number of ports on EBI module not specified");
- return(1);
+ return 1;
}
if (p->u.module.v_id == 0) {
dgap_err("EBI module id letter not specified");
- return(1);
+ return 1;
}
- return(0);
+ return 0;
}
- return(0);
+ return 0;
}
/*
@@ -7824,7 +7824,7 @@ static char *dgap_savestring(char *s)
if ( (p = kmalloc(strlen(s) + 1, GFP_ATOMIC) ) != NULL) {
strcpy(p, s);
}
- return(p);
+ return p;
}
@@ -7836,7 +7836,7 @@ static uint dgap_config_get_useintr(struct board_t *bd)
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
switch (p->type) {
@@ -7863,7 +7863,7 @@ static uint dgap_config_get_altpin(struct board_t *bd)
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
switch (p->type) {
@@ -7953,7 +7953,7 @@ static uint dgap_config_get_number_of_ports(struct board_t *bd)
struct cnode *p = NULL;
if (!bd)
- return(0);
+ return 0;
for (p = bd->bd_config; p; p = p->next) {
@@ -7973,7 +7973,7 @@ static uint dgap_config_get_number_of_ports(struct board_t *bd)
break;
}
}
- return (count);
+ return count;
}
static char *dgap_create_config_string(struct board_t *bd, char *string)
--
1.8.1.4
More information about the devel
mailing list