summaryrefslogtreecommitdiff
path: root/drivers/s390/cio/qdio.h
diff options
context:
space:
mode:
authorJulian Wiedmann <jwi@linux.ibm.com>2019-09-30 16:42:35 +0300
committerVasily Gorbik <gor@linux.ibm.com>2019-10-31 19:20:50 +0300
commit4611281021e9835da825b79ba9b62a31670e0791 (patch)
tree0e379ab0c6b35dbb8f099b43053fae040ddd0e0b /drivers/s390/cio/qdio.h
parentd86f71fd43fd477ee17a5db5d2ae88ad6c6cf983 (diff)
downloadlinux-4611281021e9835da825b79ba9b62a31670e0791.tar.xz
s390/qdio: add statistics helper macro
qperf_inc() takes a queue as input, but actually updates the statistics in its qdio_irq parent. In some contexts we already have access to the qdio_irq struct, and can avoid the additional dereference. Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio/qdio.h')
-rw-r--r--drivers/s390/cio/qdio.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/s390/cio/qdio.h b/drivers/s390/cio/qdio.h
index 7ee29daf216e..a6cbbd8e928c 100644
--- a/drivers/s390/cio/qdio.h
+++ b/drivers/s390/cio/qdio.h
@@ -317,13 +317,15 @@ struct qdio_irq {
#define qperf(__qdev, __attr) ((__qdev)->perf_stat.(__attr))
-#define qperf_inc(__q, __attr) \
+#define QDIO_PERF_STAT_INC(__irq, __attr) \
({ \
- struct qdio_irq *qdev = (__q)->irq_ptr; \
+ struct qdio_irq *qdev = __irq; \
if (qdev->perf_stat_enabled) \
(qdev->perf_stat.__attr)++; \
})
+#define qperf_inc(__q, __attr) QDIO_PERF_STAT_INC((__q)->irq_ptr, __attr)
+
static inline void account_sbals_error(struct qdio_q *q, int count)
{
q->q_stats.nr_sbal_error += count;