Module Name:    src
Committed By:   tsutsui
Date:           Thu Sep 17 18:14:41 UTC 2009

Modified Files:
        src/sys/dev/ic: i82365.c i82365var.h
        src/sys/dev/isa: i82365_isa.c i82365_isasubr.c i82365_isavar.h
        src/sys/dev/isapnp: i82365_isapnp.c
        src/sys/dev/pci: i82365_pci.c i82365_pcivar.h

Log Message:
Misc KNF and cosmetics, and remove unnecessary casts etc.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/sys/dev/ic/i82365.c
cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/i82365var.h
cvs rdiff -u -r1.32 -r1.33 src/sys/dev/isa/i82365_isa.c
cvs rdiff -u -r1.44 -r1.45 src/sys/dev/isa/i82365_isasubr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/isa/i82365_isavar.h
cvs rdiff -u -r1.29 -r1.30 src/sys/dev/isapnp/i82365_isapnp.c
cvs rdiff -u -r1.31 -r1.32 src/sys/dev/pci/i82365_pci.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/i82365_pcivar.h

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/ic/i82365.c
diff -u src/sys/dev/ic/i82365.c:1.110 src/sys/dev/ic/i82365.c:1.111
--- src/sys/dev/ic/i82365.c:1.110	Mon Sep 14 13:41:15 2009
+++ src/sys/dev/ic/i82365.c	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365.c,v 1.110 2009/09/14 13:41:15 tsutsui Exp $	*/
+/*	$NetBSD: i82365.c,v 1.111 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2004 Charles M. Hannum.  All rights reserved.
@@ -49,7 +49,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.110 2009/09/14 13:41:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365.c,v 1.111 2009/09/17 18:14:41 tsutsui Exp $");
 
 #define	PCICDEBUG
 
@@ -114,23 +114,24 @@
 int
 pcic_ident_ok(int ident)
 {
+
 	/* this is very empirical and heuristic */
 
 	if ((ident == 0) || (ident == 0xff) || (ident & PCIC_IDENT_ZERO))
-		return (0);
+		return 0;
 
 	if ((ident & PCIC_IDENT_REV_MASK) == 0)
-		return (0);
+		return 0;
 
 	if ((ident & PCIC_IDENT_IFTYPE_MASK) != PCIC_IDENT_IFTYPE_MEM_AND_IO) {
 #ifdef DIAGNOSTIC
 		printf("pcic: does not support memory and I/O cards, "
 		    "ignored (ident=%0x)\n", ident);
 #endif
-		return (0);
+		return 0;
 	}
 
-	return (1);
+	return 1;
 }
 
 int
@@ -142,12 +143,12 @@
 	reg = pcic_read(h, PCIC_IDENT);
 
 	if ((reg & PCIC_IDENT_REV_MASK) == 0)
