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

Commit 813f0339 authored by Ivo van Doorn's avatar Ivo van Doorn Committed by John W. Linville
Browse files

rt2x00: Rename queue->lock to queue->index_lock



The queue->lock is only used to protect the index
numbers. Rename the lock accordingly.

Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 821cde63
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -342,7 +342,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
	    sprintf(data, "qid\tcount\tlimit\tlength\tindex\tdma done\tdone\n");

	queue_for_each(intf->rt2x00dev, queue) {
		spin_lock_irqsave(&queue->lock, irqflags);
		spin_lock_irqsave(&queue->index_lock, irqflags);

		temp += sprintf(temp, "%d\t%d\t%d\t%d\t%d\t%d\t%d\n", queue->qid,
				queue->count, queue->limit, queue->length,
@@ -350,7 +350,7 @@ static ssize_t rt2x00debug_read_queue_stats(struct file *file,
				queue->index[Q_INDEX_DMA_DONE],
				queue->index[Q_INDEX_DONE]);

		spin_unlock_irqrestore(&queue->lock, irqflags);
		spin_unlock_irqrestore(&queue->index_lock, irqflags);
	}

	size = strlen(data);
+9 −9
Original line number Diff line number Diff line
@@ -641,10 +641,10 @@ void rt2x00queue_for_each_entry(struct data_queue *queue,
	 * it should not be kicked during this run, since it
	 * is part of another TX operation.
	 */
	spin_lock_irqsave(&queue->lock, irqflags);
	spin_lock_irqsave(&queue->index_lock, irqflags);
	index_start = queue->index[start];
	index_end = queue->index[end];
	spin_unlock_irqrestore(&queue->lock, irqflags);
	spin_unlock_irqrestore(&queue->index_lock, irqflags);

	/*
	 * Start from the TX done pointer, this guarentees that we will
@@ -698,11 +698,11 @@ struct queue_entry *rt2x00queue_get_entry(struct data_queue *queue,
		return NULL;
	}

	spin_lock_irqsave(&queue->lock, irqflags);
	spin_lock_irqsave(&queue->index_lock, irqflags);

	entry = &queue->entries[queue->index[index]];

	spin_unlock_irqrestore(&queue->lock, irqflags);
	spin_unlock_irqrestore(&queue->index_lock, irqflags);

	return entry;
}
@@ -718,7 +718,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
		return;
	}

	spin_lock_irqsave(&queue->lock, irqflags);
	spin_lock_irqsave(&queue->index_lock, irqflags);

	queue->index[index]++;
	if (queue->index[index] >= queue->limit)
@@ -733,7 +733,7 @@ void rt2x00queue_index_inc(struct data_queue *queue, enum queue_index index)
		queue->count++;
	}

	spin_unlock_irqrestore(&queue->lock, irqflags);
	spin_unlock_irqrestore(&queue->index_lock, irqflags);
}

static void rt2x00queue_reset(struct data_queue *queue)
@@ -741,7 +741,7 @@ static void rt2x00queue_reset(struct data_queue *queue)
	unsigned long irqflags;
	unsigned int i;

	spin_lock_irqsave(&queue->lock, irqflags);
	spin_lock_irqsave(&queue->index_lock, irqflags);

	queue->count = 0;
	queue->length = 0;
@@ -751,7 +751,7 @@ static void rt2x00queue_reset(struct data_queue *queue)
		queue->last_action[i] = jiffies;
	}

	spin_unlock_irqrestore(&queue->lock, irqflags);
	spin_unlock_irqrestore(&queue->index_lock, irqflags);
}

void rt2x00queue_stop_queues(struct rt2x00_dev *rt2x00dev)
@@ -903,7 +903,7 @@ void rt2x00queue_uninitialize(struct rt2x00_dev *rt2x00dev)
static void rt2x00queue_init(struct rt2x00_dev *rt2x00dev,
			     struct data_queue *queue, enum data_queue_qid qid)
{
	spin_lock_init(&queue->lock);
	spin_lock_init(&queue->index_lock);

	queue->rt2x00dev = rt2x00dev;
	queue->qid = qid;
+2 −2
Original line number Diff line number Diff line
@@ -398,7 +398,7 @@ enum queue_index {
 * @entries: Base address of the &struct queue_entry which are
 *	part of this queue.
 * @qid: The queue identification, see &enum data_queue_qid.
 * @lock: Spinlock to protect index handling. Whenever @index, @index_done or
 * @index_lock: Spinlock to protect index handling. Whenever @index, @index_done or
 *	@index_crypt needs to be changed this lock should be grabbed to prevent
 *	index corruption due to concurrency.
 * @count: Number of frames handled in the queue.
@@ -422,7 +422,7 @@ struct data_queue {

	enum data_queue_qid qid;

	spinlock_t lock;
	spinlock_t index_lock;
	unsigned int count;
	unsigned short limit;
	unsigned short threshold;