This patch removes this checkpatch warning: ERROR: return is not a function, parentheses are not required. Signed-off-by: Lidza Louina <lidza.louina@xxxxxxxxx> --- drivers/staging/dgnc/dgnc_tty.c | 200 ++++++++++++++++++++-------------------- 1 file changed, 100 insertions(+), 100 deletions(-) diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c index b03e373..bc66930 100644 --- a/drivers/staging/dgnc/dgnc_tty.c +++ b/drivers/staging/dgnc/dgnc_tty.c @@ -190,10 +190,10 @@ int dgnc_tty_preinit(void) if (!dgnc_TmpWriteBuf) { DPR_INIT(("unable to allocate tmp write buf")); - return (-ENOMEM); + return -ENOMEM; } - return(0); + return 0; } @@ -255,7 +255,7 @@ int dgnc_tty_register(struct dgnc_board *brd) rc = tty_register_driver(&brd->SerialDriver); if (rc < 0) { APR(("Can't register tty device (%d)\n", rc)); - return(rc); + return rc; } brd->dgnc_Major_Serial_Registered = TRUE; } @@ -308,7 +308,7 @@ int dgnc_tty_register(struct dgnc_board *brd) rc = tty_register_driver(&brd->PrintDriver); if (rc < 0) { APR(("Can't register Transparent Print device (%d)\n", rc)); - return(rc); + return rc; } brd->dgnc_Major_TransparentPrint_Registered = TRUE; } @@ -319,7 +319,7 @@ int dgnc_tty_register(struct dgnc_board *brd) DPR_INIT(("DGNC REGISTER TTY: MAJOR: %d\n", brd->SerialDriver.major)); - return (rc); + return rc; } @@ -336,7 +336,7 @@ int dgnc_tty_init(struct dgnc_board *brd) struct channel_t *ch; if (!brd) - return (-ENXIO); + return -ENXIO; DPR_INIT(("dgnc_tty_init start\n")); @@ -420,7 +420,7 @@ int dgnc_tty_init(struct dgnc_board *brd) DPR_INIT(("dgnc_tty_init finish\n")); - return (0); + return 0; } @@ -1457,7 +1457,7 @@ static int dgnc_tty_open(struct tty_struct *tty, struct file *file) DGNC_UNLOCK(ch->ch_lock, lock_flags); DPR_OPEN(("dgnc_tty_open finished\n")); - return (rc); + return rc; } @@ -1475,12 +1475,12 @@ static int dgnc_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 != DGNC_CHANNEL_MAGIC) { - return (-ENXIO); + return -ENXIO; } un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) { - return (-ENXIO); + return -ENXIO; } DPR_OPEN(("dgnc_block_til_ready - before block.\n")); @@ -1608,12 +1608,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty, struct file *file, struc if (retval) { DPR_OPEN(("dgnc_block_til_ready - done. error. retval: %x\n", retval)); - return(retval); + return retval; } DPR_OPEN(("dgnc_block_til_ready - done no error. jiffies: %lu\n", jiffies)); - return(0); + return 0; } @@ -1827,15 +1827,15 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty) ulong lock_flags = 0; if (tty == NULL) - return(0); + return 0; un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) - return (0); + return 0; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (0); + return 0; DGNC_LOCK(ch->ch_lock, lock_flags); @@ -1857,7 +1857,7 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty) DPR_WRITE(("dgnc_tty_chars_in_buffer. Port: %x - %d (head: %d tail: %d)\n", ch->ch_portnum, chars, thead, ttail)); - return(chars); + return chars; } @@ -1875,22 +1875,22 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) struct un_t *un = NULL; if (!tty) - return (bytes_available); + return bytes_available; un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) - return (bytes_available); + return bytes_available; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (bytes_available); + return bytes_available; /* * If its not the Transparent print device, return * the full data amount. */ if (un->un_type != DGNC_PRINT) - return (bytes_available); + return bytes_available; if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0 ) { int cps_limit = 0; @@ -1915,7 +1915,7 @@ static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available) bytes_available = min(cps_limit, bytes_available); } - return (bytes_available); + return bytes_available; } @@ -1935,15 +1935,15 @@ static int dgnc_tty_write_room(struct tty_struct *tty) ulong lock_flags = 0; if (tty == NULL || dgnc_TmpWriteBuf == NULL) - return(0); + return 0; un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) - return (0); + return 0; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (0); + return 0; DGNC_LOCK(ch->ch_lock, lock_flags); @@ -1978,7 +1978,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty) DPR_WRITE(("dgnc_tty_write_room - %d tail: %d head: %d\n", ret, tail, head)); - return(ret); + return ret; } @@ -2021,18 +2021,18 @@ static int dgnc_tty_write(struct tty_struct *tty, int from_user = 0; if (tty == NULL || dgnc_TmpWriteBuf == NULL) - return(0); + return 0; un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) - return(0); + return 0; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return(0); + return 0; if (!count) - return(0); + return 0; DPR_WRITE(("dgnc_tty_write: Port: %x tty=%p user=%d len=%d\n", ch->ch_portnum, tty, from_user, count)); @@ -2074,7 +2074,7 @@ static int dgnc_tty_write(struct tty_struct *tty, */ if (count <= 0) { DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; } /* @@ -2104,7 +2104,7 @@ static int dgnc_tty_write(struct tty_struct *tty, */ if (count <= 0) { DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; } if (from_user) { @@ -2120,7 +2120,7 @@ static int dgnc_tty_write(struct tty_struct *tty, */ /* we're allowed to block if it's from_user */ if (down_interruptible(&dgnc_TmpWriteSem)) { - return (-EINTR); + return -EINTR; } /* @@ -2131,7 +2131,7 @@ static int dgnc_tty_write(struct tty_struct *tty, if (!count) { up(&dgnc_TmpWriteSem); - return(-EFAULT); + return -EFAULT; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -2213,7 +2213,7 @@ static int dgnc_tty_write(struct tty_struct *tty, ch->ch_bd->bd_ops->copy_data_from_queue_to_uart(ch); } - return (count); + return count; } @@ -2333,7 +2333,7 @@ static int dgnc_tty_tiocmset(struct tty_struct *tty, struct file *file, DPR_IOCTL(("dgnc_tty_tiocmset finish\n")); - return (0); + return 0; } @@ -2386,7 +2386,7 @@ static int dgnc_tty_send_break(struct tty_struct *tty, int msec) DPR_IOCTL(("dgnc_tty_send_break finish\n")); - return (0); + return 0; } @@ -2481,7 +2481,7 @@ static inline int dgnc_get_mstat(struct channel_t *ch) DPR_IOCTL(("dgnc_getmstat start\n")); if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return(-ENXIO); + return -ENXIO; DGNC_LOCK(ch->ch_lock, lock_flags); @@ -2506,7 +2506,7 @@ static inline int dgnc_get_mstat(struct channel_t *ch) DPR_IOCTL(("dgnc_getmstat finish\n")); - return(result); + return result; } @@ -2522,17 +2522,17 @@ static int dgnc_get_modem_info(struct channel_t *ch, unsigned int __user *value DPR_IOCTL(("dgnc_get_modem_info start\n")); if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return(-ENXIO); + return -ENXIO; result = dgnc_get_mstat(ch); if (result < 0) - return (-ENXIO); + return -ENXIO; rc = put_user(result, value); DPR_IOCTL(("dgnc_get_modem_info finish\n")); - return(rc); + return rc; } @@ -2571,7 +2571,7 @@ static int dgnc_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: @@ -2615,7 +2615,7 @@ static int dgnc_set_modem_info(struct tty_struct *tty, unsigned int command, uns break; default: - return(-EINVAL); + return -EINVAL; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -2626,7 +2626,7 @@ static int dgnc_set_modem_info(struct tty_struct *tty, unsigned int command, uns DPR_IOCTL(("dgnc_set_modem_info finish\n")); - return (0); + return 0; } @@ -2646,18 +2646,18 @@ static int dgnc_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 != DGNC_UNIT_MAGIC) - return (-EFAULT); + return -EFAULT; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (-EFAULT); + return -EFAULT; memset(&tmp, 0, sizeof(tmp)); @@ -2666,9 +2666,9 @@ static int dgnc_tty_digigeta(struct tty_struct *tty, struct digi_t __user *retin DGNC_UNLOCK(ch->ch_lock, lock_flags); if (copy_to_user(retinfo, &tmp, sizeof(*retinfo))) - return (-EFAULT); + return -EFAULT; - return (0); + return 0; } @@ -2691,23 +2691,23 @@ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i DPR_IOCTL(("DIGI_SETA start\n")); if (!tty || tty->magic != TTY_MAGIC) - return (-EFAULT); + return -EFAULT; un = tty->driver_data; if (!un || un->magic != DGNC_UNIT_MAGIC) - return (-EFAULT); + return -EFAULT; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (-EFAULT); + return -EFAULT; bd = ch->ch_bd; if (!bd || bd->magic != DGNC_BOARD_MAGIC) - return (-EFAULT); + return -EFAULT; if (copy_from_user(&new_digi, new_info, sizeof(new_digi))) { DPR_IOCTL(("DIGI_SETA failed copy_from_user\n")); - return(-EFAULT); + return -EFAULT; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -2757,7 +2757,7 @@ static int dgnc_tty_digiseta(struct tty_struct *tty, struct digi_t __user *new_i DPR_IOCTL(("DIGI_SETA finish\n")); - return(0); + return 0; } @@ -3048,19 +3048,19 @@ static int dgnc_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 != DGNC_UNIT_MAGIC) - return (-ENODEV); + return -ENODEV; ch = un->un_ch; if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) - return (-ENODEV); + return -ENODEV; bd = ch->ch_bd; if (!bd || bd->magic != DGNC_BOARD_MAGIC) - return (-ENODEV); + return -ENODEV; DPR_IOCTL(("dgnc_tty_ioctl start on port %d - cmd %s (%x), arg %lx\n", ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); @@ -3070,7 +3070,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, if (un->un_open_count <= 0) { DPR_BASIC(("dgnc_tty_ioctl - unit not open.\n")); DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(-EIO); + return -EIO; } switch (cmd) { @@ -3089,14 +3089,14 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = tty_check_change(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); if (rc) { - return(rc); + return rc; } rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d ", rc)); - return(-EINTR); + return -EINTR; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -3110,7 +3110,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); - return(0); + return 0; case TCSBRKP: @@ -3122,13 +3122,13 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = tty_check_change(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); if (rc) { - return(rc); + return rc; } rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d ", rc)); - return(-EINTR); + return -EINTR; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -3140,19 +3140,19 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); - return(0); + return 0; case TIOCSBRK: rc = tty_check_change(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); if (rc) { - return(rc); + return rc; } rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d ", rc)); - return(-EINTR); + return -EINTR; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -3164,7 +3164,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); - return(0); + return 0; case TIOCCBRK: /* Do Nothing */ @@ -3176,31 +3176,31 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = put_user(C_CLOCAL(tty) ? 1 : 0, (unsigned long __user *) arg); - return(rc); + return rc; case TIOCSSOFTCAR: DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = get_user(arg, (unsigned long __user *) arg); if (rc) - return(rc); + return rc; DGNC_LOCK(ch->ch_lock, lock_flags); tty->termios.c_cflag = ((tty->termios.c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0)); ch->ch_bd->bd_ops->param(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; case TIOCMGET: DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(dgnc_get_modem_info(ch, uarg)); + return dgnc_get_modem_info(ch, uarg); case TIOCMBIS: case TIOCMBIC: case TIOCMSET: DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(dgnc_set_modem_info(tty, cmd, uarg)); + return dgnc_set_modem_info(tty, cmd, uarg); /* * Here are any additional ioctl's that we want to implement @@ -3219,7 +3219,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = tty_check_change(tty); if (rc) { DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(rc); + return rc; } if ((arg == TCIFLUSH) || (arg == TCIOFLUSH)) { @@ -3249,7 +3249,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, /* pretend we didn't recognize this IOCTL */ DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(-ENOIOCTLCMD); + return -ENOIOCTLCMD; case TCSETSF: case TCSETSW: /* @@ -3275,14 +3275,14 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d\n", rc)); - return(-EINTR); + return -EINTR; } DPR_IOCTL(("dgnc_tty_ioctl finish on port %d - cmd %s (%x), arg %lx\n", ch->ch_portnum, dgnc_ioctl_name(cmd), cmd, arg)); /* pretend we didn't recognize this */ - return(-ENOIOCTLCMD); + return -ENOIOCTLCMD; case TCSETAW: @@ -3290,21 +3290,21 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d ", rc)); - return(-EINTR); + return -EINTR; } /* pretend we didn't recognize this */ - return(-ENOIOCTLCMD); + return -ENOIOCTLCMD; case TCXONC: DGNC_UNLOCK(ch->ch_lock, lock_flags); /* Make the ld do it */ - return(-ENOIOCTLCMD); + return -ENOIOCTLCMD; case DIGI_GETA: /* get information for ditty */ DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(dgnc_tty_digigeta(tty, uarg)); + return dgnc_tty_digigeta(tty, uarg); case DIGI_SETAW: case DIGI_SETAF: @@ -3316,7 +3316,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, rc = ch->ch_bd->bd_ops->drain(tty, 0); if (rc) { DPR_IOCTL(("dgnc_tty_ioctl - bad return: %d ", rc)); - return(-EINTR); + return -EINTR; } DGNC_LOCK(ch->ch_lock, lock_flags); } @@ -3327,7 +3327,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, case DIGI_SETA: DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(dgnc_tty_digiseta(tty, uarg)); + return dgnc_tty_digiseta(tty, uarg); case DIGI_LOOPBACK: { @@ -3336,7 +3336,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = get_user(loopback, (unsigned int __user *) arg); if (rc) - return(rc); + return rc; DGNC_LOCK(ch->ch_lock, lock_flags); /* Enable/disable internal loopback for this port */ @@ -3347,13 +3347,13 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, ch->ch_bd->bd_ops->param(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; } case DIGI_GETCUSTOMBAUD: DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = put_user(ch->ch_custom_speed, (unsigned int __user *) arg); - return(rc); + return rc; case DIGI_SETCUSTOMBAUD: { @@ -3362,12 +3362,12 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = get_user(new_rate, (unsigned int __user *) arg); if (rc) - return(rc); + return rc; DGNC_LOCK(ch->ch_lock, lock_flags); dgnc_set_custom_speed(ch, new_rate); ch->ch_bd->bd_ops->param(tty); DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; } /* @@ -3383,11 +3383,11 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = get_user(c, (unsigned char __user *) arg); if (rc) - return(rc); + return rc; DGNC_LOCK(ch->ch_lock, lock_flags); ch->ch_bd->bd_ops->send_immediate_char(ch, c); DGNC_UNLOCK(ch->ch_lock, lock_flags); - return(0); + return 0; } /* @@ -3411,9 +3411,9 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); if (copy_to_user(uarg, &buf, sizeof(buf))) { - return (-EFAULT); + return -EFAULT; } - return(0); + return 0; } /* @@ -3438,7 +3438,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); rc = put_user(events, (unsigned int __user *) arg); - return(rc); + return rc; } /* @@ -3459,7 +3459,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, * Get data from user first. */ if (copy_from_user(&buf, uarg, sizeof(buf))) { - return (-EFAULT); + return -EFAULT; } DGNC_LOCK(ch->ch_lock, lock_flags); @@ -3505,9 +3505,9 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DGNC_UNLOCK(ch->ch_lock, lock_flags); if (copy_to_user(uarg, &buf, sizeof(buf))) { - return (-EFAULT); + return -EFAULT; } - return(0); + return 0; } default: DGNC_UNLOCK(ch->ch_lock, lock_flags); @@ -3516,7 +3516,7 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n", dgnc_ioctl_name(cmd), cmd, arg)); - return(-ENOIOCTLCMD); + return -ENOIOCTLCMD; } DGNC_UNLOCK(ch->ch_lock, lock_flags); @@ -3524,5 +3524,5 @@ static int dgnc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, DPR_IOCTL(("dgnc_tty_ioctl end - cmd %s (%x), arg %lx\n", dgnc_ioctl_name(cmd), cmd, arg)); - return(0); + return 0; } -- 1.8.1.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel