From: Lukas Bulwahn <lukas.bulwahn@gmail.com>
To: Matthew Wilcox <willy@infradead.org>,
Hugh Dickins <hughd@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH] mm/shmem: remove unneeded assignments in shmem_get_folio_gfp()
Date: Fri, 7 Oct 2022 10:50:27 +0200 [thread overview]
Message-ID: <20221007085027.6309-1-lukas.bulwahn@gmail.com> (raw)
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.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
---
mm/shmem.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index 8280a5cb48df..5577c3e72e0f 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1833,7 +1833,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;
@@ -1871,7 +1871,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))
--
2.17.1
reply other threads:[~2022-10-07 8:51 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221007085027.6309-1-lukas.bulwahn@gmail.com \
--to=lukas.bulwahn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).