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:
parent
9078a54996
commit
f296190e41
|
@ -71,9 +71,7 @@ struct save_area * __init save_area_alloc(bool is_boot_cpu)
|
||||||
*/
|
*/
|
||||||
struct save_area * __init save_area_boot_cpu(void)
|
struct save_area * __init save_area_boot_cpu(void)
|
||||||
{
|
{
|
||||||
if (list_empty(&dump_save_areas))
|
return list_first_entry_or_null(&dump_save_areas, struct save_area, list);
|
||||||
return NULL;
|
|
||||||
return list_first_entry(&dump_save_areas, struct save_area, list);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue