summaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-10-27 09:37:35 -0700
committerSantosh Shilimkar <ssantosh@kernel.org>2014-10-27 09:37:35 -0700
commit42813295dfa3689c73e93726e7ebbbdb466dd246 (patch)
tree387823539fc3ce0adb2f832590266aa30082c04c /drivers/soc
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
downloadlinux-42813295dfa3689c73e93726e7ebbbdb466dd246.tar.bz2
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')
-rw-r--r--drivers/soc/ti/knav_qmss.h8
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 {
list_for_each_entry(region, &kdev->regions, list)
#define first_region(kdev) \
- list_first_entry(&kdev->regions, \
- struct knav_region, list)
+ list_first_entry_or_null(&kdev->regions, \
+ struct knav_region, list)
#define for_each_queue_range(kdev, range) \
list_for_each_entry(range, &kdev->queue_ranges, list)
#define first_queue_range(kdev) \
- list_first_entry(&kdev->queue_ranges, \
- struct knav_range_info, list)
+ list_first_entry_or_null(&kdev->queue_ranges, \
+ struct knav_range_info, list)
#define for_each_pool(kdev, pool) \
list_for_each_entry(pool, &kdev->pools, list)