-		return (PCIC_VENDOR_NONE);
+		return PCIC_VENDOR_NONE;
 
 	switch (reg) {
 	case 0x00:
 	case 0xff:
-		return (PCIC_VENDOR_NONE);
+		return PCIC_VENDOR_NONE;
 	case PCIC_IDENT_ID_INTEL0:
 		vendor = PCIC_VENDOR_I82365SLR0;
 		break;
@@ -182,7 +183,7 @@
 		    PCIC_CIRRUS_CHIP_INFO_CHIP_ID) {
 			reg = pcic_read(h, -1);
 			if ((reg & PCIC_CIRRUS_CHIP_INFO_CHIP_ID) == 0)
-				return (PCIC_VENDOR_CIRRUS_PD67XX);
+				return PCIC_VENDOR_CIRRUS_PD67XX;
 		}
 
 		/*
@@ -191,38 +192,39 @@
 		reg = pcic_read(h, PCIC_RICOH_REG_CHIP_ID);
 		switch (reg) {
 		case PCIC_RICOH_CHIP_ID_5C296:
-			return (PCIC_VENDOR_RICOH_5C296);
+			return PCIC_VENDOR_RICOH_5C296;
 		case PCIC_RICOH_CHIP_ID_5C396:
-			return (PCIC_VENDOR_RICOH_5C396);
+			return PCIC_VENDOR_RICOH_5C396;
 		}
 	}
 
-	return (vendor);
+	return vendor;
 }
 
 const char *
 pcic_vendor_to_string(int vendor)
 {
+
 	switch (vendor) {
 	case PCIC_VENDOR_I82365SLR0:
-		return ("Intel 82365SL Revision 0");
+		return "Intel 82365SL Revision 0";
 	case PCIC_VENDOR_I82365SLR1:
-		return ("Intel 82365SL Revision 1");
+		return "Intel 82365SL Revision 1";
 	case PCIC_VENDOR_CIRRUS_PD67XX:
-		return ("Cirrus PD6710/2X");
+		return "Cirrus PD6710/2X";
 	case PCIC_VENDOR_I82365SL_DF:
-		return ("Intel 82365SL-DF");
+		return "Intel 82365SL-DF";
 	case PCIC_VENDOR_RICOH_5C296:
-		return ("Ricoh RF5C296");
+		return "Ricoh RF5C296";
 	case PCIC_VENDOR_RICOH_5C396:
-		return ("Ricoh RF5C396");
+		return "Ricoh RF5C396";
 	case PCIC_VENDOR_IBM:
-		return ("IBM PCIC");
+		return "IBM PCIC";
 	case PCIC_VENDOR_IBM_KING:
-		return ("IBM KING");
+		return "IBM KING";
 	}
 
-	return ("Unknown controller");
+	return "Unknown controller";
 }
 
 void
@@ -259,7 +261,7 @@
 		if (socket == 0) {
 			h->vendor = pcic_vendor(h);
 			if (i < __arraycount(sc->handle) - 1)
-				(h+1)->vendor = h->vendor;
+				(h + 1)->vendor = h->vendor;
 		}
 
 		switch (h->vendor) {
@@ -321,11 +323,11 @@
 		    chip, pcic_vendor_to_string(sc->handle[i].vendor));
 
 		if ((h->flags & PCIC_FLAG_SOCKETP) &&
-		    ((h+1)->flags & PCIC_FLAG_SOCKETP))
+		    ((h + 1)->flags & PCIC_FLAG_SOCKETP))
 			aprint_normal("sockets A and B\n");
 		else if (h->flags & PCIC_FLAG_SOCKETP)
 			aprint_normal("socket A only\n");
-		else if ((h+1)->flags & PCIC_FLAG_SOCKETP)
+		else if ((h + 1)->flags & PCIC_FLAG_SOCKETP)
 			aprint_normal("socket B only\n");
 		else
 			aprint_normal("no sockets\n");
@@ -348,7 +350,7 @@
 void
 pcic_power(int why, void *arg)
 {
-	struct pcic_handle *h = (struct pcic_handle *)arg;
+	struct pcic_handle *h = arg;
 	struct pcic_softc *sc = device_private(h->ph_parent);
 	int reg;
 
@@ -475,8 +477,8 @@
 	/* clear possible card detect interrupt */
 	(void) pcic_read(h, PCIC_CSC);
 
-	DPRINTF(("%s: attach finish vendor 0x%02x\n", device_xname(h->ph_parent),
-	    h->vendor));
+	DPRINTF(("%s: attach finish vendor 0x%02x\n",
+	    device_xname(h->ph_parent), h->vendor));
 
 	/* unsleep the cirrus controller */
 	if (h->vendor == PCIC_VENDOR_CIRRUS_PD67XX) {
@@ -511,7 +513,8 @@
 
 	if (kthread_create(PRI_NONE, 0, NULL, pcic_event_thread, h,
 	    &h->event_thread, "%s,%s", device_xname(h->ph_parent), cs)) {
-		aprint_error_dev(h->ph_parent, "unable to create event thread for sock 0x%02x\n", h->sock);
+		aprint_error_dev(h->ph_parent,
+		    "unable to create event thread for sock 0x%02x\n", h->sock);
 		panic("pcic_attach_socket");
 	}
 }
@@ -548,7 +551,7 @@
 			splx(s);
 			/* sleep .25s to be enqueued chatterling interrupts */
 			(void) tsleep((void *)pcic_event_thread, PWAIT,
-			    "pcicss", hz/4);
+			    "pcicss", hz / 4);
 		}
 		s = splhigh();
 		SIMPLEQ_REMOVE_HEAD(&h->events, pe_q);
