From c0344d287510ca2f22cbff69e6383dbefeccd23b Mon Sep 17 00:00:00 2001 From: martin Date: Sat, 29 Jan 2022 11:20:30 +0000 Subject: 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. --- sys/dev/scsipi/scsiconf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sys/dev') 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 -__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 #include @@ -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++) -- cgit