[PATCH V2 1/2] drivers/s390/cio/qdio_main.c: use unsigned int for count everywhere

From: Fabian Frederick
Date: Tue Jun 03 2014 - 15:56:26 EST


count was used unsigned int and int.

Cc: Sebastian Ott <sebott@xxxxxxxxxxxxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Fabian Frederick <fabf@xxxxxxxxx>
---
This is untested.

V2:
-count int -> unsigned int (suggested by Joe Perches)

drivers/s390/cio/qdio_main.c | 32 ++++++++++++++++++--------------
1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 77466c4..9fda160 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -124,10 +124,11 @@ static inline int qdio_check_ccq(struct qdio_q *q, unsigned int ccq)
* Stops processing if a state is different from the last buffers state.
*/
static int qdio_do_eqbs(struct qdio_q *q, unsigned char *state,
- int start, int count, int auto_ack)
+ int start, unsigned int count, int auto_ack)
{
- int rc, tmp_count = count, tmp_start = start, nr = q->nr, retried = 0;
+ int rc, tmp_start = start, nr = q->nr, retried = 0;
unsigned int ccq = 0;
+ unsigned tmp_count = count;

qperf_inc(q, eqbs);

@@ -178,10 +179,11 @@ again:
* error occurs.
*/
static int qdio_do_sqbs(struct qdio_q *q, unsigned char state, int start,
- int count)
+ unsigned int count)
{
unsigned int ccq = 0;
- int tmp_count = count, tmp_start = start;
+ unsigned int tmp_count = count;
+ int tmp_start = start;
int nr = q->nr;
int rc;

@@ -247,7 +249,7 @@ static inline int get_buf_state(struct qdio_q *q, unsigned int bufnr,

/* wrap-around safe setting of slsb states, returns number of changed buffers */
static inline int set_buf_states(struct qdio_q *q, int bufnr,
- unsigned char state, int count)
+ unsigned char state, unsigned int count)
{
int i;

@@ -409,7 +411,7 @@ static inline void qdio_stop_polling(struct qdio_q *q)
set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
}

-static inline void account_sbals(struct qdio_q *q, int count)
+static inline void account_sbals(struct qdio_q *q, unsigned int count)
{
int pos = 0;

@@ -423,7 +425,7 @@ static inline void account_sbals(struct qdio_q *q, int count)
q->q_stats.nr_sbals[pos]++;
}

-static void process_buffer_error(struct qdio_q *q, int count)
+static void process_buffer_error(struct qdio_q *q, unsigned int count)
{
unsigned char state = (q->is_input_q) ? SLSB_P_INPUT_NOT_INIT :
SLSB_P_OUTPUT_NOT_INIT;
@@ -454,7 +456,7 @@ set:
set_buf_states(q, q->first_to_check, state, count);
}

-static inline void inbound_primed(struct qdio_q *q, int count)
+static inline void inbound_primed(struct qdio_q *q, unsigned int count)
{
int new;

@@ -501,7 +503,8 @@ static inline void inbound_primed(struct qdio_q *q, int count)

static int get_inbound_buffer_frontier(struct qdio_q *q)
{
- int count, stop;
+ unsigned int count;
+ int stop;
unsigned char state = 0;

q->timestamp = get_tod_clock_fast();
@@ -608,7 +611,7 @@ static inline int contains_aobs(struct qdio_q *q)
return !q->is_input_q && q->u.out.use_cq;
}

-static inline void qdio_handle_aobs(struct qdio_q *q, int start, int count)
+static inline void qdio_handle_aobs(struct qdio_q *q, int start, unsigned int count)
{
unsigned char state = 0;
int j, b = start;
@@ -661,7 +664,7 @@ static void qdio_kick_handler(struct qdio_q *q)
{
int start = q->first_to_kick;
int end = q->first_to_check;
- int count;
+ unsigned int count;

if (unlikely(q->irq_ptr->state != QDIO_IRQ_STATE_ACTIVE))
return;
@@ -725,7 +728,8 @@ void qdio_inbound_processing(unsigned long data)

static int get_outbound_buffer_frontier(struct qdio_q *q)
{
- int count, stop;
+ int stop;
+ unsigned int count;
unsigned char state = 0;

q->timestamp = get_tod_clock_fast();
@@ -1013,7 +1017,7 @@ static void qdio_handle_activate_check(struct ccw_device *cdev,
{
struct qdio_irq *irq_ptr = cdev->private->qdio_data;
struct qdio_q *q;
- int count;
+ unsigned int count;

DBF_ERROR("%4x ACT CHECK", irq_ptr->schid.sch_no);
DBF_ERROR("intp :%lx", intparm);
@@ -1468,7 +1472,7 @@ out:
}
EXPORT_SYMBOL_GPL(qdio_activate);

-static inline int buf_in_between(int bufnr, int start, int count)
+static inline int buf_in_between(int bufnr, int start, unsigned int count)
{
int end = add_buf(start, count);

--
1.8.4.5

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