aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/qdio_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/cio/qdio_main.c')
-rw-r--r--drivers/s390/cio/qdio_main.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index 77466c4faabb..848e3b64ea6e 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -409,17 +409,16 @@ static inline void qdio_stop_polling(struct qdio_q *q)
409 set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT); 409 set_buf_state(q, q->u.in.ack_start, SLSB_P_INPUT_NOT_INIT);
410} 410}
411 411
412static inline void account_sbals(struct qdio_q *q, int count) 412static inline void account_sbals(struct qdio_q *q, unsigned int count)
413{ 413{
414 int pos = 0; 414 int pos;
415 415
416 q->q_stats.nr_sbal_total += count; 416 q->q_stats.nr_sbal_total += count;
417 if (count == QDIO_MAX_BUFFERS_MASK) { 417 if (count == QDIO_MAX_BUFFERS_MASK) {
418 q->q_stats.nr_sbals[7]++; 418 q->q_stats.nr_sbals[7]++;
419 return; 419 return;
420 } 420 }
421 while (count >>= 1) 421 pos = ilog2(count);
422 pos++;
423 q->q_stats.nr_sbals[pos]++; 422 q->q_stats.nr_sbals[pos]++;
424} 423}
425 424
@@ -1234,12 +1233,10 @@ int qdio_free(struct ccw_device *cdev)
1234 return -ENODEV; 1233 return -ENODEV;
1235 1234
1236 DBF_EVENT("qfree:%4x", cdev->private->schid.sch_no); 1235 DBF_EVENT("qfree:%4x", cdev->private->schid.sch_no);
1236 DBF_DEV_EVENT(DBF_ERR, irq_ptr, "dbf abandoned");
1237 mutex_lock(&irq_ptr->setup_mutex); 1237 mutex_lock(&irq_ptr->setup_mutex);
1238 1238
1239 if (irq_ptr->debug_area != NULL) { 1239 irq_ptr->debug_area = NULL;
1240 debug_unregister(irq_ptr->debug_area);
1241 irq_ptr->debug_area = NULL;
1242 }
1243 cdev->private->qdio_data = NULL; 1240 cdev->private->qdio_data = NULL;
1244 mutex_unlock(&irq_ptr->setup_mutex); 1241 mutex_unlock(&irq_ptr->setup_mutex);
1245 1242
@@ -1276,7 +1273,8 @@ int qdio_allocate(struct qdio_initialize *init_data)
1276 goto out_err; 1273 goto out_err;
1277 1274
1278 mutex_init(&irq_ptr->setup_mutex); 1275 mutex_init(&irq_ptr->setup_mutex);
1279 qdio_allocate_dbf(init_data, irq_ptr); 1276 if (qdio_allocate_dbf(init_data, irq_ptr))
1277 goto out_rel;
1280 1278
1281 /* 1279 /*
1282 * Allocate a page for the chsc calls in qdio_establish. 1280 * Allocate a page for the chsc calls in qdio_establish.