From: Andrew Morton Date: Thu, 1 May 2008 11:35:18 +0000 (-0700) Subject: drivers/char/synclink.c: unbreak mgsl_put_char() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=076482307ff1acfe88d5ad1a3fbfbac5cc8d7ad4;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git drivers/char/synclink.c: unbreak mgsl_put_char() Repair the effects of commit 55da77899c1472d83452c914fa179d00ea96df65 Author: Alan Cox Date: Wed Apr 30 00:54:07 2008 -0700 synclink series: switch to int put_char method Signed-off-by: Alan Cox Cc: Paul Fulghum Cc: Jiri Slaby 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 Cc: Alan Cox Cc: Jiri Slaby Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/synclink.c b/drivers/char/synclink.c index 513b7c2f3e26..384464b016a8 100644 --- a/drivers/char/synclink.c +++ b/drivers/char/synclink.c @@ -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")) @@ -2043,9 +2043,9 @@ 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; @@ -2053,7 +2053,7 @@ static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) ret = 1; } } - spin_unlock_irqrestore(&info->irq_spinlock,flags); + spin_unlock_irqrestore(&info->irq_spinlock, flags); return ret; } /* end of mgsl_put_char() */