@@ -557,7 +560,7 @@
 		switch (pe->pe_type) {
 		case PCIC_EVENT_INSERTION:
 			s = splhigh();
-			while (1) {
+			for (;;) {
 				struct pcic_event *pe1, *pe2;
 
 				if ((pe1 = SIMPLEQ_FIRST(&h->events)) == NULL)
@@ -582,7 +585,7 @@
 
 		case PCIC_EVENT_REMOVAL:
 			s = splhigh();
-			while (1) {
+			for (;;) {
 				struct pcic_event *pe1, *pe2;
 
 				if ((pe1 = SIMPLEQ_FIRST(&h->events)) == NULL)
@@ -634,7 +637,7 @@
 
 	aprint_normal(" controller %d socket %d", h->chip, h->socket);
 
-	return (UNCONF);
+	return UNCONF;
 }
 
 void
@@ -664,7 +667,7 @@
 		if (sc->handle[i].flags & PCIC_FLAG_SOCKETP)
 			ret += pcic_intr_socket(&sc->handle[i]);
 
-	return (ret ? 1 : 0);
+	return ret ? 1 : 0;
 }
 
 int
@@ -681,21 +684,22 @@
 		   PCIC_CSC_BATTDEAD);
 
 	if (cscreg & PCIC_CSC_GPI) {
-		DPRINTF(("%s: %02x GPI\n", device_xname(h->ph_parent), h->sock));
+		DPRINTF(("%s: %02x GPI\n",
+		    device_xname(h->ph_parent), h->sock));
 	}
 	if (cscreg & PCIC_CSC_CD) {
 		int statreg;
 
 		statreg = pcic_read(h, PCIC_IF_STATUS);
 
-		DPRINTF(("%s: %02x CD %x\n", device_xname(h->ph_parent), h->sock,
-		    statreg));
+		DPRINTF(("%s: %02x CD %x\n", device_xname(h->ph_parent),
+		    h->sock, statreg));
 
 		if ((statreg & PCIC_IF_STATUS_CARDDETECT_MASK) ==
 		    PCIC_IF_STATUS_CARDDETECT_PRESENT) {
 			if (h->laststate != PCIC_LASTSTATE_PRESENT) {
 				DPRINTF(("%s: enqueing INSERTION event\n",
-					 device_xname(h->ph_parent)));
+				    device_xname(h->ph_parent)));
 				pcic_queue_event(h, PCIC_EVENT_INSERTION);
 			}
 			h->laststate = PCIC_LASTSTATE_PRESENT;
@@ -703,18 +707,19 @@
 			if (h->laststate == PCIC_LASTSTATE_PRESENT) {
 				/* Deactivate the card now. */
 				DPRINTF(("%s: deactivating card\n",
-					 device_xname(h->ph_parent)));
+				    device_xname(h->ph_parent)));
 				pcic_deactivate_card(h);
 
 				DPRINTF(("%s: enqueing REMOVAL event\n",
-					 device_xname(h->ph_parent)));
+				    device_xname(h->ph_parent)));
 				pcic_queue_event(h, PCIC_EVENT_REMOVAL);
 			}
 			h->laststate = PCIC_LASTSTATE_EMPTY;
 		}
 	}
 	if (cscreg & PCIC_CSC_READY) {
-		DPRINTF(("%s: %02x READY\n", device_xname(h->ph_parent), h->sock));
+		DPRINTF(("%s: %02x READY\n", device_xname(h->ph_parent),
+		     h->sock));
 		/* shouldn't happen */
 	}
 	if (cscreg & PCIC_CSC_BATTWARN) {
@@ -725,7 +730,7 @@
 		DPRINTF(("%s: %02x BATTDEAD\n", device_xname(h->ph_parent),
 		    h->sock));
 	}
-	return (cscreg ? 1 : 0);
+	return cscreg ? 1 : 0;
 }
 
 void
@@ -749,7 +754,7 @@
 pcic_attach_card(struct pcic_handle *h)
 {
 
-	if (!(h->flags & PCIC_FLAG_CARDP)) {
+	if ((h->flags & PCIC_FLAG_CARDP) == 0) {
 		/* call the MI attach function */
 		pcmcia_card_attach(h->pcmcia);
 
@@ -792,7 +797,8 @@
 }
 
 int
-pcic_chip_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size, struct pcmcia_mem_handle *pcmhp)
+pcic_chip_mem_alloc(pcmcia_chipset_handle_t pch, bus_size_t size,
+    struct pcmcia_mem_handle *pcmhp)
 {
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	bus_space_handle_t memh;
@@ -806,7 +812,7 @@
 	/* convert size to PCIC pages */
 	sizepg = (size + (PCIC_MEM_ALIGN - 1)) / PCIC_MEM_ALIGN;
 	if (sizepg > PCIC_MAX_MEM_PAGES)
-		return (1);
+		return 1;
 
 	mask = (1 << sizepg) - 1;
 
@@ -818,7 +824,7 @@
 			if (bus_space_subregion(sc->memt, sc->memh,
 			    i * PCIC_MEM_PAGESIZE,
 			    sizepg * PCIC_MEM_PAGESIZE, &memh))
-				return (1);
+				return 1;
 			mhandle = mask << i;
 			addr = sc->membase + (i * PCIC_MEM_PAGESIZE);
 			sc->subregionmask &= ~(mhandle);
@@ -828,11 +834,11 @@
 			pcmhp->size = size;
 			pcmhp->mhandle = mhandle;
 			pcmhp->realsize = sizepg * PCIC_MEM_PAGESIZE;
-			return (0);
+			return 0;
 		}
 	}
 
