Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Jan 2010 11:51:09 GMT
From:      Rafal Jaworowski <raj@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 172722 for review
Message-ID:  <201001071151.o07Bp9iQ051220@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/chv.cgi?CH=172722

Change 172722 by raj@raj_fdt on 2010/01/07 11:50:47

	Unobfuscate the code.
	
	Submitted by:	imp	

Affected files ...

.. //depot/projects/fdt/sys/dev/tsec/if_tsec_fdt.c#2 edit
.. //depot/projects/fdt/sys/dev/uart/uart_bus_fdt.c#2 edit

Differences ...

==== //depot/projects/fdt/sys/dev/tsec/if_tsec_fdt.c#2 (text+ko) ====

@@ -232,8 +232,8 @@
 {
 	int error;
 
-	(*ires) = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, irid, RF_ACTIVE);
-	if ((*ires) == NULL) {
+	*ires = bus_alloc_resource_any(sc->dev, SYS_RES_IRQ, irid, RF_ACTIVE);
+	if (*ires == NULL) {
 		device_printf(sc->dev, "could not allocate %s IRQ\n", iname);
 		return (ENXIO);
 	}
@@ -243,7 +243,7 @@
 		device_printf(sc->dev, "failed to set up %s IRQ\n", iname);
 		if (bus_release_resource(sc->dev, SYS_RES_IRQ, *irid, *ires))
 			device_printf(sc->dev, "could not release %s IRQ\n", iname);
-		(*ires) = NULL;
+		*ires = NULL;
 		return (error);
 	}
 	return (0);

==== //depot/projects/fdt/sys/dev/uart/uart_bus_fdt.c#2 (text+ko) ====

@@ -63,15 +63,15 @@
 	phandle_t node;
 	pcell_t clock, shift;
 
-	if (ofw_bus_is_compatible(dev, "ns16550")) {
-		sc = device_get_softc(dev);
-		sc->sc_class = &uart_ns8250_class;
+	if (!ofw_bus_is_compatible(dev, "ns16550"))
+		return (ENXIO);
+
+	sc = device_get_softc(dev);
+	sc->sc_class = &uart_ns8250_class;
 
-		node = ofw_bus_get_node(dev);
-		if ((OF_getprop(node, "clock-frequency", &clock,
-		    sizeof(clock))) <= 0)
-			return (ENXIO);
-	} else
+	node = ofw_bus_get_node(dev);
+	if ((OF_getprop(node, "clock-frequency", &clock,
+	    sizeof(clock))) <= 0)
 		return (ENXIO);
 
 	if (clock == 0)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001071151.o07Bp9iQ051220>