diff options
author | Geliang Tang <geliangtang@163.com> | 2015-11-16 08:46:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-08 00:25:50 -0500 |
commit | 0d0ce9c00b866090a69a2d63118b3e09cc71c96d (patch) | |
tree | a039d6ca6e45f1a3498fb3a822a9add1fd007b8f /drivers/misc/mic | |
parent | 7b64dbf849abdd7e769820e25120758f956a7f13 (diff) |
misc: mic/scif: use list_next_entry instead of list_entry_next
list_next_entry has been defined in list.h, so I replace list_entry_next
with it.
Signed-off-by: Geliang Tang <geliangtang@163.com>
Reviewed-by: Sudeep Dutt <sudeep.dutt@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mic')
-rw-r--r-- | drivers/misc/mic/scif/scif_dma.c | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/drivers/misc/mic/scif/scif_dma.c b/drivers/misc/mic/scif/scif_dma.c index 95a13c629a8e..8804bccf04b6 100644 --- a/drivers/misc/mic/scif/scif_dma.c +++ b/drivers/misc/mic/scif/scif_dma.c | |||
@@ -74,11 +74,6 @@ struct scif_copy_work { | |||
74 | bool ordered; | 74 | bool ordered; |
75 | }; | 75 | }; |
76 | 76 | ||
77 | #ifndef list_entry_next | ||
78 | #define list_entry_next(pos, member) \ | ||
79 | list_entry(pos->member.next, typeof(*pos), member) | ||
80 | #endif | ||
81 | |||
82 | /** | 77 | /** |
83 | * scif_reserve_dma_chan: | 78 | * scif_reserve_dma_chan: |
84 | * @ep: Endpoint Descriptor. | 79 | * @ep: Endpoint Descriptor. |
@@ -851,7 +846,7 @@ static void scif_rma_local_cpu_copy(s64 offset, struct scif_window *window, | |||
851 | (window->nr_pages << PAGE_SHIFT); | 846 | (window->nr_pages << PAGE_SHIFT); |
852 | while (rem_len) { | 847 | while (rem_len) { |
853 | if (offset == end_offset) { | 848 | if (offset == end_offset) { |
854 | window = list_entry_next(window, list); | 849 | window = list_next_entry(window, list); |
855 | end_offset = window->offset + | 850 | end_offset = window->offset + |
856 | (window->nr_pages << PAGE_SHIFT); | 851 | (window->nr_pages << PAGE_SHIFT); |
857 | } | 852 | } |
@@ -957,7 +952,7 @@ scif_rma_list_dma_copy_unaligned(struct scif_copy_work *work, | |||
957 | remaining_len -= tail_len; | 952 | remaining_len -= tail_len; |
958 | while (remaining_len) { | 953 | while (remaining_len) { |
959 | if (offset == end_offset) { | 954 | if (offset == end_offset) { |
960 | window = list_entry_next(window, list); | 955 | window = list_next_entry(window, list); |
961 | end_offset = window->offset + | 956 | end_offset = window->offset + |
962 | (window->nr_pages << PAGE_SHIFT); | 957 | (window->nr_pages << PAGE_SHIFT); |
963 | } | 958 | } |
@@ -1064,7 +1059,7 @@ scif_rma_list_dma_copy_unaligned(struct scif_copy_work *work, | |||
1064 | } | 1059 | } |
1065 | if (tail_len) { | 1060 | if (tail_len) { |
1066 | if (offset == end_offset) { | 1061 | if (offset == end_offset) { |
1067 | window = list_entry_next(window, list); | 1062 | window = list_next_entry(window, list); |
1068 | end_offset = window->offset + | 1063 | end_offset = window->offset + |
1069 | (window->nr_pages << PAGE_SHIFT); | 1064 | (window->nr_pages << PAGE_SHIFT); |
1070 | } | 1065 | } |
@@ -1147,13 +1142,13 @@ static int _scif_rma_list_dma_copy_aligned(struct scif_copy_work *work, | |||
1147 | (dst_window->nr_pages << PAGE_SHIFT); | 1142 | (dst_window->nr_pages << PAGE_SHIFT); |
1148 | while (remaining_len) { | 1143 | while (remaining_len) { |
1149 | if (src_offset == end_src_offset) { | 1144 | if (src_offset == end_src_offset) { |
1150 | src_window = list_entry_next(src_window, list); | 1145 | src_window = list_next_entry(src_window, list); |
1151 | end_src_offset = src_window->offset + | 1146 | end_src_offset = src_window->offset + |
1152 | (src_window->nr_pages << PAGE_SHIFT); | 1147 | (src_window->nr_pages << PAGE_SHIFT); |
1153 | scif_init_window_iter(src_window, &src_win_iter); | 1148 | scif_init_window_iter(src_window, &src_win_iter); |
1154 | } | 1149 | } |
1155 | if (dst_offset == end_dst_offset) { | 1150 | if (dst_offset == end_dst_offset) { |
1156 | dst_window = list_entry_next(dst_window, list); | 1151 | dst_window = list_next_entry(dst_window, list); |
1157 | end_dst_offset = dst_window->offset + | 1152 | end_dst_offset = dst_window->offset + |
1158 | (dst_window->nr_pages << PAGE_SHIFT); | 1153 | (dst_window->nr_pages << PAGE_SHIFT); |
1159 | scif_init_window_iter(dst_window, &dst_win_iter); | 1154 | scif_init_window_iter(dst_window, &dst_win_iter); |
@@ -1314,13 +1309,13 @@ static int scif_rma_list_dma_copy_aligned(struct scif_copy_work *work, | |||
1314 | remaining_len -= tail_len; | 1309 | remaining_len -= tail_len; |
1315 | while (remaining_len) { | 1310 | while (remaining_len) { |
1316 | if (src_offset == end_src_offset) { | 1311 | if (src_offset == end_src_offset) { |
1317 | src_window = list_entry_next(src_window, list); | 1312 | src_window = list_next_entry(src_window, list); |
1318 | end_src_offset = src_window->offset + | 1313 | end_src_offset = src_window->offset + |
1319 | (src_window->nr_pages << PAGE_SHIFT); | 1314 | (src_window->nr_pages << PAGE_SHIFT); |
1320 | scif_init_window_iter(src_window, &src_win_iter); | 1315 | scif_init_window_iter(src_window, &src_win_iter); |
1321 | } | 1316 | } |
1322 | if (dst_offset == end_dst_offset) { | 1317 | if (dst_offset == end_dst_offset) { |
1323 | dst_window = list_entry_next(dst_window, list); | 1318 | dst_window = list_next_entry(dst_window, list); |
1324 | end_dst_offset = dst_window->offset + | 1319 | end_dst_offset = dst_window->offset + |
1325 | (dst_window->nr_pages << PAGE_SHIFT); | 1320 | (dst_window->nr_pages << PAGE_SHIFT); |
1326 | scif_init_window_iter(dst_window, &dst_win_iter); | 1321 | scif_init_window_iter(dst_window, &dst_win_iter); |
@@ -1405,9 +1400,9 @@ static int scif_rma_list_dma_copy_aligned(struct scif_copy_work *work, | |||
1405 | if (remaining_len) { | 1400 | if (remaining_len) { |
1406 | loop_len = remaining_len; | 1401 | loop_len = remaining_len; |
1407 | if (src_offset == end_src_offset) | 1402 | if (src_offset == end_src_offset) |
1408 | src_window = list_entry_next(src_window, list); | 1403 | src_window = list_next_entry(src_window, list); |
1409 | if (dst_offset == end_dst_offset) | 1404 | if (dst_offset == end_dst_offset) |
1410 | dst_window = list_entry_next(dst_window, list); | 1405 | dst_window = list_next_entry(dst_window, list); |
1411 | 1406 | ||
1412 | src_dma_addr = __scif_off_to_dma_addr(src_window, src_offset); | 1407 | src_dma_addr = __scif_off_to_dma_addr(src_window, src_offset); |
1413 | dst_dma_addr = __scif_off_to_dma_addr(dst_window, dst_offset); | 1408 | dst_dma_addr = __scif_off_to_dma_addr(dst_window, dst_offset); |
@@ -1550,12 +1545,12 @@ static int scif_rma_list_cpu_copy(struct scif_copy_work *work) | |||
1550 | end_dst_offset = dst_window->offset + | 1545 | end_dst_offset = dst_window->offset + |
1551 | (dst_window->nr_pages << PAGE_SHIFT); | 1546 | (dst_window->nr_pages << PAGE_SHIFT); |
1552 | if (src_offset == end_src_offset) { | 1547 | if (src_offset == end_src_offset) { |
1553 | src_window = list_entry_next(src_window, list); | 1548 | src_window = list_next_entry(src_window, list); |
1554 | scif_init_window_iter(src_window, | 1549 | scif_init_window_iter(src_window, |
1555 | &src_win_iter); | 1550 | &src_win_iter); |
1556 | } | 1551 | } |
1557 | if (dst_offset == end_dst_offset) { | 1552 | if (dst_offset == end_dst_offset) { |
1558 | dst_window = list_entry_next(dst_window, list); | 1553 | dst_window = list_next_entry(dst_window, list); |
1559 | scif_init_window_iter(dst_window, | 1554 | scif_init_window_iter(dst_window, |
1560 | &dst_win_iter); | 1555 | &dst_win_iter); |
1561 | } | 1556 | } |