Commit 8f90ef80 authored by Lidza Louina's avatar Lidza Louina Committed by Greg Kroah-Hartman

staging: dgnc: removes parentheses around return statements

This patch removes parentheses around return
statements. They aren't needed.
Signed-off-by: default avatarLidza Louina <lidza.louina@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 03425f55
......@@ -976,17 +976,17 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
int rc = 0;
if (!tty || tty->magic != TTY_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
un = (struct un_t *) tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
DGNC_LOCK(ch->ch_lock, lock_flags);
......@@ -1002,7 +1002,7 @@ static int cls_drain(struct tty_struct *tty, uint seconds)
if (rc)
DPR_IOCTL(("%d Drain - User ctrl c'ed\n", __LINE__));
return (rc);
return rc;
}
......
......@@ -225,7 +225,7 @@ int dgnc_init_module(void)
rc = dgnc_start();
if (rc < 0) {
return(rc);
return rc;
}
/*
......@@ -250,7 +250,7 @@ int dgnc_init_module(void)
}
DPR_INIT(("Finished init_module. Returning %d\n", rc));
return (rc);
return rc;
}
......@@ -286,7 +286,7 @@ static int dgnc_start(void)
if (rc <= 0) {
APR(("Can't register dgnc driver device (%d)\n", rc));
rc = -ENXIO;
return(rc);
return rc;
}
dgnc_Major = rc;
......@@ -311,7 +311,7 @@ static int dgnc_start(void)
if (rc < 0) {
APR(("tty preinit - not enough memory (%d)\n", rc));
return(rc);
return rc;
}
/* Start the poller */
......@@ -328,7 +328,7 @@ static int dgnc_start(void)
dgnc_driver_state = DRIVER_READY;
}
return(rc);
return rc;
}
/*
......@@ -502,7 +502,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
(struct dgnc_board *) kzalloc(sizeof(struct dgnc_board), GFP_KERNEL);
if (!brd) {
APR(("memory allocation for board structure failed\n"));
return(-ENOMEM);
return -ENOMEM;
}
/* make a temporary message buffer for the boot messages */
......@@ -511,7 +511,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
if (!brd->msgbuf) {
kfree(brd);
APR(("memory allocation for board msgbuf failed\n"));
return(-ENOMEM);
return -ENOMEM;
}
/* store the info for the board we've found */
......@@ -663,7 +663,7 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
default:
APR(("Did not find any compatible Neo or Classic PCI boards in system.\n"));
return (-ENXIO);
return -ENXIO;
}
......@@ -725,11 +725,11 @@ static int dgnc_found_board(struct pci_dev *pdev, int id)
wake_up_interruptible(&brd->state_wait);
return(0);
return 0;
failed:
return (-ENXIO);
return -ENXIO;
}
......@@ -740,7 +740,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) {
DPR_INIT(("dgnc_finalize_board_init() - start\n"));
if (!brd || brd->magic != DGNC_BOARD_MAGIC)
return(-ENODEV);
return -ENODEV;
DPR_INIT(("dgnc_finalize_board_init() - start #2\n"));
......@@ -756,7 +756,7 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd) {
DPR_INIT(("Requested and received usage of IRQ %d\n", brd->irq));
}
}
return(rc);
return rc;
}
/*
......@@ -900,7 +900,7 @@ int dgnc_ms_sleep(ulong ms)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout((ms * HZ) / 1000);
return (signal_pending(current));
return signal_pending(current);
}
......@@ -912,47 +912,47 @@ char *dgnc_ioctl_name(int cmd)
{
switch(cmd) {
case TCGETA: return("TCGETA");
case TCGETS: return("TCGETS");
case TCSETA: return("TCSETA");
case TCSETS: return("TCSETS");
case TCSETAW: return("TCSETAW");
case TCSETSW: return("TCSETSW");
case TCSETAF: return("TCSETAF");
case TCSETSF: return("TCSETSF");
case TCSBRK: return("TCSBRK");
case TCXONC: return("TCXONC");
case TCFLSH: return("TCFLSH");
case TIOCGSID: return("TIOCGSID");
case TIOCGETD: return("TIOCGETD");
case TIOCSETD: return("TIOCSETD");
case TIOCGWINSZ: return("TIOCGWINSZ");
case TIOCSWINSZ: return("TIOCSWINSZ");
case TIOCMGET: return("TIOCMGET");
case TIOCMSET: return("TIOCMSET");
case TIOCMBIS: return("TIOCMBIS");
case TIOCMBIC: return("TIOCMBIC");
case TCGETA: return "TCGETA";
case TCGETS: return "TCGETS";
case TCSETA: return "TCSETA";
case TCSETS: return "TCSETS";
case TCSETAW: return "TCSETAW";
case TCSETSW: return "TCSETSW";
case TCSETAF: return "TCSETAF";
case TCSETSF: return "TCSETSF";
case TCSBRK: return "TCSBRK";
case TCXONC: return "TCXONC";
case TCFLSH: return "TCFLSH";
case TIOCGSID: return "TIOCGSID";
case TIOCGETD: return "TIOCGETD";
case TIOCSETD: return "TIOCSETD";
case TIOCGWINSZ: return "TIOCGWINSZ";
case TIOCSWINSZ: return "TIOCSWINSZ";
case TIOCMGET: return "TIOCMGET";
case TIOCMSET: return "TIOCMSET";
case TIOCMBIS: return "TIOCMBIS";
case TIOCMBIC: return "TIOCMBIC";
/* from digi.h */
case DIGI_SETA: return("DIGI_SETA");
case DIGI_SETAW: return("DIGI_SETAW");
case DIGI_SETAF: return("DIGI_SETAF");
case DIGI_SETFLOW: return("DIGI_SETFLOW");
case DIGI_SETAFLOW: return("DIGI_SETAFLOW");
case DIGI_GETFLOW: return("DIGI_GETFLOW");
case DIGI_GETAFLOW: return("DIGI_GETAFLOW");
case DIGI_GETA: return("DIGI_GETA");
case DIGI_GEDELAY: return("DIGI_GEDELAY");
case DIGI_SEDELAY: return("DIGI_SEDELAY");
case DIGI_GETCUSTOMBAUD: return("DIGI_GETCUSTOMBAUD");
case DIGI_SETCUSTOMBAUD: return("DIGI_SETCUSTOMBAUD");
case TIOCMODG: return("TIOCMODG");
case TIOCMODS: return("TIOCMODS");
case TIOCSDTR: return("TIOCSDTR");
case TIOCCDTR: return("TIOCCDTR");
default: return("unknown");
case DIGI_SETA: return "DIGI_SETA";
case DIGI_SETAW: return "DIGI_SETAW";
case DIGI_SETAF: return "DIGI_SETAF";
case DIGI_SETFLOW: return "DIGI_SETFLOW";
case DIGI_SETAFLOW: return "DIGI_SETAFLOW";
case DIGI_GETFLOW: return "DIGI_GETFLOW";
case DIGI_GETAFLOW: return "DIGI_GETAFLOW";
case DIGI_GETA: return "DIGI_GETA";
case DIGI_GEDELAY: return "DIGI_GEDELAY";
case DIGI_SEDELAY: return "DIGI_SEDELAY";
case DIGI_GETCUSTOMBAUD: return "DIGI_GETCUSTOMBAUD";
case DIGI_SETCUSTOMBAUD: return "DIGI_SETCUSTOMBAUD";
case TIOCMODG: return "TIOCMODG";
case TIOCMODS: return "TIOCMODS";
case TIOCSDTR: return "TIOCSDTR";
case TIOCCDTR: return "TIOCCDTR";
default: return "unknown";
}
}
......@@ -74,13 +74,13 @@ int dgnc_mgmt_open(struct inode *inode, struct file *file)
/* Only allow 1 open at a time on mgmt device */
if (dgnc_mgmt_in_use[minor]) {
DGNC_UNLOCK(dgnc_global_lock, lock_flags);
return (-EBUSY);
return -EBUSY;
}
dgnc_mgmt_in_use[minor]++;
}
else {
DGNC_UNLOCK(dgnc_global_lock, lock_flags);
return (-ENXIO);
return -ENXIO;
}
DGNC_UNLOCK(dgnc_global_lock, lock_flags);
......@@ -154,7 +154,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
ddi.dinfo_nboards, ddi.dinfo_version));
if (copy_to_user(uarg, &ddi, sizeof (ddi)))
return(-EFAULT);
return -EFAULT;
break;
}
......@@ -166,13 +166,13 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
struct digi_info di;
if (copy_from_user(&brd, uarg, sizeof(int))) {
return(-EFAULT);
return -EFAULT;
}
DPR_MGMT(("DIGI_GETBD asking about board: %d\n", brd));
if ((brd < 0) || (brd > dgnc_NumBoards) || (dgnc_NumBoards == 0))
return (-ENODEV);
return -ENODEV;
memset(&di, 0, sizeof(di));
......@@ -196,7 +196,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
di.info_bdtype, di.info_bdstate, di.info_nports, di.info_physsize));
if (copy_to_user(uarg, &di, sizeof (di)))
return (-EFAULT);
return -EFAULT;
break;
}
......@@ -210,7 +210,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
uint channel = 0;
if (copy_from_user(&ni, uarg, sizeof(struct ni_info))) {
return(-EFAULT);
return -EFAULT;
}
DPR_MGMT(("DIGI_GETBD asking about board: %d channel: %d\n",
......@@ -221,16 +221,16 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* Verify boundaries on board */
if ((board < 0) || (board > dgnc_NumBoards) || (dgnc_NumBoards == 0))
return (-ENODEV);
return -ENODEV;
/* Verify boundaries on channel */
if ((channel < 0) || (channel > dgnc_Board[board]->nasync))
return (-ENODEV);
return -ENODEV;
ch = dgnc_Board[board]->channels[channel];
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
return (-ENODEV);
return -ENODEV;
memset(&ni, 0, sizeof(ni));
ni.board = board;
......@@ -291,7 +291,7 @@ long dgnc_mgmt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
DGNC_UNLOCK(ch->ch_lock, lock_flags);
if (copy_to_user(uarg, &ni, sizeof(ni)))
return (-EFAULT);
return -EFAULT;
break;
}
......
......@@ -1404,17 +1404,17 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
int rc = 0;
if (!tty || tty->magic != TTY_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
un = (struct un_t *) tty->driver_data;
if (!un || un->magic != DGNC_UNIT_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
ch = un->un_ch;
if (!ch || ch->magic != DGNC_CHANNEL_MAGIC) {
return (-ENXIO);
return -ENXIO;
}
DPR_IOCTL(("%d Drain wait started.\n", __LINE__));
......@@ -1439,7 +1439,7 @@ static int neo_drain(struct tty_struct *tty, uint seconds)
DPR_IOCTL(("%d Drain wait finished.\n", __LINE__));
}
return (rc);
return rc;
}
......
......@@ -152,13 +152,13 @@ void dgnc_remove_driver_sysfiles(struct pci_driver *dgnc_driver)
#define DGNC_VERIFY_BOARD(p, bd) \
if (!p) \
return (0); \
return 0; \
\
bd = dev_get_drvdata(p); \
if (!bd || bd->magic != DGNC_BOARD_MAGIC) \
return (0); \
return 0; \
if (bd->state != BOARD_READY) \
return (0); \
return 0; \
......@@ -432,18 +432,18 @@ static ssize_t dgnc_tty_state_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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");
}
......@@ -457,18 +457,18 @@ static ssize_t dgnc_tty_baud_show(struct device *d, struct device_attribute *att
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0);
return 0;
if (bd->state != BOARD_READY)
return (0);
return 0;
return snprintf(buf, PAGE_SIZE, "%d\n", ch->ch_old_baud);
}
......@@ -482,18 +482,18 @@ static ssize_t dgnc_tty_msignals_show(struct device *d, struct device_attribute
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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",
......@@ -516,18 +516,18 @@ static ssize_t dgnc_tty_iflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -541,18 +541,18 @@ static ssize_t dgnc_tty_cflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -566,18 +566,18 @@ static ssize_t dgnc_tty_oflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -591,18 +591,18 @@ static ssize_t dgnc_tty_lflag_show(struct device *d, struct device_attribute *at
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -616,18 +616,18 @@ static ssize_t dgnc_tty_digi_flag_show(struct device *d, struct device_attribute
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -641,18 +641,18 @@ static ssize_t dgnc_tty_rxcount_show(struct device *d, struct device_attribute *
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -666,18 +666,18 @@ static ssize_t dgnc_tty_txcount_show(struct device *d, struct device_attribute *
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_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);
}
......@@ -691,18 +691,18 @@ static ssize_t dgnc_tty_name_show(struct device *d, struct device_attribute *att
struct un_t *un;
if (!d)
return (0);
return 0;
un = (struct un_t *) dev_get_drvdata(d);
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;
bd = ch->ch_bd;
if (!bd || bd->magic != DGNC_BOARD_MAGIC)
return (0);
return 0;
if (bd->state != BOARD_READY)
return (0);
return 0;
return snprintf(buf, PAGE_SIZE, "%sn%d%c\n",
(un->un_type == DGNC_PRINT) ? "pr" : "tty",
......
This diff is collapsed.
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