From patchwork Fri Nov 5 20:47:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605873 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7AA4C433EF for ; Fri, 5 Nov 2021 20:47:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C0776056B for ; Fri, 5 Nov 2021 20:47:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9C0776056B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 38FE39400E6; Fri, 5 Nov 2021 16:47:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 341BA9400C1; Fri, 5 Nov 2021 16:47:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E1789400E6; Fri, 5 Nov 2021 16:47:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0225.hostedemail.com [216.40.44.225]) by kanga.kvack.org (Postfix) with ESMTP id 05A209400C1 for ; Fri, 5 Nov 2021 16:47:09 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BF8738249980 for ; Fri, 5 Nov 2021 20:47:08 +0000 (UTC) X-FDA: 78776061336.06.F51EA85 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf22.hostedemail.com (Postfix) with ESMTP id 6C4DC1907 for ; Fri, 5 Nov 2021 20:47:08 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 7895A60240; Fri, 5 Nov 2021 20:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636145227; bh=87zvzF9/N7d3ulr8MqQTzSdhjGE1/wQ5xaFcOURjg6M=; h=Date:From:To:Subject:In-Reply-To:From; b=yhYZLuUGkR0hfixY3Qvz1PsUH2TXx7BNvRn2rpO2Lqj3YR1BXcrfFEg9nQRz+38G7 RyEKt5uoSzUBd7E3XszwyBTdpr2KKYNNpD9hwd0aQ4MtmDSY2OP2LJRS5lAVSntZBD /QQtf/VnII7vk4YOi3XAyn8k/u1tPUDGT9CuwYqc= Date: Fri, 05 Nov 2021 13:47:07 -0700 From: Andrew Morton To: akpm@linux-foundation.org, anshuman.khandual@arm.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, rikard.falkeborn@gmail.com, sj@kernel.org, torvalds@linux-foundation.org Subject: [patch 237/262] mm/damon/vaddr: constify static mm_walk_ops Message-ID: <20211105204707.YEomvIVb6%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 6C4DC1907 X-Stat-Signature: iesqzyp8ajygja31meh8yg9udknps8wq Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=yhYZLuUG; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1636145228-376991 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: From: Rikard Falkeborn Subject: mm/damon/vaddr: constify static mm_walk_ops The only usage of these structs is to pass their addresses to walk_page_range(), which takes a pointer to const mm_walk_ops as argument. Make them const to allow the compiler to put them in read-only memory. Link: https://lkml.kernel.org/r/20211014075042.17174-2-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Reviewed-by: SeongJae Park Reviewed-by: Anshuman Khandual Signed-off-by: Andrew Morton --- mm/damon/vaddr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/damon/vaddr.c~mm-damon-vaddr-constify-static-mm_walk_ops +++ a/mm/damon/vaddr.c @@ -394,7 +394,7 @@ out: return 0; } -static struct mm_walk_ops damon_mkold_ops = { +static const struct mm_walk_ops damon_mkold_ops = { .pmd_entry = damon_mkold_pmd_entry, }; @@ -490,7 +490,7 @@ out: return 0; } -static struct mm_walk_ops damon_young_ops = { +static const struct mm_walk_ops damon_young_ops = { .pmd_entry = damon_young_pmd_entry, };