remove redundant check of sbf_port
PATCH 1/1 remove redundant check of sbf_port
From: Thomas Hisch <[email protected]>
remove the check of sbf_port in write and read function because sbf_port was already checked in the init function
Signed-off-by Thomas Hisch <[email protected]>
--- arch/i386/kernel/bootflag.c | 21 ++++++++------------- 1 files changed, 8 insertions(+), 13 deletions(-)
arch/i386/kernel/bootflag.c +8 -13
@@ -41,26 +41,21 @@ static int __init parity(u8 v)static void __init sbf_write (u8 v) {unsigned long flags; -if (sbf_port !=-1 ) - { - v &= ~SBF_PARITY ; -if (!parity (v)) - v|=SBF_PARITY ; - -printk (KERN_INFO "Simple Boot Flag at 0x0 set to 0x0\n" , sbf_port, v); + v &= ~SBF_PARITY ; +if (!parity (v)) + v|=SBF_PARITY ; + +printk (KERN_INFO "Simple Boot Flag at 0x0 set to 0x0\n" , sbf_port, v); -spin_lock_irqsave (&rtc_lock, flags); -CMOS_WRITE (v, sbf_port); -spin_unlock_irqrestore (&rtc_lock, flags); - } +spin_lock_irqsave (&rtc_lock, flags); +CMOS_WRITE (v, sbf_port); +spin_unlock_irqrestore (&rtc_lock, flags); }static u8 __init sbf_read (void ) {u8 v;unsigned long flags; -if (sbf_port =-1 ) -return 0 ;spin_lock_irqsave (&rtc_lock, flags); v =CMOS_READ (sbf_port);spin_unlock_irqrestore (&rtc_lock, flags);
Signature · 8 lines
1.4.2.rc1.gbc9e-dirty _______________________________________________ Kernel-janitors mailing list [email protected] https://lists.osdl.org/mailman/listinfo/kernel-janitors