Skip to content

Commit e10fa47

Browse files
segoongregkh
authored andcommitted
USB: xhci: trivial: use ARRAY_SIZE
Change sizeof(x) / sizeof(*x) to ARRAY_SIZE(x). Signed-off-by: Kulikov Vasiliy <[email protected]> Cc: Sarah Sharp <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent f9ff70c commit e10fa47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/host/xhci-mem.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags)
15881588
unsigned int num_tests;
15891589
int i, ret;
15901590

1591-
num_tests = sizeof(simple_test_vector) / sizeof(simple_test_vector[0]);
1591+
num_tests = ARRAY_SIZE(simple_test_vector);
15921592
for (i = 0; i < num_tests; i++) {
15931593
ret = xhci_test_trb_in_td(xhci,
15941594
xhci->event_ring->first_seg,
@@ -1601,7 +1601,7 @@ static int xhci_check_trb_in_td_math(struct xhci_hcd *xhci, gfp_t mem_flags)
16011601
return ret;
16021602
}
16031603

1604-
num_tests = sizeof(complex_test_vector) / sizeof(complex_test_vector[0]);
1604+
num_tests = ARRAY_SIZE(complex_test_vector);
16051605
for (i = 0; i < num_tests; i++) {
16061606
ret = xhci_test_trb_in_td(xhci,
16071607
complex_test_vector[i].input_seg,

0 commit comments

Comments
 (0)