From mboxrd@z Thu Jan 1 00:00:00 1970 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.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 3F17DC433E0 for ; Tue, 2 Feb 2021 01:36:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E112064E46 for ; Tue, 2 Feb 2021 01:36:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231236AbhBBBgg (ORCPT ); Mon, 1 Feb 2021 20:36:36 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12000 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbhBBBgd (ORCPT ); Mon, 1 Feb 2021 20:36:33 -0500 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DV6mn14TQzjH0Y; Tue, 2 Feb 2021 09:34:33 +0800 (CST) Received: from [10.174.179.241] (10.174.179.241) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Tue, 2 Feb 2021 09:35:44 +0800 Subject: Re: [PATCH] mm/swap_state: Constify static struct attribute_group To: Rikard Falkeborn CC: , , Huang Ying , Andrew Morton References: <20210201233254.91809-1-rikard.falkeborn@gmail.com> From: Miaohe Lin Message-ID: <8c500328-fda5-7a13-64d4-5d0bd292fcfa@huawei.com> Date: Tue, 2 Feb 2021 09:35:44 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210201233254.91809-1-rikard.falkeborn@gmail.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.241] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi: On 2021/2/2 7:32, Rikard Falkeborn wrote: > 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. > > Signed-off-by: Rikard Falkeborn Looks good to me. Thanks. Reviewed-by: Miaohe Lin > --- > mm/swap_state.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/swap_state.c b/mm/swap_state.c > index d0d417efeecc..3cdee7b11da9 100644 > --- a/mm/swap_state.c > +++ b/mm/swap_state.c > @@ -901,7 +901,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, > }; > >