-	return (1);
+	return 1;
 }
 
 void
@@ -960,7 +966,9 @@
 }
 
 int
-pcic_chip_mem_map(pcmcia_chipset_handle_t pch, int kind, bus_addr_t card_addr, bus_size_t size, struct pcmcia_mem_handle *pcmhp, bus_size_t *offsetp, int *windowp)
+pcic_chip_mem_map(pcmcia_chipset_handle_t pch, int kind, bus_addr_t card_addr,
+    bus_size_t size, struct pcmcia_mem_handle *pcmhp, bus_size_t *offsetp,
+    int *windowp)
 {
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	bus_addr_t busaddr;
@@ -979,7 +987,7 @@
 	}
 
 	if (win == -1)
-		return (1);
+		return 1;
 
 	*windowp = win;
 
@@ -1019,7 +1027,7 @@
 
 	pcic_chip_do_mem_map(h, win);
 
-	return (0);
+	return 0;
 }
 
 void
@@ -1039,7 +1047,8 @@
 }
 
 int
-pcic_chip_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start, bus_size_t size, bus_size_t align, struct pcmcia_io_handle *pcihp)
+pcic_chip_io_alloc(pcmcia_chipset_handle_t pch, bus_addr_t start,
+    bus_size_t size, bus_size_t align, struct pcmcia_io_handle *pcihp)
 {
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	bus_space_tag_t iot;
@@ -1057,7 +1066,7 @@
 	if (start) {
 		ioaddr = start;
 		if (bus_space_map(iot, start, size, 0, &ioh))
-			return (1);
+			return 1;
 		DPRINTF(("pcic_chip_io_alloc map port %lx+%lx\n",
 		    (u_long) ioaddr, (u_long) size));
 	} else {
@@ -1065,7 +1074,7 @@
 		if (bus_space_alloc(iot, sc->iobase,
 		    sc->iobase + sc->iosize, size, align, 0, 0,
 		    &ioaddr, &ioh))
-			return (1);
+			return 1;
 		DPRINTF(("pcic_chip_io_alloc alloc port %lx+%lx\n",
 		    (u_long) ioaddr, (u_long) size));
 	}
@@ -1076,12 +1085,11 @@
 	pcihp->size = size;
 	pcihp->flags = flags;
 
-	return (0);
+	return 0;
 }
 
 void
-pcic_chip_io_free(pcmcia_chipset_handle_t pch,
-    struct pcmcia_io_handle *pcihp)
+pcic_chip_io_free(pcmcia_chipset_handle_t pch, struct pcmcia_io_handle *pcihp)
 {
 	bus_space_tag_t iot = pcihp->iot;
 	bus_space_handle_t ioh = pcihp->ioh;
@@ -1166,7 +1174,8 @@
 }
 
 int
-pcic_chip_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset, bus_size_t size, struct pcmcia_io_handle *pcihp, int *windowp)
+pcic_chip_io_map(pcmcia_chipset_handle_t pch, int width, bus_addr_t offset,
+    bus_size_t size, struct pcmcia_io_handle *pcihp, int *windowp)
 {
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	bus_addr_t ioaddr = pcihp->addr + offset;
@@ -1188,7 +1197,7 @@
 	}
 
 	if (win == -1)
-		return (1);
+		return 1;
 
 	*windowp = win;
 
@@ -1198,7 +1207,7 @@
 		panic("pcic_chip_io_map iot is bogus");
 
 	DPRINTF(("pcic_chip_io_map window %d %s port %lx+%lx\n",
-		 win, width_names[width], (u_long) ioaddr, (u_long) size));
+	    win, width_names[width], (u_long) ioaddr, (u_long) size));
 
 	/* XXX wtf is this doing here? */
 
