Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1707786rwl; Fri, 24 Mar 2023 14:27:14 -0700 (PDT) X-Google-Smtp-Source: AKy350bDeZmnqWS37gnBpi4ICgFNx6joNpyMng6ewTmk/XI7rNQVdI+yKt4opWltYmSJUiUT5KyQ X-Received: by 2002:a17:906:71c4:b0:8b1:7857:2331 with SMTP id i4-20020a17090671c400b008b178572331mr4201325ejk.65.1679693233895; Fri, 24 Mar 2023 14:27:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679693233; cv=none; d=google.com; s=arc-20160816; b=t1u5yZ2mCnFMtw4Z0Npy+Jum8QP17eAo2RuKBePB7hYbto/4i//wTwXSTCYySxMtEG Md+VTx//42zmCnun47jSR/9l+vHpyEIJwXeZtp2j0IVr62kp41t85hPz7na4sDPEhPBU YhBfvCVSWA0/eV/tPm6sru3jVpHb8anR1jVVEvHKG7wzo1JnmuHvPaajs7t8D5K9q/yr vy+xvdFs3Q9JdDNotkYuktC6sCg+9AQv/vKm6Pe11dwXTTVmYaPSAFpx7dymfaIe1NyS dCIEsm7om3FkRWXRzo+uSjdYGVcXBuo+zGKsq2uYNc20X3qKjuGDVkdOLmmmBBt31vS7 YJ4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=8CF62lCEJdDQYaoRDfuRC+vtPpQ2ITwZpb2iSKXMRJE=; b=nBpVhWqonNqmW3iHSvcaXwV61TLmtkJiQzxAzyltqnw52XrE8nVla0G9QUE3RUkWvR kKsr04aVj4ymtYjUCiErg+RFlmfXoS6POaXezZmH8njqXcPu1po6mN4agOA89tWgMpV6 hUa1fAnMPNWpCx90vvHl2J8ek2UMstCDhMD8zHPWArR8w/IOYfzt3VfuC53FcV/+HoG/ xq7ROmHxzGQrGmITWU+x+FrnlATSUI5UvGG7UQh/iyamrJap8WkTBfp068PVIYMb07uU ACveaoyOuSN1/V9BjswNp2dOXECmxIFl27gStuu35XT5D5dD4+JaRjslS4TEZv91fbqv sOPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JDEQbwqu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gy19-20020a170906f25300b00925de8df75asi20683885ejb.75.2023.03.24.14.26.49; Fri, 24 Mar 2023 14:27:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=JDEQbwqu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231656AbjCXVNY (ORCPT + 99 others); Fri, 24 Mar 2023 17:13:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231248AbjCXVNX (ORCPT ); Fri, 24 Mar 2023 17:13:23 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02FF446BD for ; Fri, 24 Mar 2023 14:13:10 -0700 (PDT) Received: from [192.168.10.39] (unknown [119.155.2.20]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: usama.anjum) by madras.collabora.co.uk (Postfix) with ESMTPSA id E6490660206A; Fri, 24 Mar 2023 21:13:06 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1679692389; bh=txaOnhLH2D4ccynBeXElhufAFanFILa3bH1kjnNZJZs=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=JDEQbwquT419PgvuTeM/GUJzyJ9wfI32yh38MsDe1BWnDpI9euwMvGNmXd32pk10x 0qbJ4CDBKFSpSX62yN8dlQOD1FyHPjE9+y86tUm9+F2FrFwpXOPqmtjO/Yn9WzUM7k 6BUhprovL1Av+YDtR/cAWzclrH+XmFQLn9Mbs4cXhf7b0qUgMV4r437skabiA5KL0o myjBLJZjo/02bkjRDweJ8d48cyMb0eenTr7OfJviYfXlRWxKJIp+Tw4icvdbG+jbt+ Lmi4W47lDX8Z6vDxjW0/cQ7elNSDGgckYQZCKT8gL/YPS8V0juzb70A/N6ExKTpptW pPKkAANs5xPqQ== Message-ID: Date: Sat, 25 Mar 2023 02:12:55 +0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Cc: Muhammad Usama Anjum , damon@lists.linux.dev, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/damon/sysfs: make more kobj_type structures constant Content-Language: en-US To: =?UTF-8?Q?Thomas_Wei=c3=9fschuh?= , SeongJae Park , Andrew Morton References: <20230324-b4-kobj_type-damon2-v1-1-48ddbf1c8fcf@weissschuh.net> From: Muhammad Usama Anjum In-Reply-To: <20230324-b4-kobj_type-damon2-v1-1-48ddbf1c8fcf@weissschuh.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=1.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_SORBS_WEB, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/24/23 8:35 PM, Thomas Weißschuh wrote: > Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.") > the driver core allows the usage of const struct kobj_type. > > Take advantage of this to constify the structure definition to prevent > modification at runtime. > > These structures were not constified in > commit e56397e8c40d ("mm/damon/sysfs: make kobj_type structures constant") > as they didn't exist when that patch was written. > > Signed-off-by: Thomas Weißschuh Reviewed-by: Muhammad Usama Anjum > --- > mm/damon/sysfs-schemes.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c > index 3cdad5a7f936..50cf89dcd898 100644 > --- a/mm/damon/sysfs-schemes.c > +++ b/mm/damon/sysfs-schemes.c > @@ -384,7 +384,7 @@ static struct attribute *damon_sysfs_scheme_filter_attrs[] = { > }; > ATTRIBUTE_GROUPS(damon_sysfs_scheme_filter); > > -static struct kobj_type damon_sysfs_scheme_filter_ktype = { > +static const struct kobj_type damon_sysfs_scheme_filter_ktype = { > .release = damon_sysfs_scheme_filter_release, > .sysfs_ops = &kobj_sysfs_ops, > .default_groups = damon_sysfs_scheme_filter_groups, > @@ -503,7 +503,7 @@ static struct attribute *damon_sysfs_scheme_filters_attrs[] = { > }; > ATTRIBUTE_GROUPS(damon_sysfs_scheme_filters); > > -static struct kobj_type damon_sysfs_scheme_filters_ktype = { > +static const struct kobj_type damon_sysfs_scheme_filters_ktype = { > .release = damon_sysfs_scheme_filters_release, > .sysfs_ops = &kobj_sysfs_ops, > .default_groups = damon_sysfs_scheme_filters_groups, > > --- > base-commit: 1e760fa3596e8c7f08412712c168288b79670d78 > change-id: 20230324-b4-kobj_type-damon2-0238ee9e8d8c > > Best regards, -- BR, Muhammad Usama Anjum