diff options
| author | Miaohe Lin <[email protected]> | 2024-06-12 15:18:23 +0800 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2024-07-03 19:30:10 -0700 |
| commit | 16117532744deac0d2efecf8a422b73a33afd216 (patch) | |
| tree | a8dc3bed0bc80c5deb9ea71215845ac41d40435c | |
| parent | 09a5336228420af4803c7bbdf91f8f24fc0942bf (diff) | |
mm/memory-failure: simplify put_ref_page()
Patch series "Some cleanups for memory-failure", v3.
This series contains a few cleanup patches to avoid exporting unused
function, add helper macro, fix some obsolete comments and so on. More
details can be found in the respective changelogs.
This patch (of 13):
Remove unneeded page != NULL check. pfn_to_page() won't return NULL. No
functional change intended.
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Miaohe Lin <[email protected]>
Cc: Borislav Petkov (AMD) <[email protected]>
Cc: Naoya Horiguchi <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: David Hildenbrand <[email protected]>
Cc: kernel test robot <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
| -rw-r--r-- | mm/memory-failure.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index f679b579d45d..2e6038c73119 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2120,14 +2120,10 @@ static inline unsigned long folio_free_raw_hwp(struct folio *folio, bool flag) /* Drop the extra refcount in case we come from madvise() */ static void put_ref_page(unsigned long pfn, int flags) { - struct page *page; - if (!(flags & MF_COUNT_INCREASED)) return; - page = pfn_to_page(pfn); - if (page) - put_page(page); + put_page(pfn_to_page(pfn)); } static int memory_failure_dev_pagemap(unsigned long pfn, int flags, |