Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Oct 2016 08:52:42 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r307346 - stable/11/sys/dev/ofw
Message-ID:  <201610150852.u9F8qgeR048213@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mmel
Date: Sat Oct 15 08:52:42 2016
New Revision: 307346
URL: https://svnweb.freebsd.org/changeset/base/307346

Log:
  MFC r302560:
  
    OFWPCI: Fix style(9).  No functional change.

Modified:
  stable/11/sys/dev/ofw/ofwpci.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/dev/ofw/ofwpci.c
==============================================================================
--- stable/11/sys/dev/ofw/ofwpci.c	Sat Oct 15 08:31:46 2016	(r307345)
+++ stable/11/sys/dev/ofw/ofwpci.c	Sat Oct 15 08:52:42 2016	(r307346)
@@ -195,7 +195,7 @@ ofw_pci_init(device_t dev)
 	sc->sc_io_rman.rm_type = RMAN_ARRAY;
 	sc->sc_io_rman.rm_descr = "PCI I/O Ports";
 	error = rman_init(&sc->sc_io_rman);
-	if (error) {
+	if (error != 0) {
 		device_printf(dev, "rman_init() failed. error = %d\n", error);
 		goto out;
 	}
@@ -203,7 +203,7 @@ ofw_pci_init(device_t dev)
 	sc->sc_mem_rman.rm_type = RMAN_ARRAY;
 	sc->sc_mem_rman.rm_descr = "PCI Memory";
 	error = rman_init(&sc->sc_mem_rman);
-	if (error) {
+	if (error != 0) {
 		device_printf(dev, "rman_init() failed. error = %d\n", error);
 		goto out;
 	}
@@ -226,7 +226,7 @@ ofw_pci_init(device_t dev)
 			break;
 		}
 
-		if (error) {
+		if (error != 0) {
 			device_printf(dev,
 			    "rman_manage_region(%x, %#jx, %#jx) failed. "
 			    "error = %d\n", rp->pci_hi &
@@ -257,7 +257,7 @@ ofw_pci_attach(device_t dev)
 	sc = device_get_softc(dev);
 	if (!sc->sc_initialized) {
 		error = ofw_pci_init(dev);
-		if (error)
+		if (error != 0)
 			return (error);
 	}
 
@@ -437,9 +437,11 @@ ofw_pci_release_resource(device_t bus, d
 {
 
 	if (rman_get_flags(res) & RF_ACTIVE) {
-		int error = bus_deactivate_resource(child, type, rid, res);
-		if (error)
-			return error;
+		int error;
+
+		error = bus_deactivate_resource(child, type, rid, res);
+		if (error != 0)
+			return (error);
 	}
 
 	return (rman_release_resource(res));
@@ -544,9 +546,10 @@ static int
 ofw_pci_adjust_resource(device_t bus, device_t child, int type,
     struct resource *res, rman_res_t start, rman_res_t end)
 {
-	struct rman *rm = NULL;
-	struct ofw_pci_softc *sc = device_get_softc(bus);
+	struct rman *rm;
+	struct ofw_pci_softc *sc;
 
+	sc = device_get_softc(bus);
 	KASSERT(!(rman_get_flags(res) & RF_ACTIVE),
 	    ("active resources cannot be adjusted"));
 	if (rman_get_flags(res) & RF_ACTIVE)



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