Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/raidframe make various things static, and minor KNF ...



details:   https://anonhg.NetBSD.org/src/rev/5c471f423eb3
branches:  trunk
changeset: 379262:5c471f423eb3
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon May 24 07:43:15 2021 +0000

description:
make various things static, and minor KNF clean up.
ignore spiflash as a raid device.

diffstat:

 sys/dev/raidframe/rf_netbsdkintf.c |  89 +++++++++++++++++++------------------
 1 files changed, 46 insertions(+), 43 deletions(-)

diffs (252 lines):

diff -r a8ba743517bf -r 5c471f423eb3 sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Mon May 24 07:27:39 2021 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Mon May 24 07:43:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.392 2021/04/26 07:27:24 mrg Exp $ */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.393 2021/05/24 07:43:15 mrg Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2008-2011 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  ***********************************************************/
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.392 2021/04/26 07:27:24 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rf_netbsdkintf.c,v 1.393 2021/05/24 07:43:15 mrg Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_raid_autoconfig.h"
@@ -300,24 +300,23 @@ static int raid_detach_unlocked(struct r
 static void rf_markalldirty(RF_Raid_t *);
 static void rf_set_geometry(struct raid_softc *, RF_Raid_t *);
 
-void rf_ReconThread(struct rf_recon_req_internal *);
-void rf_RewriteParityThread(RF_Raid_t *raidPtr);
-void rf_CopybackThread(RF_Raid_t *raidPtr);
-void rf_ReconstructInPlaceThread(struct rf_recon_req_internal *);
-int rf_autoconfig(device_t);
-void rf_buildroothack(RF_ConfigSet_t *);
-
-RF_AutoConfig_t *rf_find_raid_components(void);
-RF_ConfigSet_t *rf_create_auto_sets(RF_AutoConfig_t *);
+static void rf_ReconThread(struct rf_recon_req_internal *);
+static void rf_RewriteParityThread(RF_Raid_t *raidPtr);
+static void rf_CopybackThread(RF_Raid_t *raidPtr);
+static void rf_ReconstructInPlaceThread(struct rf_recon_req_internal *);
+static int rf_autoconfig(device_t);
+static void rf_buildroothack(RF_ConfigSet_t *);
+
+static RF_AutoConfig_t *rf_find_raid_components(void);
+static RF_ConfigSet_t *rf_create_auto_sets(RF_AutoConfig_t *);
 static int rf_does_it_fit(RF_ConfigSet_t *,RF_AutoConfig_t *);
-int rf_reasonable_label(RF_ComponentLabel_t *, uint64_t);
-void rf_create_configuration(RF_AutoConfig_t *,RF_Config_t *, RF_Raid_t *);
-int rf_set_autoconfig(RF_Raid_t *, int);
-int rf_set_rootpartition(RF_Raid_t *, int);
-void rf_release_all_vps(RF_ConfigSet_t *);
-void rf_cleanup_config_set(RF_ConfigSet_t *);
-int rf_have_enough_components(RF_ConfigSet_t *);
-struct raid_softc *rf_auto_config_set(RF_ConfigSet_t *);
+static void rf_create_configuration(RF_AutoConfig_t *,RF_Config_t *, RF_Raid_t *);
+static int rf_set_autoconfig(RF_Raid_t *, int);
+static int rf_set_rootpartition(RF_Raid_t *, int);
+static void rf_release_all_vps(RF_ConfigSet_t *);
+static void rf_cleanup_config_set(RF_ConfigSet_t *);
+static int rf_have_enough_components(RF_ConfigSet_t *);
+static struct raid_softc *rf_auto_config_set(RF_ConfigSet_t *);
 static void rf_fix_old_label_size(RF_ComponentLabel_t *, uint64_t);
 
 /*
@@ -397,7 +396,7 @@ raidattach(int num)
         */
 }
 
