Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390/cio: Use array indices instead of pointer arithmetic

ccw_device_get_ciw() already uses array indices to iterate over the vector
of CIWs, but then switches to pointer arithmetic when returning the one it
found. Change this to make it more consistent.

Signed-off-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>

authored by

Benjamin Block and committed by
Alexander Gordeev
efd34db6 bc3d4402

+1 -1
+1 -1
drivers/s390/cio/device_ops.c
··· 445 445 return NULL; 446 446 for (ciw_cnt = 0; ciw_cnt < MAX_CIWS; ciw_cnt++) 447 447 if (cdev->private->dma_area->senseid.ciw[ciw_cnt].ct == ct) 448 - return cdev->private->dma_area->senseid.ciw + ciw_cnt; 448 + return &cdev->private->dma_area->senseid.ciw[ciw_cnt]; 449 449 return NULL; 450 450 } 451 451