提交 f296190e 编写于 作者: M Masahiro Yamada 提交者: 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: NMasahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册