-int
+static int
 rf_autoconfig(device_t self)
 {
        RF_AutoConfig_t *ac_list;
@@ -481,7 +480,7 @@ rf_containsboot(RF_Raid_t *r, device_t b
        return 0;
 }
 
-void
+static void
 rf_buildroothack(RF_ConfigSet_t *config_sets)
 {
        RF_ConfigSet_t *cset;
@@ -2614,7 +2613,7 @@ rf_UnconfigureVnodes(RF_Raid_t *raidPtr)
 }
 
 
-void
+static void
 rf_ReconThread(struct rf_recon_req_internal *req)
 {
        int     s;
@@ -2636,7 +2635,7 @@ rf_ReconThread(struct rf_recon_req_inter
        kthread_exit(0);        /* does not return */
 }
 
-void
+static void
 rf_RewriteParityThread(RF_Raid_t *raidPtr)
 {
        int retcode;
@@ -2670,7 +2669,7 @@ rf_RewriteParityThread(RF_Raid_t *raidPt
 }
 
 
-void
+static void
 rf_CopybackThread(RF_Raid_t *raidPtr)
 {
        int s;
@@ -2686,7 +2685,7 @@ rf_CopybackThread(RF_Raid_t *raidPtr)
 }
 
 
-void
+static void
 rf_ReconstructInPlaceThread(struct rf_recon_req_internal *req)
 {
        int s;
@@ -2746,7 +2745,7 @@ rf_get_component(RF_AutoConfig_t *ac_lis
        return ac_list;
 }
 
-RF_AutoConfig_t *
+static RF_AutoConfig_t *
 rf_find_raid_components(void)
 {
        struct vnode *vp;
@@ -2775,21 +2774,21 @@ rf_find_raid_components(void)
                for (dv = deviter_first(&di, DEVITER_F_ROOT_FIRST); dv != NULL;
                     dv = deviter_next(&di)) {
 
-                       /* we are only interested in disks... */
+                       /* we are only interested in disks */
                        if (device_class(dv) != DV_DISK)
                                continue;
 
-                       /* we don't care about floppies... */
+                       /* we don't care about floppies */
                        if (device_is_a(dv, "fd")) {
                                continue;
                        }
 
-                       /* we don't care about CD's... */
+                       /* we don't care about CDs. */
                        if (device_is_a(dv, "cd")) {
                                continue;
                        }
 
-                       /* we don't care about md's... */
+                       /* we don't care about md. */
                        if (device_is_a(dv, "md")) {
                                continue;
                        }
@@ -2804,6 +2803,11 @@ rf_find_raid_components(void)
                                continue;
                        }
 
+                       /* we don't care about spiflash */
+                       if (device_is_a(dv, "spiflash")) {
+                               continue;
+                       }
+
                        /* are we in the wedges pass ? */
                        wedge = device_is_a(dv, "dk");
                        if (wedge != dowedges) {
@@ -2953,15 +2957,14 @@ rf_find_raid_components(void)
        return ac_list;
 }
 
-
 int
 rf_reasonable_label(RF_ComponentLabel_t *clabel, uint64_t numsecs)
 {
 
-       if (((clabel->version==RF_COMPONENT_LABEL_VERSION_1) ||
-            (clabel->version==RF_COMPONENT_LABEL_VERSION)) &&
-           ((clabel->clean == RF_RAID_CLEAN) ||
-            (clabel->clean == RF_RAID_DIRTY)) &&
+       if ((clabel->version==RF_COMPONENT_LABEL_VERSION_1 ||
+            clabel->version==RF_COMPONENT_LABEL_VERSION) &&
+           (clabel->clean == RF_RAID_CLEAN ||
+            clabel->clean == RF_RAID_DIRTY) &&
            clabel->row >=0 &&
            clabel->column >= 0 &&
            clabel->num_rows > 0 &&
@@ -3052,7 +3055,7 @@ rf_print_component_label(RF_ComponentLab
 }
 #endif
 
-RF_ConfigSet_t *
+static RF_ConfigSet_t *
 rf_create_auto_sets(RF_AutoConfig_t *ac_list)
 {
        RF_AutoConfig_t *ac;
@@ -3168,7 +3171,7 @@ rf_does_it_fit(RF_ConfigSet_t *cset, RF_
        return(1);
 }
 
-int
+static int
 rf_have_enough_components(RF_ConfigSet_t *cset)
 {
        RF_AutoConfig_t *ac;
@@ -3271,7 +3274,7 @@ rf_have_enough_components(RF_ConfigSet_t
        return(1);
 }
 
-void
+static void
 rf_create_configuration(RF_AutoConfig_t *ac, RF_Config_t *config,
                        RF_Raid_t *raidPtr)
 {
@@ -3305,7 +3308,7 @@ rf_create_configuration(RF_AutoConfig_t 
        }
 }
 
-int
+static int
 rf_set_autoconfig(RF_Raid_t *raidPtr, int new_value)
 {
        RF_ComponentLabel_t *clabel;
@@ -3332,7 +3335,7 @@ rf_set_autoconfig(RF_Raid_t *raidPtr, in
        return(new_value);
 }
 
-int
+static int
 rf_set_rootpartition(RF_Raid_t *raidPtr, int new_value)
 {
        RF_ComponentLabel_t *clabel;
@@ -3358,7 +3361,7 @@ rf_set_rootpartition(RF_Raid_t *raidPtr,
        return(new_value);
 }
 
-void
+static void
 rf_release_all_vps(RF_ConfigSet_t *cset)
 {
        RF_AutoConfig_t *ac;
@@ -3377,7 +3380,7 @@ rf_release_all_vps(RF_ConfigSet_t *cset)
 }
 
 
-void
+static void
 rf_cleanup_config_set(RF_ConfigSet_t *cset)
 {
        RF_AutoConfig_t *ac;
@@ -3431,7 +3434,7 @@ raid_init_component_label(RF_Raid_t *rai
 #endif
 }
 
-struct raid_softc *
+static struct raid_softc *
 rf_auto_config_set(RF_ConfigSet_t *cset)
 {
        RF_Raid_t *raidPtr;



Home | Main Index | Thread Index | Old Index