Sun Mar 28 20:30:14 2021 UTC ()
Correct the names of the arguments passed to cac_rescan(), and update
a local variable to avoid a name collision.  Also, no need to be explcit
about our interface attribute, since we carry only one.


(thorpej)
diff -r1.61.10.2 -r1.61.10.3 src/sys/dev/ic/cac.c

cvs diff -r1.61.10.2 -r1.61.10.3 src/sys/dev/ic/cac.c (expand / switch to unified diff)

--- src/sys/dev/ic/cac.c 2021/03/22 16:23:45 1.61.10.2
+++ src/sys/dev/ic/cac.c 2021/03/28 20:30:14 1.61.10.3
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: cac.c,v 1.61.10.2 2021/03/22 16:23:45 thorpej Exp $ */ 1/* $NetBSD: cac.c,v 1.61.10.3 2021/03/28 20:30:14 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2000, 2006, 2007 The NetBSD Foundation, Inc. 4 * Copyright (c) 2000, 2006, 2007 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Andrew Doran. 8 * by Andrew Doran.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32/* 32/*
33 * Driver for Compaq array controllers. 33 * Driver for Compaq array controllers.
34 */ 34 */
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.61.10.2 2021/03/22 16:23:45 thorpej Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: cac.c,v 1.61.10.3 2021/03/28 20:30:14 thorpej Exp $");
38 38
39#if defined(_KERNEL_OPT) 39#if defined(_KERNEL_OPT)
40#include "bio.h" 40#include "bio.h"
41#endif 41#endif
42 42
43#include <sys/param.h> 43#include <sys/param.h>
44#include <sys/systm.h> 44#include <sys/systm.h>
45#include <sys/kernel.h> 45#include <sys/kernel.h>
46#include <sys/device.h> 46#include <sys/device.h>
47#include <sys/queue.h> 47#include <sys/queue.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49#include <sys/buf.h> 49#include <sys/buf.h>
50#include <sys/endian.h> 50#include <sys/endian.h>
@@ -207,45 +207,44 @@ cac_init(struct cac_softc *sc, const cha @@ -207,45 +207,44 @@ cac_init(struct cac_softc *sc, const cha
207#if NBIO > 0 207#if NBIO > 0
208 if (bio_register(sc->sc_dev, cac_ioctl) != 0) 208 if (bio_register(sc->sc_dev, cac_ioctl) != 0)
209 aprint_error_dev(sc->sc_dev, "controller registration failed"); 209 aprint_error_dev(sc->sc_dev, "controller registration failed");
210 else 210 else
211 sc->sc_ioctl = cac_ioctl; 211 sc->sc_ioctl = cac_ioctl;
212 if (cac_create_sensors(sc) != 0) 212 if (cac_create_sensors(sc) != 0)
213 aprint_error_dev(sc->sc_dev, "unable to create sensors\n"); 213 aprint_error_dev(sc->sc_dev, "unable to create sensors\n");
214#endif 214#endif
215 215
216 return (0); 216 return (0);
217} 217}
218 218
219int 219int
220cac_rescan(device_t self, const char *attr, const int *flags) 220cac_rescan(device_t self, const char *attr, const int *locs)
221{ 221{
222 struct cac_softc *sc; 222 struct cac_softc *sc;
223 struct cac_attach_args caca; 223 struct cac_attach_args caca;
224 int locs[CACCF_NLOCS]; 224 int mlocs[CACCF_NLOCS];
225 int i; 225 int i;
226 226
227 sc = device_private(self); 227 sc = device_private(self);
228 for (i = 0; i < sc->sc_nunits; i++) { 228 for (i = 0; i < sc->sc_nunits; i++) {
229 if (sc->sc_unitmask & (1 << i)) 229 if (sc->sc_unitmask & (1 << i))
230 continue; 230 continue;
231 caca.caca_unit = i; 231 caca.caca_unit = i;
232 232
233 locs[CACCF_UNIT] = i; 233 mlocs[CACCF_UNIT] = i;
234 234
235 if (config_found(self, &caca, cac_print, 235 if (config_found(self, &caca, cac_print,
236 CFARG_SUBMATCH, config_stdsubmatch, 236 CFARG_SUBMATCH, config_stdsubmatch,
237 CFARG_IATTR, attr, 237 CFARG_LOCATORS, mlocs,
238 CFARG_LOCATORS, locs, 
239 CFARG_EOL) != NULL) 238 CFARG_EOL) != NULL)
240 sc->sc_unitmask |= 1 << i; 239 sc->sc_unitmask |= 1 << i;
241 } 240 }
242 return 0; 241 return 0;
243} 242}
244 243
245/* 244/*
246 * Shut down all `cac' controllers. 245 * Shut down all `cac' controllers.
247 */ 246 */
248static void 247static void
249cac_shutdown(void *cookie) 248cac_shutdown(void *cookie)
250{ 249{
251 struct cac_softc *sc; 250 struct cac_softc *sc;