diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-10-27 12:37:35 -0400 |
---|---|---|
committer | Santosh Shilimkar <ssantosh@kernel.org> | 2014-10-27 12:37:35 -0400 |
commit | 42813295dfa3689c73e93726e7ebbbdb466dd246 (patch) | |
tree | 387823539fc3ce0adb2f832590266aa30082c04c /drivers/soc/ti | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
soc: ti: Use list_first_entry_or_null() at appropriate places
Use list_first_entry_or_null() for first_region() and first_queue_range().
list_first_entry() expects the list is not empty, so first_region() and
first_queue_range() never return NULL.
Thus use list_first_entry_or_null() instead.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Santosh Shilimkar <ssantosh@kernel.org>
Diffstat (limited to 'drivers/soc/ti')
-rw-r--r-- | drivers/soc/ti/knav_qmss.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h index bc9dcc8cc3ce..51da2341280d 100644 --- a/drivers/soc/ti/knav_qmss.h +++ b/drivers/soc/ti/knav_qmss.h | |||
@@ -348,15 +348,15 @@ struct knav_range_info { | |||
348 | list_for_each_entry(region, &kdev->regions, list) | 348 | list_for_each_entry(region, &kdev->regions, list) |
349 | 349 | ||
350 | #define first_region(kdev) \ | 350 | #define first_region(kdev) \ |
351 | list_first_entry(&kdev->regions, \ | 351 | list_first_entry_or_null(&kdev->regions, \ |
352 | struct knav_region, list) | 352 | struct knav_region, list) |
353 | 353 | ||
354 | #define for_each_queue_range(kdev, range) \ | 354 | #define for_each_queue_range(kdev, range) \ |
355 | list_for_each_entry(range, &kdev->queue_ranges, list) | 355 | list_for_each_entry(range, &kdev->queue_ranges, list) |
356 | 356 | ||
357 | #define first_queue_range(kdev) \ | 357 | #define first_queue_range(kdev) \ |
358 | list_first_entry(&kdev->queue_ranges, \ | 358 | list_first_entry_or_null(&kdev->queue_ranges, \ |
359 | struct knav_range_info, list) | 359 | struct knav_range_info, list) |
360 | 360 | ||
361 | #define for_each_pool(kdev, pool) \ | 361 | #define for_each_pool(kdev, pool) \ |
362 | list_for_each_entry(pool, &kdev->pools, list) | 362 | list_for_each_entry(pool, &kdev->pools, list) |