Module Name: src Committed By: mrg Date: Wed Nov 6 06:20:12 UTC 2013
Modified Files: src/sys/dev/marvell: gtpci.c Log Message: move some variables inside their #ifdef use. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/marvell/gtpci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/marvell/gtpci.c diff -u src/sys/dev/marvell/gtpci.c:1.30 src/sys/dev/marvell/gtpci.c:1.31 --- src/sys/dev/marvell/gtpci.c:1.30 Fri Sep 7 04:25:37 2012 +++ src/sys/dev/marvell/gtpci.c Wed Nov 6 06:20:12 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: gtpci.c,v 1.30 2012/09/07 04:25:37 matt Exp $ */ +/* $NetBSD: gtpci.c,v 1.31 2013/11/06 06:20:12 mrg Exp $ */ /* * Copyright (c) 2008, 2009 KIYOHARA Takashi * All rights reserved. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.30 2012/09/07 04:25:37 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gtpci.c,v 1.31 2013/11/06 06:20:12 mrg Exp $"); #include "opt_pci.h" #include "pci.h" @@ -314,12 +314,9 @@ gtpci_barinit(struct gtpci_softc *sc) }; device_t pdev = device_parent(sc->sc_dev); uint64_t base; - uint32_t p2pc, size, bare; - int map, bus, dev, rv; + uint32_t size, bare; + int map, rv; - p2pc = GTPCI_READ(sc, GTPCI_P2PC); - bus = GTPCI_P2PC_BUSNUMBER(p2pc); - dev = GTPCI_P2PC_DEVNUM(p2pc); bare = GTPCI_BARE_ALLDISABLE; for (map = 0; maps[map].tag != MARVELL_TAG_UNDEFINED; map++) { @@ -337,6 +334,9 @@ gtpci_barinit(struct gtpci_softc *sc) if (maps[map].func != -1) { pcitag_t tag; pcireg_t reg; + int dev = GTPCI_P2PC_DEVNUM(p2pc); + int bus = GTPCI_P2PC_BUSNUMBER(p2pc); + uint32_t p2pc = GTPCI_READ(sc, GTPCI_P2PC); tag = gtpci_make_tag(NULL, bus, dev, maps[map].func); reg = gtpci_conf_read(sc, tag, maps[map].balow);