PERFORCE change 172722 for review

Rafal Jaworowski raj at FreeBSD.org
Thu Jan 7 11:51:10 UTC 2010


http://p4web.freebsd.org/chv.cgi?CH=172722

Change 172722 by raj at 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)


More information about the p4-projects mailing list