From a3a30a7c6b6c9e0f6d4e3493b01efbf71351e3f6 Mon Sep 17 00:00:00 2001
From: Federico Vaga <federico.vaga@gmail.com>
Date: Fri, 2 Nov 2012 22:11:44 +0100
Subject: [PATCH] (incompatible) rename: cset_for_each to chan_for_each

This is more in line with current kernel practices. We do
not use zio_ here because the context is always clear when this
macro is used.

Signed-off-by: Federico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini <rubini@gnudd.com>
---
 Documentation/zio/trigger.txt | 2 +-
 drivers/zio-ad788x.c          | 4 ++--
 drivers/zio-gpio.c            | 4 ++--
 drivers/zio-zero.c            | 2 +-
 include/linux/zio.h           | 4 ++--
 zio-sys.c                     | 8 ++++----
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/Documentation/zio/trigger.txt b/Documentation/zio/trigger.txt
index f6002ad..2edc373 100644
--- a/Documentation/zio/trigger.txt
+++ b/Documentation/zio/trigger.txt
@@ -106,7 +106,7 @@ doesn't change the software flow).
 Hardware-driven triggers will need to make their own work by themselves,
 but ZIO offers this helper macro to loop over all non-disabled channels:
 
-	cset_for_each(struct zio_cset *cset, struct zio_channel *ch)
+	chan_for_each(struct zio_channel *ch, struct zio_cset *cset)
 
 The macro works like "task_for_each" or "list_for_each" in the kernel
 headers.
diff --git a/drivers/zio-ad788x.c b/drivers/zio-ad788x.c
index 9df1779..4db0fd1 100644
--- a/drivers/zio-ad788x.c
+++ b/drivers/zio-ad788x.c
@@ -118,7 +118,7 @@ static void ad788x_complete(void *cont)
 	data = (uint16_t *) context->transfer.rx_buf;
 	data = &data[1];
 	/* demux data */
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 			buf = (uint16_t *)chan->active_block->data;
 			for (i = 0; i < context->nsamples; ++i)
 				buf[i] = data[i * context->chan_enable + j];
@@ -165,7 +165,7 @@ static int ad788x_input_cset(struct zio_cset *cset)
 	command = (uint16_t *)context->transfer.tx_buf;
 	/* configure transfer buffer*/
 	for (i = 0,  k = 0; i < nsamples; ++i)
-		cset_for_each(cset, chan)
+		chan_for_each(chan, cset)
 			command[k++] = (chan->index << AD788x_ADDR_SHIFT) |
 							ad788x->cmd;
 	command[k] = ad788x->cmd;
diff --git a/drivers/zio-gpio.c b/drivers/zio-gpio.c
index 6b9811a..fef8226 100644
--- a/drivers/zio-gpio.c
+++ b/drivers/zio-gpio.c
@@ -48,7 +48,7 @@ static int zgp_output(struct zio_cset *cset)
 	uint8_t datum;
 	int i;
 
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		block = chan->active_block;
 		if (!block)
 			continue;
@@ -71,7 +71,7 @@ static int zgp_input(struct zio_cset *cset)
 	uint8_t datum;
 	int i, j;
 
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		block = chan->active_block;
 		if (!block)
 			continue;
diff --git a/drivers/zio-zero.c b/drivers/zio-zero.c
index 4bc6113..b48534d 100644
--- a/drivers/zio-zero.c
+++ b/drivers/zio-zero.c
@@ -58,7 +58,7 @@ static int zzero_input_8(struct zio_cset *cset)
 	int i;
 
 	/* Return immediately: just fill the blocks */
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		block = chan->active_block;
 		if (!block)
 			continue;
diff --git a/include/linux/zio.h b/include/linux/zio.h
index f2df483..9782e32 100644
--- a/include/linux/zio.h
+++ b/include/linux/zio.h
@@ -258,7 +258,7 @@ static inline struct zio_channel *__first_enabled_chan(struct zio_cset *cset,
 		chan++;
 	}
 }
-#define cset_for_each(cset, cptr)				\
+#define chan_for_each(cptr, cset)				\
 		for (cptr = cset->chan;				\
 		     (cptr = __first_enabled_chan(cset, cptr));	\
 		     cptr++)
@@ -275,7 +275,7 @@ static inline unsigned int __get_n_chan_enabled(struct zio_cset *cset) {
 	struct zio_channel *chan;
 	unsigned int n_chan = 0;
 
-	cset_for_each(cset, chan)
+	chan_for_each(chan, cset)
 		++n_chan;
 	return n_chan;
 }
diff --git a/zio-sys.c b/zio-sys.c
index 97e2a94..5d38732 100644
--- a/zio-sys.c
+++ b/zio-sys.c
@@ -177,7 +177,7 @@ static void __zio_internal_data_done(struct zio_cset *cset)
 	zbuf = cset->zbuf;
 
 	if (unlikely((ti->flags & ZIO_DIR) == ZIO_DIR_OUTPUT)) {
-		cset_for_each(cset, chan) {
+		chan_for_each(chan, cset) {
 			bi = chan->bi;
 			block = chan->active_block;
 			if (block)
@@ -188,7 +188,7 @@ static void __zio_internal_data_done(struct zio_cset *cset)
 		return;
 	}
 	/* DIR_INPUT */
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		bi = chan->bi;
 		block = chan->active_block;
 		if (!block)
@@ -236,7 +236,7 @@ static void __zio_internal_abort_free(struct zio_cset *cset)
 	struct zio_channel *chan;
 	struct zio_block *block;
 
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		block = chan->active_block;
 		if (block)
 			cset->zbuf->b_op->free_block(chan->bi, block);
@@ -288,7 +288,7 @@ static void __zio_fire_input_trigger(struct zio_ti *ti)
 	pr_debug("%s:%d\n", __func__, __LINE__);
 
 	/* Allocate the buffer for the incoming sample, in active channels */
-	cset_for_each(cset, chan) {
+	chan_for_each(chan, cset) {
 		ch_ctrl = chan->current_ctrl;
 		ctrl = zio_alloc_control(GFP_ATOMIC);
 		if (!ctrl) {
-- 
GitLab