diff options
| author | martin <martin@NetBSD.org> | 2022-01-29 11:20:30 +0000 |
|---|---|---|
| committer | martin <martin@NetBSD.org> | 2022-01-29 11:20:30 +0000 |
| commit | c0344d287510ca2f22cbff69e6383dbefeccd23b (patch) | |
| tree | 023e74c3d67e3d959c09afe177d3545ddace589b /sys/dev | |
| parent | 9edd5fd176720fbcda5b6bfd85be6542d64a4228 (diff) | |
In some cases the gcc optimizer is not smart enough to figure out why
the luns and nluns variables are never actually used when they are not
initialized - so initialize them always.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/scsipi/scsiconf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/scsipi/scsiconf.c b/sys/dev/scsipi/scsiconf.c index 9d2e4366199..33ad8325f0a 100644 --- a/sys/dev/scsipi/scsiconf.c +++ b/sys/dev/scsipi/scsiconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: scsiconf.c,v 1.296 2022/01/28 18:23:28 christos Exp $ */ +/* $NetBSD: scsiconf.c,v 1.297 2022/01/29 11:20:30 martin Exp $ */ /*- * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc. @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.296 2022/01/28 18:23:28 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.297 2022/01/29 11:20:30 martin Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -477,8 +477,8 @@ end2: static void scsi_discover_luns(struct scsibus_softc *sc, int target, int minlun, int maxlun) { - uint16_t *luns; - size_t nluns; + uint16_t *luns = NULL; /* XXX gcc */ + size_t nluns = 0; /* XXX gcc */ if (scsi_report_luns(sc, target, &luns, &nluns) == 0) { for (size_t i = 0; i < nluns; i++) |
