s390/crashdump: use list_first_entry_or_null

The combo of list_empty() check and return list_first_entry()
can be replaced with list_first_entry_or_null().

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Masahiro Yamada 2016-09-13 03:10:39 +09:00 committed by Martin Schwidefsky
parent 9078a54996
commit f296190e41

View file

@ -71,9 +71,7 @@ struct save_area * __init save_area_alloc(bool is_boot_cpu)
*/
struct save_area * __init save_area_boot_cpu(void)
{
if (list_empty(&dump_save_areas))
return NULL;
return list_first_entry(&dump_save_areas, struct save_area, list);
return list_first_entry_or_null(&dump_save_areas, struct save_area, list);
}
/*