From patchwork Wed Feb 24 20:03:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12102519 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E970C433E6 for ; Wed, 24 Feb 2021 20:03:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EFB2964F19 for ; Wed, 24 Feb 2021 20:03:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EFB2964F19 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=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 88DFA8D0010; Wed, 24 Feb 2021 15:03:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 818A88D0007; Wed, 24 Feb 2021 15:03:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 731278D0010; Wed, 24 Feb 2021 15:03:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id 5B2E38D0007 for ; Wed, 24 Feb 2021 15:03:07 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 2A41318020C25 for ; Wed, 24 Feb 2021 20:03:07 +0000 (UTC) X-FDA: 77854235214.23.D30EDB9 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf14.hostedemail.com (Postfix) with ESMTP id 87E90C0007EB for ; Wed, 24 Feb 2021 20:02:59 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 95C8A64F0E; Wed, 24 Feb 2021 20:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1614196985; bh=5ensjn87mwrhvVw9AWrG1AEYC9m7pNc5DwXvSR53iok=; h=Date:From:To:Subject:In-Reply-To:From; b=g7+uOkmIc4/PHUOjStnTjfbRllasW4w48W8KA7sKszdq5UmIrmwY3KqGcqw/TKxne KcrafOSDyQmVLaMuF5yavSTZ4FBP2MHtmM/bSkZfFhIYdyaaubGwN33DmCap7uxw4H Dm76YcHDkzMPV5miwUoVxPaM4IrMhnEl30cMIzA4= Date: Wed, 24 Feb 2021 12:03:05 -0800 From: Andrew Morton To: akpm@linux-foundation.org, enbyamy@gmail.com, linmiaohe@huawei.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, rikard.falkeborn@gmail.com, torvalds@linux-foundation.org, ying.huang@intel.com Subject: [patch 053/173] mm/swap_state: constify static struct attribute_group Message-ID: <20210224200305.LTTJ0SaIm%akpm@linux-foundation.org> In-Reply-To: <20210224115824.1e289a6895087f10c41dd8d6@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Stat-Signature: ifujzhmuq9dboetj39frs4r8hxewjuhm X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 87E90C0007EB Received-SPF: none (linux-foundation.org>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1614196979-907019 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/swap_state: constify static struct attribute_group The only usage of swap_attr_group is to pass its address to sysfs_create_group() which takes a pointer to const attribute_group. Make it const to allow the compiler to put it in read-only memory. Link: https://lkml.kernel.org/r/20210201233254.91809-1-rikard.falkeborn@gmail.com Signed-off-by: Rikard Falkeborn Reviewed-by: Amy Parker Acked-by: "Huang, Ying" Reviewed-by: Miaohe Lin Signed-off-by: Andrew Morton --- mm/swap_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/mm/swap_state.c~mm-swap_state-constify-static-struct-attribute_group +++ a/mm/swap_state.c @@ -927,7 +927,7 @@ static struct attribute *swap_attrs[] = NULL, }; -static struct attribute_group swap_attr_group = { +static const struct attribute_group swap_attr_group = { .attrs = swap_attrs, };