Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64-SGI] sn_console.c minor cleanup

Fix printk level and remove unnecessary CONFIG_SMP|CONFIG_PREEMPT tests
as this is taken care through the spinlock macros anyway.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Signed-off-by: Pat Gefre <pfg@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Jes Sorensen and committed by
Tony Luck
d171e519 f9e505a9

+59 -72
+59 -72
drivers/serial/sn_console.c
··· 6 6 * driver for that. 7 7 * 8 8 * 9 - * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved. 9 + * Copyright (c) 2004-2006 Silicon Graphics, Inc. All Rights Reserved. 10 10 * 11 11 * This program is free software; you can redistribute it and/or modify it 12 12 * under the terms of version 2 of the GNU General Public License ··· 829 829 misc.name = DEVICE_NAME_DYNAMIC; 830 830 retval = misc_register(&misc); 831 831 if (retval != 0) { 832 - printk 833 - ("Failed to register console device using misc_register.\n"); 832 + printk(KERN_WARNING "Failed to register console " 833 + "device using misc_register.\n"); 834 834 return -ENODEV; 835 835 } 836 836 sal_console_uart.major = MISC_MAJOR; ··· 942 942 { 943 943 unsigned long flags = 0; 944 944 struct sn_cons_port *port = &sal_console_port; 945 - #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) 946 945 static int stole_lock = 0; 947 - #endif 948 946 949 947 BUG_ON(!port->sc_is_asynch); 950 948 951 949 /* We can't look at the xmit buffer if we're not registered with serial core 952 950 * yet. So only do the fancy recovery after registering 953 951 */ 954 - if (port->sc_port.info) { 952 + if (!port->sc_port.info) { 953 + /* Not yet registered with serial core - simple case */ 954 + puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); 955 + return; 956 + } 955 957 956 - /* somebody really wants this output, might be an 957 - * oops, kdb, panic, etc. make sure they get it. */ 958 - #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) 959 - if (spin_is_locked(&port->sc_port.lock)) { 960 - int lhead = port->sc_port.info->xmit.head; 961 - int ltail = port->sc_port.info->xmit.tail; 962 - int counter, got_lock = 0; 958 + /* somebody really wants this output, might be an 959 + * oops, kdb, panic, etc. make sure they get it. */ 960 + if (spin_is_locked(&port->sc_port.lock)) { 961 + int lhead = port->sc_port.info->xmit.head; 962 + int ltail = port->sc_port.info->xmit.tail; 963 + int counter, got_lock = 0; 963 964 964 - /* 965 - * We attempt to determine if someone has died with the 966 - * lock. We wait ~20 secs after the head and tail ptrs 967 - * stop moving and assume the lock holder is not functional 968 - * and plow ahead. If the lock is freed within the time out 969 - * period we re-get the lock and go ahead normally. We also 970 - * remember if we have plowed ahead so that we don't have 971 - * to wait out the time out period again - the asumption 972 - * is that we will time out again. 973 - */ 965 + /* 966 + * We attempt to determine if someone has died with the 967 + * lock. We wait ~20 secs after the head and tail ptrs 968 + * stop moving and assume the lock holder is not functional 969 + * and plow ahead. If the lock is freed within the time out 970 + * period we re-get the lock and go ahead normally. We also 971 + * remember if we have plowed ahead so that we don't have 972 + * to wait out the time out period again - the asumption 973 + * is that we will time out again. 974 + */ 974 975 975 - for (counter = 0; counter < 150; mdelay(125), counter++) { 976 - if (!spin_is_locked(&port->sc_port.lock) 977 - || stole_lock) { 978 - if (!stole_lock) { 979 - spin_lock_irqsave(&port-> 980 - sc_port.lock, 981 - flags); 982 - got_lock = 1; 983 - } 984 - break; 985 - } else { 986 - /* still locked */ 987 - if ((lhead != 988 - port->sc_port.info->xmit.head) 989 - || (ltail != 990 - port->sc_port.info->xmit. 991 - tail)) { 992 - lhead = 993 - port->sc_port.info->xmit. 994 - head; 995 - ltail = 996 - port->sc_port.info->xmit. 997 - tail; 998 - counter = 0; 999 - } 976 + for (counter = 0; counter < 150; mdelay(125), counter++) { 977 + if (!spin_is_locked(&port->sc_port.lock) 978 + || stole_lock) { 979 + if (!stole_lock) { 980 + spin_lock_irqsave(&port->sc_port.lock, 981 + flags); 982 + got_lock = 1; 983 + } 984 + break; 985 + } else { 986 + /* still locked */ 987 + if ((lhead != port->sc_port.info->xmit.head) 988 + || (ltail != 989 + port->sc_port.info->xmit.tail)) { 990 + lhead = 991 + port->sc_port.info->xmit.head; 992 + ltail = 993 + port->sc_port.info->xmit.tail; 994 + counter = 0; 1000 995 } 1001 996 } 1002 - /* flush anything in the serial core xmit buffer, raw */ 1003 - sn_transmit_chars(port, 1); 1004 - if (got_lock) { 1005 - spin_unlock_irqrestore(&port->sc_port.lock, 1006 - flags); 1007 - stole_lock = 0; 1008 - } else { 1009 - /* fell thru */ 1010 - stole_lock = 1; 1011 - } 1012 - puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); 1013 - } else { 1014 - stole_lock = 0; 1015 - #endif 1016 - spin_lock_irqsave(&port->sc_port.lock, flags); 1017 - sn_transmit_chars(port, 1); 1018 - spin_unlock_irqrestore(&port->sc_port.lock, flags); 1019 - 1020 - puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); 1021 - #if defined(CONFIG_SMP) || defined(CONFIG_PREEMPT) 1022 997 } 1023 - #endif 1024 - } 1025 - else { 1026 - /* Not yet registered with serial core - simple case */ 998 + /* flush anything in the serial core xmit buffer, raw */ 999 + sn_transmit_chars(port, 1); 1000 + if (got_lock) { 1001 + spin_unlock_irqrestore(&port->sc_port.lock, flags); 1002 + stole_lock = 0; 1003 + } else { 1004 + /* fell thru */ 1005 + stole_lock = 1; 1006 + } 1007 + puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); 1008 + } else { 1009 + stole_lock = 0; 1010 + spin_lock_irqsave(&port->sc_port.lock, flags); 1011 + sn_transmit_chars(port, 1); 1012 + spin_unlock_irqrestore(&port->sc_port.lock, flags); 1013 + 1027 1014 puts_raw_fixed(port->sc_ops->sal_puts_raw, s, count); 1028 1015 } 1029 1016 }