mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-19 12:00:00 +00:00
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user