@@ -1213,7 +1222,7 @@
 
 	pcic_chip_do_io_map(h, win);
 
-	return (0);
+	return 0;
 }
 
 void
@@ -1241,21 +1250,21 @@
 	/* wait an initial 10ms for quick cards */
 	stat = pcic_read(h, PCIC_IF_STATUS);
 	if (stat & PCIC_IF_STATUS_READY)
-		return (0);
+		return 0;
 	pcic_delay(h, 10, "pccwr0");
 	for (i = 0; i < 50; i++) {
 		stat = pcic_read(h, PCIC_IF_STATUS);
 		if (stat & PCIC_IF_STATUS_READY)
-			return (0);
+			return 0;
 		if ((stat & PCIC_IF_STATUS_CARDDETECT_MASK) !=
 		    PCIC_IF_STATUS_CARDDETECT_PRESENT)
-			return (ENXIO);
+			return ENXIO;
 		/* wait .1s (100ms) each iteration now */
 		pcic_delay(h, 100, "pccwr1");
 	}
 
 	printf("pcic_wait_ready: ready never happened, status=%02x\n", stat);
-	return (EWOULDBLOCK);
+	return EWOULDBLOCK;
 }
 
 /*
@@ -1313,19 +1322,20 @@
 	/*
 	 * power hack for RICOH RF5C[23]96
 	 */
-	switch( h->vendor ) {
+	switch (h->vendor) {
 	case PCIC_VENDOR_RICOH_5C296:
 	case PCIC_VENDOR_RICOH_5C396:
-	{
+	    {
 		int regtmp;
 		regtmp = pcic_read(h, PCIC_RICOH_REG_MCR2);
 #ifdef RICOH_POWER_HACK
 		regtmp |= PCIC_RICOH_MCR2_VCC_DIRECT;
 #else
-		regtmp &= ~(PCIC_RICOH_MCR2_VCC_DIRECT|PCIC_RICOH_MCR2_VCC_SEL_3V);
+		regtmp &=
+		    ~(PCIC_RICOH_MCR2_VCC_DIRECT|PCIC_RICOH_MCR2_VCC_SEL_3V);
 #endif
 		pcic_write(h, PCIC_RICOH_REG_MCR2, regtmp);
-	}
+	    }
 		break;
 	default:
 		break;
@@ -1443,7 +1453,7 @@
 	if (idx != -1)
 		bus_space_write_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_INDEX,
 		    h->sock + idx);
-	return (bus_space_read_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA));
+	return bus_space_read_1(h->ph_bus_t, h->ph_bus_h, PCIC_REG_DATA);
 }
 
 static void

Index: src/sys/dev/ic/i82365var.h
diff -u src/sys/dev/ic/i82365var.h:1.30 src/sys/dev/ic/i82365var.h:1.31
--- src/sys/dev/ic/i82365var.h:1.30	Mon Sep 14 12:49:34 2009
+++ src/sys/dev/ic/i82365var.h	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365var.h,v 1.30 2009/09/14 12:49:34 tsutsui Exp $	*/
+/*	$NetBSD: i82365var.h,v 1.31 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -168,10 +168,10 @@
 void	pcic_attach_sockets_finish(struct pcic_softc *);
 int	pcic_intr(void *arg);
 
-/*
+#if 0
 static __inline int pcic_read(struct pcic_handle *, int);
 static __inline void pcic_write(struct pcic_handle *, int, uint8_t);
-*/
+#endif
 
 int	pcic_chip_mem_alloc(pcmcia_chipset_handle_t, bus_size_t,
 	    struct pcmcia_mem_handle *);

Index: src/sys/dev/isa/i82365_isa.c
diff -u src/sys/dev/isa/i82365_isa.c:1.32 src/sys/dev/isa/i82365_isa.c:1.33
--- src/sys/dev/isa/i82365_isa.c:1.32	Mon Sep 14 13:41:15 2009
+++ src/sys/dev/isa/i82365_isa.c	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_isa.c,v 1.32 2009/09/14 13:41:15 tsutsui Exp $	*/
+/*	$NetBSD: i82365_isa.c,v 1.33 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365_isa.c,v 1.32 2009/09/14 13:41:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365_isa.c,v 1.33 2009/09/17 18:14:41 tsutsui Exp $");
 
 #define	PCICISADEBUG
 
@@ -96,21 +96,21 @@
 	int val, found, msize;
 
 	if (ia->ia_nio < 1)
-		return (0);
+		return 0;
 	if (ia->ia_niomem < 1)
-		return (0);
+		return 0;
 
 	if (ISA_DIRECT_CONFIG(ia))
-		return (0);
+		return 0;
 
 	/* Disallow wildcarded i/o address. */
 	if (ia->ia_io[0].ir_addr == ISA_UNKNOWN_PORT)
