From patchwork Tue Dec 21 18:57:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 12690421 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 C80F8C433F5 for ; Tue, 21 Dec 2021 18:57:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E76326B0073; Tue, 21 Dec 2021 13:57:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E26476B0074; Tue, 21 Dec 2021 13:57:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEDEC6B007B; Tue, 21 Dec 2021 13:57:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id C272E6B0073 for ; Tue, 21 Dec 2021 13:57:33 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 75B7B181AC9C6 for ; Tue, 21 Dec 2021 18:57:33 +0000 (UTC) X-FDA: 78942709986.10.760B38C Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) by imf20.hostedemail.com (Postfix) with ESMTP id B5EDA1C003E for ; Tue, 21 Dec 2021 18:57:28 +0000 (UTC) Received: by mail-wr1-f41.google.com with SMTP id i22so28774584wrb.13 for ; Tue, 21 Dec 2021 10:57:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oz8dk8oTqNlrelETkrVGvji9LdFSHnx5F8oTMuBE0Nc=; b=Ah2SHEpnBcBcPua80EJAwv8ExpQj7bnvEAqY5+1i3VJMepgCo37lu2XGYoL9SgHhpf irikJh7SUMcFSrv9xQKe5KBkuvwIoakQuzDAyNrG98d5mxmLTaReWm+CAL/zWULByH8P 8vYOZeDzF7Hf7CE7se2aWDrL4YYWp7/ztHFUSIDrcguACKSWNXfB5ThZPS22GRYIAeKI Jl3VyTuJNxfAX2DcWethbVHm7DSPSNW+PMIdWw/XuH20JinREjenCYBDN2O9l4cjix8P 15T1LQ8xzqBUANi2zcorqDYsNxPHGPg0cviutF2apRtw5gq2fx2rXKdej6t5eg2404dL WUuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=oz8dk8oTqNlrelETkrVGvji9LdFSHnx5F8oTMuBE0Nc=; b=18hOhWSmXJ18SXk+T5e+gMybk6sI+bApfV0EMwDvbg50KhVJpX79effDsco9MORX9/ ssPiw6Wm+MurK7yIlbYIC1yP8M33DAt/gVg07UmZaYIdMBj6Mi6w6IA+JAIWGWNc8QAB IeLPOf7zlx5WUbgw3ljUKeg7eZ89T6Lt9AQYBhoGmqCEhgZc+JH01lS8ErGSFTtvkb7f 9EyoDOkwbErQWTXQjL6Xt4nzV6Enb8ekq7zQFx3hK18LPvrPpMJp1cHk9EAxoKl7mEv4 Rl9GT7NYii9kWOfHhyyFJ5a3lqHUYa2UcX/J9WG2f3RTdVJrBp+ZpCe9q13G+k0FX4Ea S7sw== X-Gm-Message-State: AOAM531OzSLuijAyxe59iZuq24Urvynt7NJmEl+xkZbA6Gkz8/q2SiNB JsYRVUsBK7GTFNz+0N67X9A= X-Google-Smtp-Source: ABdhPJy+YcIhCNNhvocsLpYph1fkT/zzszM8QMR80ObfgMxnWPHNZndlLKaGALuTLQn8ophBYwJODw== X-Received: by 2002:adf:9d82:: with SMTP id p2mr3763540wre.414.1640113051961; Tue, 21 Dec 2021 10:57:31 -0800 (PST) Received: from localhost (cpc154979-craw9-2-0-cust193.16-3.cable.virginm.net. [80.193.200.194]) by smtp.gmail.com with ESMTPSA id y12sm4629445wry.24.2021.12.21.10.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Dec 2021 10:57:30 -0800 (PST) From: Colin Ian King To: Andrew Morton , linux-mm@kvack.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm/migrate: remove redundant variables used in a for-loop Date: Tue, 21 Dec 2021 18:57:29 +0000 Message-Id: <20211221185729.609630-1-colin.i.king@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Ah2SHEpn; spf=pass (imf20.hostedemail.com: domain of colin.i.king@gmail.com designates 209.85.221.41 as permitted sender) smtp.mailfrom=colin.i.king@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: B5EDA1C003E X-Stat-Signature: 84qujggi896eoddpiw77k9sy5urbmds4 X-HE-Tag: 1640113048-800094 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000193, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The variable addr is being set and incremented in a for-loop but not actually being used. It is redundant and so addr and also variable start can be removed. Signed-off-by: Colin Ian King --- mm/migrate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index c9296d63878d..38d4df747172 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2459,8 +2459,7 @@ static bool migrate_vma_check_page(struct page *page) static void migrate_vma_unmap(struct migrate_vma *migrate) { const unsigned long npages = migrate->npages; - const unsigned long start = migrate->start; - unsigned long addr, i, restore = 0; + unsigned long i, restore = 0; bool allow_drain = true; lru_add_drain(); @@ -2506,7 +2505,7 @@ static void migrate_vma_unmap(struct migrate_vma *migrate) } } - for (addr = start, i = 0; i < npages && restore; addr += PAGE_SIZE, i++) { + for (i = 0; i < npages && restore; i++) { struct page *page = migrate_pfn_to_page(migrate->src[i]); if (!page || (migrate->src[i] & MIGRATE_PFN_MIGRATE))