lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 27 Mar 2015 16:01:05 -0500
From:	"J. German Rivera" <German.Rivera@...escale.com>
To:	<gregkh@...uxfoundation.org>, <arnd@...db.de>,
	<devel@...verdev.osuosl.org>, <linux-kernel@...r.kernel.org>
CC:	<stuart.yoder@...escale.com>, <Kim.Phillips@...escale.com>,
	<scottwood@...escale.com>, <agraf@...e.de>,
	<bhamciu1@...escale.com>, <R89243@...escale.com>,
	<bhupesh.sharma@...escale.com>, <nir.erez@...escale.com>,
	<richard.schmitt@...escale.com>,
	"J. German Rivera" <German.Rivera@...escale.com>
Subject: [PATCH 2/6] staging: fsl-mc: Removed reordering of MC objects during bus scan

MC objects discovered during an MC bus scan were being reordered
to ensure that all allocatable objects are probed before all
non-allocatable objects. However, this is not necessary, as
drivers of non-allocatable objects, that allocate allocatable
objects in their probe function, can return -EPROBE_DEFER
if such allocations fail.

Signed-off-by: J. German Rivera <German.Rivera@...escale.com>
---
 drivers/staging/fsl-mc/bus/dprc-driver.c | 32 --------------------------------
 1 file changed, 32 deletions(-)

diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
index 65de1d75..f02e5e4 100644
--- a/drivers/staging/fsl-mc/bus/dprc-driver.c
+++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
@@ -205,36 +205,6 @@ static void dprc_cleanup_all_resource_pools(struct fsl_mc_device *mc_bus_dev)
 		dprc_cleanup_resource_pool(mc_bus_dev, pool_type);
 }
 
-static void reorder_obj_desc_array(struct dprc_obj_desc *obj_desc_array,
-				   int num_devs)
-{
-	struct dprc_obj_desc tmp;
-	struct dprc_obj_desc *top_cursor = &obj_desc_array[0];
-	struct dprc_obj_desc *bottom_cursor = &obj_desc_array[num_devs - 1];
-
-	/*
-	 * Reorder entries in obj_desc_array so that all allocatable devices
-	 * are placed before all non-allocatable devices:
-	 *
-	 * Loop Invariant: everything before top_cursor is allocatable and
-	 * everything after bottom_cursor is non-allocatable.
-	 */
-	while (top_cursor < bottom_cursor) {
-		if (FSL_MC_IS_ALLOCATABLE(top_cursor->type)) {
-			top_cursor++;
-		} else {
-			if (FSL_MC_IS_ALLOCATABLE(bottom_cursor->type)) {
-				tmp = *bottom_cursor;
-				*bottom_cursor = *top_cursor;
-				*top_cursor = tmp;
-				top_cursor++;
-			}
-
-			bottom_cursor--;
-		}
-	}
-}
-
 /**
  * dprc_scan_objects - Discover objects in a DPRC
  *
@@ -313,8 +283,6 @@ int dprc_scan_objects(struct fsl_mc_device *mc_bus_dev)
 				"%d out of %d devices could not be retrieved\n",
 				dprc_get_obj_failures, num_child_objects);
 		}
-
-		reorder_obj_desc_array(child_obj_desc_array, num_child_objects);
 	}
 
 	dprc_remove_devices(mc_bus_dev, child_obj_desc_array,
-- 
2.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