Skip to content

Commit

Permalink
s390/crashdump: use list_first_entry_or_null
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
masahir0y authored and Martin Schwidefsky committed Sep 20, 2016
1 parent 9078a54 commit f296190
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions arch/s390/kernel/crash_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit f296190

Please sign in to comment.