Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Kill conditionals that are always true. Drop a dead...



details:   https://anonhg.NetBSD.org/src/rev/e8aa9e7020c5
branches:  trunk
changeset: 779723:e8aa9e7020c5
user:      joerg <joerg%NetBSD.org@localhost>
date:      Wed Jun 13 23:00:05 2012 +0000

description:
Kill conditionals that are always true. Drop a dead assignment.

diffstat:

 sys/kern/kern_cpu.c |  12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diffs (44 lines):

diff -r d904cd4a2673 -r e8aa9e7020c5 sys/kern/kern_cpu.c
--- a/sys/kern/kern_cpu.c       Wed Jun 13 22:56:50 2012 +0000
+++ b/sys/kern/kern_cpu.c       Wed Jun 13 23:00:05 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_cpu.c,v 1.55 2012/01/29 22:55:40 rmind Exp $      */
+/*     $NetBSD: kern_cpu.c,v 1.56 2012/06/13 23:00:05 joerg Exp $      */
 
 /*-
  * Copyright (c) 2007, 2008, 2009, 2010, 2012 The NetBSD Foundation, Inc.
@@ -56,7 +56,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.55 2012/01/29 22:55:40 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.56 2012/06/13 23:00:05 joerg Exp $");
 
 #include "opt_cpu_ucode.h"
 
@@ -207,8 +207,7 @@
        mutex_enter(&cpu_lock);
        switch (cmd) {
        case IOC_CPU_SETSTATE:
-               if (error == 0)
-                       cs = data;
+               cs = data;
                error = kauth_authorize_system(l->l_cred,
                    KAUTH_SYSTEM_CPU, KAUTH_REQ_SYSTEM_CPU_SETSTATE, cs, NULL,
                    NULL);
@@ -219,13 +218,12 @@
                        error = ESRCH;
                        break;
                }
-               error = cpu_setintr(ci, cs->cs_intr);
+               cpu_setintr(ci, cs->cs_intr);
                error = cpu_setstate(ci, cs->cs_online);
                break;
 
        case IOC_CPU_GETSTATE:
-               if (error == 0)
-                       cs = data;
+               cs = data;
                id = cs->cs_id;
                memset(cs, 0, sizeof(*cs));
                cs->cs_id = id;



Home | Main Index | Thread Index | Old Index