Skip to content

Commit

Permalink
mm/shmem: remove unneeded assignments in shmem_get_folio_gfp()
Browse files Browse the repository at this point in the history
After the rework of shmem_get_folio_gfp() to use a folio, the local
variable hindex is only needed to be set once before passing it to
shmem_add_to_page_cache().

Remove the unneeded initialization and assignments of the variable hindex
before the actual effective assignment and first use.

No functional change. No change in object code.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Lukas Bulwahn <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
bulwahn authored and akpm00 committed Nov 9, 2022
1 parent 3e0ee84 commit 6fe7d71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,
struct shmem_sb_info *sbinfo;
struct mm_struct *charge_mm;
struct folio *folio;
pgoff_t hindex = index;
pgoff_t hindex;
gfp_t huge_gfp;
int error;
int once = 0;
Expand Down Expand Up @@ -1864,7 +1864,6 @@ static int shmem_get_folio_gfp(struct inode *inode, pgoff_t index,
}

if (folio) {
hindex = folio->index;
if (sgp == SGP_WRITE)
folio_mark_accessed(folio);
if (folio_test_uptodate(folio))
Expand Down

0 comments on commit 6fe7d71

Please sign in to comment.