From patchwork Fri Oct 7 08:50:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Bulwahn X-Patchwork-Id: 13000898 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 086CFC433F5 for ; Fri, 7 Oct 2022 08:51:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4366B6B0072; Fri, 7 Oct 2022 04:51:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E6AE6B0073; Fri, 7 Oct 2022 04:51:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2AF1F6B0074; Fri, 7 Oct 2022 04:51:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 19B666B0072 for ; Fri, 7 Oct 2022 04:51:16 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id DC17812126E for ; Fri, 7 Oct 2022 08:51:15 +0000 (UTC) X-FDA: 79993534110.24.9D5C832 Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf17.hostedemail.com (Postfix) with ESMTP id 7D3974001F for ; Fri, 7 Oct 2022 08:51:15 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id m15so6042927edb.13 for ; Fri, 07 Oct 2022 01:51:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cLFQR3kf1OGc7RQtWTzli/pg6vzYR5MtvqkuvoSq10U=; b=D11I+OvztMi9pekoUUOm09LpYiyz+HrZJYT/FygLFpJ9/PXxr88+u4y/Heyji+CS9S KGSPYRzX6tmi/TNrWJhGYuruka01TsLnnZOyfk7eoGF7xLWHsYM/rUliQqg1W90uTP9H NtdCAH061CrucF7V8dkPlF0e62nePZxXxqWhMD6Xjz3BJv4A1Pgz5HvYOyRPdcAkwVRN V00OaOxgZaVHlxAgSJnxVP27diOZZ+luJ0qrkccCoUmrRgVPyVDPEJ6GhANNyQrGBG6v ROswcdZDsZK2ft5QzvPplwZcLJzb/xckycHCOyS6GCx6Nx9AslT6qK/hIL/+9e8QWxb6 Y4AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cLFQR3kf1OGc7RQtWTzli/pg6vzYR5MtvqkuvoSq10U=; b=LRjI6aV4TEy8NjugkvwmsDaUGvHGzYVEFA5eHD3piQbJeJoI3BBFMpNjfjq68cknRq idAzMuWG/xI0uabOqJW7J63ENaYiGWHERNou/fB9Nt7dQkks4l71nSH37NMnsEMlnV9U Z3eZpl8pJgngjXhU9NBeypIzjMtf58uQ3JLPJYtrGOAnlJukItzYX96+XNPA/WrmVyX6 63himE0SyeW6brWMoJWOiITn6dP2AcLnORLRWMNwMKrixwWk5UiP7zo1SBirqT0vjdrV QumGDyVgitbSGkTpLqOByo/HAicqRcp2LI4AoMByyGc8Ob/oZOAKfuKBFTpnUXvzx9an myJw== X-Gm-Message-State: ACrzQf2X5Aw/Eav/4gVJe3nKuIgavLMd1mEBcVVPAkvBayvCAye6pHrD MoVuuk5Mq/IJ4ieaC5JQEqo= X-Google-Smtp-Source: AMsMyM4TdfDLjqMXqmX4Onf8iCVlyu0YZh3B46wR6fYKNu0PV5e+5E58d2my43J26fSS+FeMbP8ZIA== X-Received: by 2002:a05:6402:357:b0:458:5cb6:f587 with SMTP id r23-20020a056402035700b004585cb6f587mr3586230edw.183.1665132673923; Fri, 07 Oct 2022 01:51:13 -0700 (PDT) Received: from felia.fritz.box (200116b826e52a0050a02ad37da10fc5.dip.versatel-1u1.de. [2001:16b8:26e5:2a00:50a0:2ad3:7da1:fc5]) by smtp.gmail.com with ESMTPSA id p21-20020a170906a01500b0072f112a6ad2sm882806ejy.97.2022.10.07.01.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Oct 2022 01:51:13 -0700 (PDT) From: Lukas Bulwahn To: Matthew Wilcox , Hugh Dickins , Andrew Morton , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Lukas Bulwahn Subject: [PATCH] mm/shmem: remove unneeded assignments in shmem_get_folio_gfp() Date: Fri, 7 Oct 2022 10:50:27 +0200 Message-Id: <20221007085027.6309-1-lukas.bulwahn@gmail.com> X-Mailer: git-send-email 2.17.1 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665132675; a=rsa-sha256; cv=none; b=J7cBdEX4SocN4CJyCNcD0ZsXvIHAECYPTzqrbtAsoBwCqO7WwOkT8ie241AaFu3EJe+NqC eBxXf7vcDRBK/OAYh0QCeK79sGnB0sRqBZzgaYRtvD9XsUG0Yk3oxollG7XzOcG1VNVQ34 lS/KSOCoC/8QMuSUiIBTiwj3l281zN0= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=D11I+Ovz; spf=pass (imf17.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=lukas.bulwahn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665132675; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=cLFQR3kf1OGc7RQtWTzli/pg6vzYR5MtvqkuvoSq10U=; b=1ch0wKn+fqB7ppEm38T3WPqQ3997sHE7dPQgaYzw0oNgECqQKtF6yQKq7CiVAqTCyTeu7A F4035/z1Xsjdn0okv1ccK6y4ppS7BigcmFuWyWSt1oplULQzYeVF8M8OOP+jDmKJZ3DM4D zVXV+2fTs/ZoAIG8vvL0Vq8O7qqIwdg= X-Rspamd-Queue-Id: 7D3974001F X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=D11I+Ovz; spf=pass (imf17.hostedemail.com: domain of lukas.bulwahn@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=lukas.bulwahn@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Stat-Signature: g5mmfqutpayzrorbieiqrfgrhc491o8y X-Rspamd-Server: rspam04 X-HE-Tag: 1665132675-381181 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 --- 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))