Commit f296190e authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Martin Schwidefsky

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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9078a549
......@@ -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);
}
/*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment