Skip to content

Commit

Permalink
drivers/char/synclink.c: unbreak mgsl_put_char()
Browse files Browse the repository at this point in the history
Repair the effects of

commit 55da778
Author: Alan Cox <alan@lxorguk.ukuu.org.uk>
Date:   Wed Apr 30 00:54:07 2008 -0700

    synclink series: switch to int put_char method

    Signed-off-by: Alan Cox <alan@redhat.com>
    Cc: Paul Fulghum <paulkf@microgate.com>
    Cc: Jiri Slaby <jirislaby@gmail.com>

drivers/char/synclink_gt.c: In function 'put_char':
drivers/char/synclink_gt.c:919: warning: 'ret' may be used uninitialized in this function

and do some whitespace repair and unneeded-cast-removal in there as well.

Cc: Paul Fulghum <paulkf@microgate.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed May 1, 2008
1 parent 24c03d4 commit 0764823
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2028,13 +2028,13 @@ static void mgsl_change_params(struct mgsl_struct *info)
*/
static int mgsl_put_char(struct tty_struct *tty, unsigned char ch)
{
struct mgsl_struct *info = (struct mgsl_struct *)tty->driver_data;
struct mgsl_struct *info = tty->driver_data;
unsigned long flags;
int ret;
int ret = 0;

if ( debug_level >= DEBUG_LEVEL_INFO ) {
printk( "%s(%d):mgsl_put_char(%d) on %s\n",
__FILE__,__LINE__,ch,info->device_name);
if (debug_level >= DEBUG_LEVEL_INFO) {
printk("%s(%d):mgsl_put_char(%d) on %s\n",
__FILE__, __LINE__, ch, info->device_name);
}

if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char"))
Expand All @@ -2043,17 +2043,17 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch)
if (!tty || !info->xmit_buf)
return 0;

spin_lock_irqsave(&info->irq_spinlock,flags);
spin_lock_irqsave(&info->irq_spinlock, flags);

if ( (info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active ) {
if ((info->params.mode == MGSL_MODE_ASYNC ) || !info->tx_active) {
if (info->xmit_cnt < SERIAL_XMIT_SIZE - 1) {
info->xmit_buf[info->xmit_head++] = ch;
info->xmit_head &= SERIAL_XMIT_SIZE-1;
info->xmit_cnt++;
ret = 1;
}
}
spin_unlock_irqrestore(&info->irq_spinlock,flags);
spin_unlock_irqrestore(&info->irq_spinlock, flags);
return ret;

} /* end of mgsl_put_char() */
Expand Down

0 comments on commit 0764823

Please sign in to comment.