-		return (0);
+		return 0;
 	if (ia->ia_iomem[0].ir_addr == ISA_UNKNOWN_IOMEM)
-		return (0);
+		return 0;
 
 	if (bus_space_map(iot, ia->ia_io[0].ir_addr, PCIC_IOSIZE, 0, &ioh))
-		return (0);
+		return 0;
 
 	if (ia->ia_iomem[0].ir_size == ISA_UNKNOWN_IOSIZ)
 		msize = PCIC_MEMSIZE;
@@ -120,7 +120,7 @@
 	if (bus_space_map(ia->ia_memt, ia->ia_iomem[0].ir_addr,
 	    msize, 0, &memh)) {
 		bus_space_unmap(iot, ioh, PCIC_IOSIZE);
-		return (0);
+		return 0;
 	}
 
 	found = 0;
@@ -166,7 +166,7 @@
 	bus_space_unmap(ia->ia_memt, memh, msize);
 
 	if (!found)
-		return (0);
+		return 0;
 
 	ia->ia_nio = 1;
 	ia->ia_io[0].ir_size = PCIC_IOSIZE;
@@ -178,7 +178,7 @@
 
 	ia->ia_ndrq = 0;
 
-	return (1);
+	return 1;
 }
 
 void
@@ -211,7 +211,7 @@
 	    (1 << (ia->ia_iomem[0].ir_size / PCIC_MEM_PAGESIZE)) - 1;
 
 	isc->sc_ic = ic;
-	sc->pct = (pcmcia_chipset_tag_t) & pcic_isa_functions;
+	sc->pct = &pcic_isa_functions;
 
 	sc->iot = iot;
 	sc->ioh = ioh;

Index: src/sys/dev/isa/i82365_isasubr.c
diff -u src/sys/dev/isa/i82365_isasubr.c:1.44 src/sys/dev/isa/i82365_isasubr.c:1.45
--- src/sys/dev/isa/i82365_isasubr.c:1.44	Mon Sep 14 13:41:15 2009
+++ src/sys/dev/isa/i82365_isasubr.c	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_isasubr.c,v 1.44 2009/09/14 13:41:15 tsutsui Exp $	*/
+/*	$NetBSD: i82365_isasubr.c,v 1.45 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 2000 Christian E. Hopps.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.44 2009/09/14 13:41:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365_isasubr.c,v 1.45 2009/09/17 18:14:41 tsutsui Exp $");
 
 #define	PCICISADEBUG
 
@@ -147,7 +147,7 @@
 			printf(".");
 		else
 			DPRINTF(("."));
-		return (1);
+		return 1;
 	}
 
 	/*
@@ -168,7 +168,7 @@
 	else
 		DPRINTF(("X"));
 #endif
-	return (cscreg ? 1 : 0);
+	return cscreg ? 1 : 0;
 }
 
 /*
@@ -373,8 +373,7 @@
  * each sub region is offset by 0x400.
  */
 void pcic_isa_bus_width_probe(struct pcic_softc *sc, bus_space_tag_t iot,
-				bus_space_handle_t ioh,
-				bus_addr_t base, uint32_t length)
+    bus_space_handle_t ioh, bus_addr_t base, uint32_t length)
 {
 	bus_space_handle_t ioh_high;
 	int i, iobuswidth, tmp1, tmp2;
@@ -434,7 +433,6 @@
 
 	DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx (probed)\n",
 	    device_xname(&sc->dev), (long) sc->iobase,
-
 	    (long) sc->iobase + sc->iosize));
 
 	if (pcic_isa_alloc_iobase && pcic_isa_alloc_iosize) {
@@ -442,14 +440,14 @@
 		sc->iosize = pcic_isa_alloc_iosize;
 
 		DPRINTF(("%s: bus_space_alloc range 0x%04lx-0x%04lx "
-		    "(config override)\n", device_xname(&sc->dev), (long) sc->iobase,
-		    (long) sc->iobase + sc->iosize));
+		    "(config override)\n", device_xname(&sc->dev),
+		    (long) sc->iobase, (long) sc->iobase + sc->iosize));
 	}
 }
 
 void *
 pcic_isa_chip_intr_establish(pcmcia_chipset_handle_t pch,
-	struct pcmcia_function *pf, int ipl, int (*fct)(void *), void *arg)
+    struct pcmcia_function *pf, int ipl, int (*fct)(void *), void *arg)
 {
 	struct pcic_handle *h = (struct pcic_handle *) pch;
 	struct pcic_isa_softc *isc = device_private(h->ph_parent);
@@ -477,7 +475,7 @@
 		ist = IST_EDGE;		/* SEE COMMENT ABOVE */
 
 	if (isa_intr_alloc(ic, sc->intr_mask[h->chip], ist, &irq))
-		return (NULL);
+		return NULL;
 
 	h->ih_irq = irq;
 	if (h->flags & PCIC_FLAG_ENABLED) {
@@ -487,11 +485,11 @@
 	}
 
 	if ((ih = isa_intr_establish(ic, irq, ist, ipl, fct, arg)) == NULL)
-		return (NULL);
+		return NULL;
 
 	printf("%s: card irq %d\n", device_xname(h->pcmcia), irq);
 
-	return (ih);
+	return ih;
 }
 
 void

