Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe Ensure variables are initialized. Fixes e...



details:   https://anonhg.NetBSD.org/src/rev/a596c3a0cf97
branches:  trunk
changeset: 819601:a596c3a0cf97
user:      nat <nat%NetBSD.org@localhost>
date:      Sun Dec 11 05:27:00 2016 +0000

description:
Ensure variables are initialized.  Fixes error due to -Wmaybe-unitialized.

diffstat:

 sys/dev/raidframe/rf_dagffrd.c |   8 ++++++--
 sys/dev/raidframe/rf_engine.c  |  10 ++++------
 2 files changed, 10 insertions(+), 8 deletions(-)

diffs (73 lines):

diff -r 61bf1bac7c39 -r a596c3a0cf97 sys/dev/raidframe/rf_dagffrd.c
--- a/sys/dev/raidframe/rf_dagffrd.c    Sun Dec 11 03:40:57 2016 +0000
+++ b/sys/dev/raidframe/rf_dagffrd.c    Sun Dec 11 05:27:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_dagffrd.c,v 1.19 2013/09/15 12:23:06 martin Exp $   */
+/*     $NetBSD: rf_dagffrd.c,v 1.20 2016/12/11 05:27:00 nat Exp $      */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.19 2013/09/15 12:23:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_dagffrd.c,v 1.20 2016/12/11 05:27:00 nat Exp $");
 
 #include <dev/raidframe/raidframevar.h>
 
@@ -139,6 +139,10 @@
        n = asmap->numStripeUnitsAccessed;
        dag_h->creator = "NonredundantDAG";
 
+       doFunc = rf_NullNodeFunc;
+       undoFunc = rf_NullNodeUndoFunc;
+       name = NULL;
+
        RF_ASSERT(RF_IO_IS_R_OR_W(type));
        switch (type) {
        case RF_IO_TYPE_READ:
diff -r 61bf1bac7c39 -r a596c3a0cf97 sys/dev/raidframe/rf_engine.c
--- a/sys/dev/raidframe/rf_engine.c     Sun Dec 11 03:40:57 2016 +0000
+++ b/sys/dev/raidframe/rf_engine.c     Sun Dec 11 05:27:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_engine.c,v 1.51 2016/01/03 08:17:24 mlelstv Exp $   */
+/*     $NetBSD: rf_engine.c,v 1.52 2016/12/11 05:27:00 nat Exp $       */
 /*
  * Copyright (c) 1995 Carnegie-Mellon University.
  * All rights reserved.
@@ -55,7 +55,7 @@
  ****************************************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.51 2016/01/03 08:17:24 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_engine.c,v 1.52 2016/12/11 05:27:00 nat Exp $");
 
 #include <sys/errno.h>
 
@@ -229,14 +229,14 @@
 {
        int     ready;
 
+       ready = RF_FALSE;
+
        switch (node->dagHdr->status) {
        case rf_enable:
        case rf_rollForward:
                if ((node->status == rf_wait) &&
                    (node->numAntecedents == node->numAntDone))
                        ready = RF_TRUE;
-               else
-                       ready = RF_FALSE;
                break;
        case rf_rollBackward:
                RF_ASSERT(node->numSuccDone <= node->numSuccedents);
@@ -245,8 +245,6 @@
                if ((node->status == rf_good) &&
                    (node->numSuccDone == node->numSuccedents))
                        ready = RF_TRUE;
-               else
-                       ready = RF_FALSE;
                break;
        default:
                printf("Execution engine found illegal DAG status in NodeReady\n");



Home | Main Index | Thread Index | Old Index