Commit a3a30a7c authored by Federico Vaga's avatar Federico Vaga Committed by Alessandro Rubini

(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: 's avatarFederico Vaga <federico.vaga@gmail.com>
Acked-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent c52f2e45
......@@ -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.
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
}
......
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment