Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e2023b87 authored by Dave Jiang's avatar Dave Jiang Committed by Dan Williams
Browse files

isci: replace this_* and the_* variables with more meaningful names



Removed any instances of the_* and this_* to variable names that are more
meaningful and tell us what they actually are.

Signed-off-by: default avatarDave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
parent 2d70de5a
Loading
Loading
Loading
Loading
+30 −30
Original line number Diff line number Diff line
@@ -73,8 +73,8 @@
 *
 * Private operation for the pool
 */
#define SCI_POOL_INCREMENT(this_pool, index) \
	(((index) + 1) == (this_pool).size ? 0 : (index) + 1)
#define SCI_POOL_INCREMENT(pool, index) \
	(((index) + 1) == (pool).size ? 0 : (index) + 1)

/**
 * SCI_POOL_CREATE() -
@@ -98,8 +98,8 @@
 * This macro evaluates the pool and returns true if the pool is empty. If the
 * pool is empty the user should not perform any get operation on the pool.
 */
#define sci_pool_empty(this_pool) \
	((this_pool).get == (this_pool).put)
#define sci_pool_empty(pool) \
	((pool).get == (pool).put)

/**
 * sci_pool_full() -
@@ -107,8 +107,8 @@
 * This macro evaluates the pool and returns true if the pool is full.  If the
 * pool is full the user should not perform any put operation.
 */
#define sci_pool_full(this_pool) \
	(SCI_POOL_INCREMENT(this_pool, (this_pool).put) == (this_pool).get)
#define sci_pool_full(pool) \
	(SCI_POOL_INCREMENT(pool, (pool).put) == (pool).get)

/**
 * sci_pool_size() -
@@ -118,25 +118,25 @@
 * pointers can be written simultaneously by different users.  As a result,
 * this macro subtracts 1 from the internal size
 */
#define sci_pool_size(this_pool) \
	((this_pool).size - 1)
#define sci_pool_size(pool) \
	((pool).size - 1)

/**
 * sci_pool_count() -
 *
 * This macro indicates the number of elements currently contained in the pool.
 */
#define sci_pool_count(this_pool) \
#define sci_pool_count(pool) \
	(\
		sci_pool_empty((this_pool)) \
		sci_pool_empty((pool)) \
		? 0 \
		: (\
			sci_pool_full((this_pool)) \
			? sci_pool_size((this_pool)) \
			sci_pool_full((pool)) \
			? sci_pool_size((pool)) \
			: (\
				(this_pool).get > (this_pool).put \
				? ((this_pool).size - (this_pool).get + (this_pool).put) \
				: ((this_pool).put - (this_pool).get) \
				(pool).get > (pool).put \
				? ((pool).size - (pool).get + (pool).put) \
				: ((pool).put - (pool).get) \
				) \
			) \
	)
@@ -146,11 +146,11 @@
 *
 * This macro initializes the pool to an empty condition.
 */
#define sci_pool_initialize(this_pool) \
#define sci_pool_initialize(pool) \
	{ \
		(this_pool).size = (sizeof((this_pool).array) / sizeof((this_pool).array[0])); \
		(this_pool).get = 0; \
		(this_pool).put = 0; \
		(pool).size = (sizeof((pool).array) / sizeof((pool).array[0])); \
		(pool).get = 0; \
		(pool).put = 0; \
	}

/**
@@ -159,10 +159,10 @@
 * This macro will get the next free element from the pool. This should only be
 * called if the pool is not empty.
 */
#define sci_pool_get(this_pool, my_value) \
#define sci_pool_get(pool, my_value) \
	{ \
		(my_value) = (this_pool).array[(this_pool).get]; \
		(this_pool).get = SCI_POOL_INCREMENT((this_pool), (this_pool).get); \
		(my_value) = (pool).array[(pool).get]; \
		(pool).get = SCI_POOL_INCREMENT((pool), (pool).get); \
	}

/**
@@ -171,10 +171,10 @@
 * This macro will put the value into the pool. This should only be called if
 * the pool is not full.
 */
#define sci_pool_put(this_pool, the_value) \
#define sci_pool_put(pool, value) \
	{ \
		(this_pool).array[(this_pool).put] = (the_value); \
		(this_pool).put = SCI_POOL_INCREMENT((this_pool), (this_pool).put); \
		(pool).array[(pool).put] = (value); \
		(pool).put = SCI_POOL_INCREMENT((pool), (pool).put); \
	}

/**
@@ -183,16 +183,16 @@
 * This macro will search the pool and remove any elements in the pool matching
 * the supplied value. This method can only be utilized on pools
 */
#define sci_pool_erase(this_pool, type, the_value) \
#define sci_pool_erase(pool, type, value) \
	{ \
		type tmp_value;	\
		u32 index; \
		u32 element_count = sci_pool_count((this_pool)); \
		u32 element_count = sci_pool_count((pool)); \
 \
		for (index = 0; index < element_count; index++) {	\
			sci_pool_get((this_pool), tmp_value); \
			if (tmp_value != (the_value)) \
				sci_pool_put((this_pool), tmp_value); \
			sci_pool_get((pool), tmp_value); \
			if (tmp_value != (value)) \
				sci_pool_put((pool), tmp_value); \
		} \
	}

+196 −199

File changed.

Preview size limit exceeded, changes collapsed.

+9 −9
Original line number Diff line number Diff line
@@ -542,12 +542,12 @@ void scic_sds_controller_copy_sata_response(

enum sci_status scic_sds_controller_allocate_remote_node_context(
	struct scic_sds_controller *this_controller,
	struct scic_sds_remote_device *the_device,
	struct scic_sds_remote_device *sci_dev,
	u16 *node_id);

void scic_sds_controller_free_remote_node_context(
	struct scic_sds_controller *this_controller,
	struct scic_sds_remote_device *the_device,
	struct scic_sds_remote_device *sci_dev,
	u16 node_id);

union scu_remote_node_context *scic_sds_controller_get_remote_node_context_buffer(
@@ -565,25 +565,25 @@ struct scu_task_context *scic_sds_controller_get_task_context_buffer(

void scic_sds_controller_power_control_queue_insert(
	struct scic_sds_controller *this_controller,
	struct scic_sds_phy *the_phy);
	struct scic_sds_phy *sci_phy);

void scic_sds_controller_power_control_queue_remove(
	struct scic_sds_controller *this_controller,
	struct scic_sds_phy *the_phy);
	struct scic_sds_phy *sci_phy);

void scic_sds_controller_link_up(
	struct scic_sds_controller *this_controller,
	struct scic_sds_port *the_port,
	struct scic_sds_phy *the_phy);
	struct scic_sds_port *sci_port,
	struct scic_sds_phy *sci_phy);

void scic_sds_controller_link_down(
	struct scic_sds_controller *this_controller,
	struct scic_sds_port *the_port,
	struct scic_sds_phy *the_phy);
	struct scic_sds_port *sci_port,
	struct scic_sds_phy *sci_phy);

void scic_sds_controller_remote_device_stopped(
	struct scic_sds_controller *this_controller,
	struct scic_sds_remote_device *the_device);
	struct scic_sds_remote_device *sci_dev);

void scic_sds_controller_copy_task_context(
	struct scic_sds_controller *this_controller,
+202 −194

File changed.

Preview size limit exceeded, changes collapsed.

+147 −147

File changed.

Preview size limit exceeded, changes collapsed.

Loading