Commit 014c2544 authored by Jesper Juhl's avatar Jesper Juhl Committed by Adrian Bunk
Browse files

return statement cleanup - kill pointless parentheses



This patch removes pointless parentheses from return statements.
Signed-off-by: default avatarJesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 46a9f65f
......@@ -36,7 +36,7 @@ unsigned int csum_partial_copy_nocheck(const unsigned char *src, unsigned char *
int len, int sum)
{
memcpy(dst, src, len);
return(csum_partial(dst, len, sum));
return csum_partial(dst, len, sum);
}
/*
......@@ -104,7 +104,7 @@ static inline unsigned short ip_fast_csum(unsigned char * iph,
: "=r" (sum), "=r" (iph), "=r" (ihl)
: "1" (iph), "2" (ihl)
: "memory");
return(sum);
return sum;
}
/*
......
......@@ -738,7 +738,7 @@ static int __init stallion_module_init(void)
stl_init();
restore_flags(flags);
return(0);
return 0;
}
/*****************************************************************************/
......@@ -889,7 +889,7 @@ static unsigned long stl_atol(char *str)
}
val = (val * base) + c;
}
return(val);
return val;
}
/*****************************************************************************/
......@@ -908,7 +908,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
#endif
if ((argp[0] == (char *) NULL) || (*argp[0] == 0))
return(0);
return 0;
for (sp = argp[0], i = 0; ((*sp != 0) && (i < 25)); sp++, i++)
*sp = TOLOWER(*sp);
......@@ -935,7 +935,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
}
if ((argp[i] != (char *) NULL) && (*argp[i] != 0))
confp->irq = stl_atol(argp[i]);
return(1);
return 1;
}
/*****************************************************************************/
......@@ -946,7 +946,7 @@ static int stl_parsebrd(stlconf_t *confp, char **argp)
static void *stl_memalloc(int len)
{
return((void *) kmalloc(len, GFP_KERNEL));
return (void *) kmalloc(len, GFP_KERNEL);
}
/*****************************************************************************/
......@@ -963,12 +963,12 @@ static stlbrd_t *stl_allocbrd(void)
if (brdp == (stlbrd_t *) NULL) {
printk("STALLION: failed to allocate memory (size=%d)\n",
sizeof(stlbrd_t));
return((stlbrd_t *) NULL);
return (stlbrd_t *) NULL;
}
memset(brdp, 0, sizeof(stlbrd_t));
brdp->magic = STL_BOARDMAGIC;
return(brdp);
return brdp;
}
/*****************************************************************************/
......@@ -988,10 +988,10 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
minordev = tty->index;
brdnr = MINOR2BRD(minordev);
if (brdnr >= stl_nrbrds)
return(-ENODEV);
return -ENODEV;
brdp = stl_brds[brdnr];
if (brdp == (stlbrd_t *) NULL)
return(-ENODEV);
return -ENODEV;
minordev = MINOR2PORT(minordev);
for (portnr = -1, panelnr = 0; (panelnr < STL_MAXPANELS); panelnr++) {
if (brdp->panels[panelnr] == (stlpanel_t *) NULL)
......@@ -1003,11 +1003,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
minordev -= brdp->panels[panelnr]->nrports;
}
if (portnr < 0)
return(-ENODEV);
return -ENODEV;
portp = brdp->panels[panelnr]->ports[portnr];
if (portp == (stlport_t *) NULL)
return(-ENODEV);
return -ENODEV;
/*
* On the first open of the device setup the port hardware, and
......@@ -1021,7 +1021,7 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
if (portp->tx.buf == (char *) NULL) {
portp->tx.buf = (char *) stl_memalloc(STL_TXBUFSIZE);
if (portp->tx.buf == (char *) NULL)
return(-ENOMEM);
return -ENOMEM;
portp->tx.head = portp->tx.buf;
portp->tx.tail = portp->tx.buf;
}
......@@ -1043,8 +1043,8 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
if (portp->flags & ASYNC_CLOSING) {
interruptible_sleep_on(&portp->close_wait);
if (portp->flags & ASYNC_HUP_NOTIFY)
return(-EAGAIN);
return(-ERESTARTSYS);
return -EAGAIN;
return -ERESTARTSYS;
}
/*
......@@ -1054,11 +1054,11 @@ static int stl_open(struct tty_struct *tty, struct file *filp)
*/
if (!(filp->f_flags & O_NONBLOCK)) {
if ((rc = stl_waitcarrier(portp, filp)) != 0)
return(rc);
return rc;
}
portp->flags |= ASYNC_NORMAL_ACTIVE;
return(0);
return 0;
}
/*****************************************************************************/
......@@ -1115,7 +1115,7 @@ static int stl_waitcarrier(stlport_t *portp, struct file *filp)
portp->openwaitcnt--;
restore_flags(flags);
return(rc);
return rc;
}
/*****************************************************************************/
......@@ -1211,12 +1211,12 @@ static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count
if ((tty == (struct tty_struct *) NULL) ||
(stl_tmpwritebuf == (char *) NULL))
return(0);
return 0;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(0);
return 0;
if (portp->tx.buf == (char *) NULL)
return(0);
return 0;
/*
* If copying direct from user space we must cater for page faults,
......@@ -1255,7 +1255,7 @@ static int stl_write(struct tty_struct *tty, const unsigned char *buf, int count
clear_bit(ASYI_TXLOW, &portp->istate);
stl_startrxtx(portp, -1, 1);
return(count);
return count;
}
/*****************************************************************************/
......@@ -1336,16 +1336,16 @@ static int stl_writeroom(struct tty_struct *tty)
#endif
if (tty == (struct tty_struct *) NULL)
return(0);
return 0;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(0);
return 0;
if (portp->tx.buf == (char *) NULL)
return(0);
return 0;
head = portp->tx.head;
tail = portp->tx.tail;
return((head >= tail) ? (STL_TXBUFSIZE - (head - tail) - 1) : (tail - head - 1));
return ((head >= tail) ? (STL_TXBUFSIZE - (head - tail) - 1) : (tail - head - 1));
}
/*****************************************************************************/
......@@ -1370,19 +1370,19 @@ static int stl_charsinbuffer(struct tty_struct *tty)
#endif
if (tty == (struct tty_struct *) NULL)
return(0);
return 0;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(0);
return 0;
if (portp->tx.buf == (char *) NULL)
return(0);
return 0;
head = portp->tx.head;
tail = portp->tx.tail;
size = (head >= tail) ? (head - tail) : (STL_TXBUFSIZE - (tail - head));
if ((size == 0) && test_bit(ASYI_TXBUSY, &portp->istate))
size = 1;
return(size);
return size;
}
/*****************************************************************************/
......@@ -1447,7 +1447,7 @@ static int stl_setserial(stlport_t *portp, struct serial_struct __user *sp)
(sio.close_delay != portp->close_delay) ||
((sio.flags & ~ASYNC_USR_MASK) !=
(portp->flags & ~ASYNC_USR_MASK)))
return(-EPERM);
return -EPERM;
}
portp->flags = (portp->flags & ~ASYNC_USR_MASK) |
......@@ -1457,7 +1457,7 @@ static int stl_setserial(stlport_t *portp, struct serial_struct __user *sp)
portp->closing_wait = sio.closing_wait;
portp->custom_divisor = sio.custom_divisor;
stl_setport(portp, portp->tty->termios);
return(0);
return 0;
}
/*****************************************************************************/
......@@ -1467,12 +1467,12 @@ static int stl_tiocmget(struct tty_struct *tty, struct file *file)
stlport_t *portp;
if (tty == (struct tty_struct *) NULL)
return(-ENODEV);
return -ENODEV;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(-ENODEV);
return -ENODEV;
if (tty->flags & (1 << TTY_IO_ERROR))
return(-EIO);
return -EIO;
return stl_getsignals(portp);
}
......@@ -1484,12 +1484,12 @@ static int stl_tiocmset(struct tty_struct *tty, struct file *file,
int rts = -1, dtr = -1;
if (tty == (struct tty_struct *) NULL)
return(-ENODEV);
return -ENODEV;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(-ENODEV);
return -ENODEV;
if (tty->flags & (1 << TTY_IO_ERROR))
return(-EIO);
return -EIO;
if (set & TIOCM_RTS)
rts = 1;
......@@ -1517,15 +1517,15 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
#endif
if (tty == (struct tty_struct *) NULL)
return(-ENODEV);
return -ENODEV;
portp = tty->driver_data;
if (portp == (stlport_t *) NULL)
return(-ENODEV);
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != COM_GETPORTSTATS) && (cmd != COM_CLRPORTSTATS)) {
if (tty->flags & (1 << TTY_IO_ERROR))
return(-EIO);
return -EIO;
}
rc = 0;
......@@ -1566,7 +1566,7 @@ static int stl_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd
break;
}
return(rc);
return rc;
}
/*****************************************************************************/
......@@ -1872,7 +1872,7 @@ static int stl_portinfo(stlport_t *portp, int portnr, char *pos)
pos[(MAXLINE - 2)] = '+';
pos[(MAXLINE - 1)] = '\n';
return(MAXLINE);
return MAXLINE;
}
/*****************************************************************************/
......@@ -1957,7 +1957,7 @@ static int stl_readproc(char *page, char **start, off_t off, int count, int *eof
stl_readdone:
*start = page;
return(pos - page);
return (pos - page);
}
/*****************************************************************************/
......@@ -2349,7 +2349,7 @@ static inline int stl_initeio(stlbrd_t *brdp)
} else {
rc = 0;
}
return(rc);
return rc;
}
/*****************************************************************************/
......@@ -3116,7 +3116,7 @@ static int __init stl_init(void)
return -1;
}
return(0);
return 0;
}
/*****************************************************************************/
......@@ -3132,7 +3132,7 @@ static int __init stl_init(void)
static int stl_cd1400getreg(stlport_t *portp, int regnr)
{
outb((regnr + portp->uartaddr), portp->ioaddr);
return(inb(portp->ioaddr + EREG_DATA));
return inb(portp->ioaddr + EREG_DATA);
}
static void stl_cd1400setreg(stlport_t *portp, int regnr, int value)
......@@ -3146,9 +3146,9 @@ static int stl_cd1400updatereg(stlport_t *portp, int regnr, int value)
outb((regnr + portp->uartaddr), portp->ioaddr);
if (inb(portp->ioaddr + EREG_DATA) != value) {
outb(value, portp->ioaddr + EREG_DATA);
return(1);
return 1;
}
return(0);
return 0;
}
/*****************************************************************************/
......@@ -3206,7 +3206,7 @@ static int stl_cd1400panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
}
BRDDISABLE(panelp->brdnr);
return(chipmask);
return chipmask;
}
/*****************************************************************************/
......@@ -3557,7 +3557,7 @@ static int stl_cd1400getsignals(stlport_t *portp)
#else
sigs |= TIOCM_DSR;
#endif
return(sigs);
return sigs;
}
/*****************************************************************************/
......@@ -3830,9 +3830,9 @@ static int stl_cd1400datastate(stlport_t *portp)
#endif
if (portp == (stlport_t *) NULL)
return(0);
return 0;
return(test_bit(ASYI_TXBUSY, &portp->istate) ? 1 : 0);
return test_bit(ASYI_TXBUSY, &portp->istate) ? 1 : 0;
}
/*****************************************************************************/
......@@ -3912,20 +3912,20 @@ static inline int stl_cd1400breakisr(stlport_t *portp, int ioaddr)
outb((SRER + portp->uartaddr), ioaddr);
outb((inb(ioaddr + EREG_DATA) & ~(SRER_TXDATA | SRER_TXEMPTY)),
(ioaddr + EREG_DATA));
return(1);
return 1;
} else if (portp->brklen > 1) {
outb((TDR + portp->uartaddr), ioaddr);
outb(ETC_CMD, (ioaddr + EREG_DATA));
outb(ETC_STOPBREAK, (ioaddr + EREG_DATA));
portp->brklen = -1;
return(1);
return 1;
} else {
outb((COR2 + portp->uartaddr), ioaddr);
outb((inb(ioaddr + EREG_DATA) & ~COR2_ETC),
(ioaddr + EREG_DATA));
portp->brklen = 0;
}
return(0);
return 0;
}
/*****************************************************************************/
......@@ -4166,7 +4166,7 @@ static void stl_cd1400mdmisr(stlpanel_t *panelp, int ioaddr)
static int stl_sc26198getreg(stlport_t *portp, int regnr)
{
outb((regnr | portp->uartaddr), (portp->ioaddr + XP_ADDR));
return(inb(portp->ioaddr + XP_DATA));
return inb(portp->ioaddr + XP_DATA);
}
static void stl_sc26198setreg(stlport_t *portp, int regnr, int value)
......@@ -4180,9 +4180,9 @@ static int stl_sc26198updatereg(stlport_t *portp, int regnr, int value)
outb((regnr | portp->uartaddr), (portp->ioaddr + XP_ADDR));
if (inb(portp->ioaddr + XP_DATA) != value) {
outb(value, (portp->ioaddr + XP_DATA));
return(1);
return 1;
}
return(0);
return 0;
}
/*****************************************************************************/
......@@ -4194,7 +4194,7 @@ static int stl_sc26198updatereg(stlport_t *portp, int regnr, int value)
static int stl_sc26198getglobreg(stlport_t *portp, int regnr)
{
outb(regnr, (portp->ioaddr + XP_ADDR));
return(inb(portp->ioaddr + XP_DATA));
return inb(portp->ioaddr + XP_DATA);
}
#if 0
......@@ -4252,7 +4252,7 @@ static int stl_sc26198panelinit(stlbrd_t *brdp, stlpanel_t *panelp)
}
BRDDISABLE(panelp->brdnr);
return(chipmask);
return chipmask;
}
/*****************************************************************************/
......@@ -4546,7 +4546,7 @@ static int stl_sc26198getsignals(stlport_t *portp)
sigs |= (ipr & IPR_DTR) ? 0: TIOCM_DTR;
sigs |= (ipr & IPR_RTS) ? 0: TIOCM_RTS;
sigs |= TIOCM_DSR;
return(sigs);
return sigs;
}
/*****************************************************************************/
......@@ -4828,9 +4828,9 @@ static int stl_sc26198datastate(stlport_t *portp)
#endif
if (portp == (stlport_t *) NULL)
return(0);
return 0;
if (test_bit(ASYI_TXBUSY, &portp->istate))
return(1);
return 1;
save_flags(flags);
cli();
......@@ -4839,7 +4839,7 @@ static int stl_sc26198datastate(stlport_t *portp)
BRDDISABLE(portp->brdnr);
restore_flags(flags);
return((sr & SR_TXEMPTY) ? 0 : 1);
return (sr & SR_TXEMPTY) ? 0 : 1;
}
/*****************************************************************************/
......
......@@ -222,12 +222,13 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
sblock);
#endif
}
return(sblock);
return sblock;
}
static int efs_validate_super(struct efs_sb_info *sb, struct efs_super *super) {
if (!IS_EFS_MAGIC(be32_to_cpu(super->fs_magic))) return -1;
if (!IS_EFS_MAGIC(be32_to_cpu(super->fs_magic)))
return -1;
sb->fs_magic = be32_to_cpu(super->fs_magic);
sb->total_blocks = be32_to_cpu(super->fs_size);
......
......@@ -497,7 +497,7 @@ xfs_qm_dqflush_all(
int error;
if (mp->m_quotainfo == NULL)
return (0);
return 0;
niters = 0;
again:
xfs_qm_mplist_lock(mp);
......@@ -528,7 +528,7 @@ again:
error = xfs_qm_dqflush(dqp, flags);
xfs_dqunlock(dqp);
if (error)
return (error);
return error;
xfs_qm_mplist_lock(mp);
if (recl != XFS_QI_MPLRECLAIMS(mp)) {
......@@ -540,7 +540,7 @@ again:
xfs_qm_mplist_unlock(mp);
/* return ! busy */
return (0);
return 0;
}
/*
* Release the group dquot pointers the user dquots may be
......@@ -599,7 +599,7 @@ xfs_qm_dqpurge_int(
int nmisses;
if (mp->m_quotainfo == NULL)
return (0);
return 0;
dqtype = (flags & XFS_QMOPT_UQUOTA) ? XFS_DQ_USER : 0;
dqtype |= (flags & XFS_QMOPT_PQUOTA) ? XFS_DQ_PROJ : 0;
......@@ -796,7 +796,7 @@ xfs_qm_dqattach_one(
ASSERT(XFS_DQ_IS_LOCKED(dqp));
}
#endif
return (error);
return error;
}
......@@ -897,7 +897,7 @@ xfs_qm_dqattach(
(! XFS_NOT_DQATTACHED(mp, ip)) ||
(ip->i_ino == mp->m_sb.sb_uquotino) ||
(ip->i_ino == mp->m_sb.sb_gquotino))
return (0);
return 0;
ASSERT((flags & XFS_QMOPT_ILOCKED) == 0 ||
XFS_ISLOCKED_INODE_EXCL(ip));
......@@ -984,7 +984,7 @@ xfs_qm_dqattach(
else
ASSERT(XFS_ISLOCKED_INODE_EXCL(ip));
#endif
return (error);
return error;
}
/*
......@@ -1049,7 +1049,7 @@ xfs_qm_sync(
*/
if (! XFS_IS_QUOTA_ON(mp)) {
xfs_qm_mplist_unlock(mp);
return (0);
return 0;
}
FOREACH_DQUOT_IN_MP(dqp, mp) {
/*
......@@ -1109,9 +1109,9 @@ xfs_qm_sync(
error = xfs_qm_dqflush(dqp, flush_flags);
xfs_dqunlock(dqp);
if (error && XFS_FORCED_SHUTDOWN(mp))
return(0); /* Need to prevent umount failure */
return 0; /* Need to prevent umount failure */
else if (error)
return (error);
return error;
xfs_qm_mplist_lock(mp);
if (recl != XFS_QI_MPLRECLAIMS(mp)) {
......@@ -1124,7 +1124,7 @@ xfs_qm_sync(
}
xfs_qm_mplist_unlock(mp);
return (0);
return 0;
}
......@@ -1146,7 +1146,7 @@ xfs_qm_init_quotainfo(
* Tell XQM that we exist as soon as possible.
*/
if ((error = xfs_qm_hold_quotafs_ref(mp))) {
return (error);
return error;
}
qinf = mp->m_quotainfo = kmem_zalloc(sizeof(xfs_quotainfo_t), KM_SLEEP);
......@@ -1158,7 +1158,7 @@ xfs_qm_init_quotainfo(
if ((error = xfs_qm_init_quotainos(mp))) {
kmem_free(qinf, sizeof(xfs_quotainfo_t));
mp->m_quotainfo = NULL;
return (error);
return error;
}
spinlock_init(&qinf->qi_pinlock, "xfs_qinf_pin");
......@@ -1232,7 +1232,7 @@ xfs_qm_init_quotainfo(
qinf->qi_rtbwarnlimit = XFS_QM_RTBWARNLIMIT;
}
return (0);
return 0;
}
......@@ -1332,7 +1332,7 @@ xfs_qm_dqget_noattach(
*/
ASSERT(error != ESRCH);
ASSERT(error != ENOENT);
return (error);
return error;
}
ASSERT(udqp);
}
......@@ -1355,7 +1355,7 @@ xfs_qm_dqget_noattach(
xfs_qm_dqrele(udqp);
ASSERT(error != ESRCH);
ASSERT(error != ENOENT);
return (error);
return error;
}
ASSERT(gdqp);
......@@ -1376,7 +1376,7 @@ xfs_qm_dqget_noattach(
if (udqp) ASSERT(XFS_DQ_IS_LOCKED(udqp));
if (gdqp) ASSERT(XFS_DQ_IS_LOCKED(gdqp));
#endif
return (0);
return 0;
}
/*
......@@ -1404,7 +1404,7 @@ xfs_qm_qino_alloc(
XFS_TRANS_PERM_LOG_RES,
XFS_CREATE_LOG_COUNT))) {
xfs_trans_cancel(tp, 0);
return (error);
return error;
}
memset(&zerocr, 0, sizeof(zerocr));
memset(&zeroino, 0, sizeof(zeroino));
......@@ -1413,7 +1413,7 @@ xfs_qm_qino_alloc(
&zerocr, 0, 1, ip, &committed))) {
xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES |
XFS_TRANS_ABORT);
return (error);
return error;