From c95ed3d2e5990c89196e7533910c5bc8287164d8 Mon Sep 17 00:00:00 2001 From: bad Date: Sun, 11 Jul 1999 00:26:29 +0000 Subject: [PATCH] In pcmcia_print_cis(): When printing io and mem spaces don't append trailing 0s if length or hostaddr are zero, instead DTRT. --- sys/dev/pcmcia/pcmcia_cis.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/sys/dev/pcmcia/pcmcia_cis.c b/sys/dev/pcmcia/pcmcia_cis.c index 115793721db2..a4ef6b3b6f63 100644 --- a/sys/dev/pcmcia/pcmcia_cis.c +++ b/sys/dev/pcmcia/pcmcia_cis.c @@ -1,4 +1,4 @@ -/* $NetBSD: pcmcia_cis.c,v 1.10 1998/12/29 09:03:15 marc Exp $ */ +/* $NetBSD: pcmcia_cis.c,v 1.11 1999/07/11 00:26:29 bad Exp $ */ #define PCMCIACISDEBUG @@ -541,24 +541,26 @@ pcmcia_print_cis(sc) printf("; iomask %lx, iospace", cfe->iomask); for (i = 0; i < cfe->num_iospace; i++) - printf(" %lx%s%lx", - cfe->iospace[i].start, - cfe->iospace[i].length ? "-" : "", - cfe->iospace[i].start + - cfe->iospace[i].length - 1); + printf(" %lx", + cfe->iospace[i].start); + if (cfe->iospace[i].length) + printf("-%lx", + cfe->iospace[i].start + + cfe->iospace[i].length - 1); } if (cfe->num_memspace) { printf("; memspace"); for (i = 0; i < cfe->num_memspace; i++) - printf(" %lx%s%lx%s%lx", - cfe->memspace[i].cardaddr, - cfe->memspace[i].length ? "-" : "", - cfe->memspace[i].cardaddr + - cfe->memspace[i].length - 1, - cfe->memspace[i].hostaddr ? - "@" : "", - cfe->memspace[i].hostaddr); + printf(" %lx", + cfe->memspace[i].cardaddr); + if (cfe->memspace[i].length) + printf("-%lx", + cfe->memspace[i].cardaddr + + cfe->memspace[i].length - 1); + if (cfe->memspace[i].hostaddr) + printf("@%lx", + cfe->memspace[i].hostaddr); } if (cfe->maxtwins) printf("; maxtwins %d", cfe->maxtwins);