Index: src/sys/dev/isa/i82365_isavar.h
diff -u src/sys/dev/isa/i82365_isavar.h:1.8 src/sys/dev/isa/i82365_isavar.h:1.9
--- src/sys/dev/isa/i82365_isavar.h:1.8	Mon Sep 14 12:49:34 2009
+++ src/sys/dev/isa/i82365_isavar.h	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_isavar.h,v 1.8 2009/09/14 12:49:34 tsutsui Exp $	*/
+/*	$NetBSD: i82365_isavar.h,v 1.9 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 Bill Sommerfeld.  All rights reserved.
@@ -49,8 +49,8 @@
  * Figure out how wide the ISA bus is...
  */
 
-void pcic_isa_bus_width_probe(struct pcic_softc *, bus_space_tag_t,
-				   bus_space_handle_t, bus_addr_t, uint32_t);
+void	pcic_isa_bus_width_probe(struct pcic_softc *, bus_space_tag_t,
+	    bus_space_handle_t, bus_addr_t, uint32_t);
 void	pcic_isa_chip_intr_disestablish(pcmcia_chipset_handle_t, void *);
 void	pcic_isa_config_interrupts(device_t);
 void	*pcic_isa_chip_intr_establish(pcmcia_chipset_handle_t,

Index: src/sys/dev/isapnp/i82365_isapnp.c
diff -u src/sys/dev/isapnp/i82365_isapnp.c:1.29 src/sys/dev/isapnp/i82365_isapnp.c:1.30
--- src/sys/dev/isapnp/i82365_isapnp.c:1.29	Thu Sep 17 18:09:51 2009
+++ src/sys/dev/isapnp/i82365_isapnp.c	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_isapnp.c,v 1.29 2009/09/17 18:09:51 tsutsui Exp $	*/
+/*	$NetBSD: i82365_isapnp.c,v 1.30 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 Bill Sommerfeld.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365_isapnp.c,v 1.29 2009/09/17 18:09:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365_isapnp.c,v 1.30 2009/09/17 18:14:41 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,7 +66,7 @@
 #endif
 
 int pcic_isapnp_match(device_t, cfdata_t, void *);
-void	pcic_isapnp_attach(device_t, device_t, void *);
+void pcic_isapnp_attach(device_t, device_t, void *);
 
 CFATTACH_DECL(pcic_isapnp, sizeof(struct pcic_isa_softc),
     pcic_isapnp_match, pcic_isapnp_attach, NULL, NULL);
@@ -99,7 +99,7 @@
 	pri = isapnp_devmatch(aux, &isapnp_pcic_devinfo, &variant);
 	if (pri && variant > 0)
 		pri = 0;
-	return (pri);
+	return pri;
 }
 
 void
@@ -149,8 +149,7 @@
 	}
 
 	msize =  0x4000;
-	if (isa_mem_alloc (memt, msize, msize, 0, 0,
-			   &maddr, &memh)) {
+	if (isa_mem_alloc(memt, msize, msize, 0, 0, &maddr, &memh)) {
 		printf(": can't alloc mem space\n");
 		return;
 	}
@@ -159,7 +158,7 @@
 	sc->subregionmask = (1 << (msize / PCIC_MEM_PAGESIZE)) - 1;
 
 	isc->sc_ic = ic;
-	sc->pct = (pcmcia_chipset_tag_t) & pcic_isa_functions;
+	sc->pct = &pcic_isa_functions;
 
 	sc->iot = iot;
 	sc->ioh = ioh;

Index: src/sys/dev/pci/i82365_pci.c
diff -u src/sys/dev/pci/i82365_pci.c:1.31 src/sys/dev/pci/i82365_pci.c:1.32
--- src/sys/dev/pci/i82365_pci.c:1.31	Mon Sep 14 13:41:15 2009
+++ src/sys/dev/pci/i82365_pci.c	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_pci.c,v 1.31 2009/09/14 13:41:15 tsutsui Exp $	*/
+/*	$NetBSD: i82365_pci.c,v 1.32 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1997 Marc Horowitz.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82365_pci.c,v 1.31 2009/09/14 13:41:15 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82365_pci.c,v 1.32 2009/09/17 18:14:41 tsutsui Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -90,25 +90,23 @@
 int
 pcic_pci_match(device_t parent, cfdata_t match, void *aux)
 {
-	struct pci_attach_args *pa = (struct pci_attach_args *) aux;
+	struct pci_attach_args *pa = aux;
 
 	switch (PCI_VENDOR(pa->pa_id)) {
 	case PCI_VENDOR_CIRRUS:
-		switch(PCI_PRODUCT(pa->pa_id)) {
+		switch (PCI_PRODUCT(pa->pa_id)) {
 		case PCI_PRODUCT_CIRRUS_CL_PD6729:
 			break;
 		default:
-			return (0);
+			return 0;
 		}
 		break;
 	default:
-		return (0);
+		return 0;
 	}
-	return (1);
+	return 1;
 }
 
-void pcic_isa_config_interrupts(device_t);
-
 void
 pcic_pci_attach(device_t parent, device_t self, void *aux)
 {
@@ -152,7 +150,7 @@
 
 	/* end XXX */
 
-	sc->pct = (pcmcia_chipset_tag_t) & pcic_pci_functions;
+	sc->pct = &pcic_pci_functions;
 
 	sc->memt = memt;
 	sc->memh = memh;
@@ -182,7 +180,7 @@
 	 * we'll need to fix this.
 	 */
 	pcic_write(&sc->handle[0], PCIC_CIRRUS_EXTENDED_INDEX,
-		   PCIC_CIRRUS_EXT_CONTROL_1);
+	    PCIC_CIRRUS_EXT_CONTROL_1);
 	if ((pcic_read(&sc->handle[0], PCIC_CIRRUS_EXTENDED_DATA) &
 	    PCIC_CIRRUS_EXT_CONTROL_1_PCI_INTR_MASK)) {
 		aprint_error_dev(self, "PCI interrupts not supported\n");

Index: src/sys/dev/pci/i82365_pcivar.h
diff -u src/sys/dev/pci/i82365_pcivar.h:1.6 src/sys/dev/pci/i82365_pcivar.h:1.7
--- src/sys/dev/pci/i82365_pcivar.h:1.6	Mon Apr 28 20:23:54 2008
+++ src/sys/dev/pci/i82365_pcivar.h	Thu Sep 17 18:14:41 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: i82365_pcivar.h,v 1.6 2008/04/28 20:23:54 martin Exp $	*/
+/*	$NetBSD: i82365_pcivar.h,v 1.7 2009/09/17 18:14:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -35,13 +35,11 @@
  * Establish/disestablish interrupts for PCMCIA functions.
  */
 
-void *pcic_pci_machdep_intr_est(pci_chipset_tag_t);
+void	*pcic_pci_machdep_intr_est(pci_chipset_tag_t);
 
-void *pcic_pci_machdep_pcic_intr_establish(struct pcic_softc *,
-						int (*)(void *));
+void	*pcic_pci_machdep_pcic_intr_establish(struct pcic_softc *,
+	    int (*)(void *));
 
-void *pcic_pci_machdep_chip_intr_establish(pcmcia_chipset_handle_t,
-						struct pcmcia_function *,
-						int, int (*)(void *),
-						void *);
-void pcic_pci_machdep_chip_intr_disestablish(pcmcia_chipset_handle_t, void *);
+void	*pcic_pci_machdep_chip_intr_establish(pcmcia_chipset_handle_t,
+	    struct pcmcia_function *, int, int (*)(void *), void *);
+void	pcic_pci_machdep_chip_intr_disestablish(pcmcia_chipset_handle_t, void *);

Reply via email to