Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1365006rwl; Fri, 24 Mar 2023 09:32:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aFqb7kxJmm8IjbtIc+ek47pbYMYjLpZ9Cl4Ch4ej6XF6FgCkZ3kQ82gmdkDbliXQfSOAY4 X-Received: by 2002:a17:90b:4ac1:b0:23b:35f6:4ee6 with SMTP id mh1-20020a17090b4ac100b0023b35f64ee6mr3399592pjb.3.1679675569150; Fri, 24 Mar 2023 09:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679675569; cv=none; d=google.com; s=arc-20160816; b=jO/sSo3/82N9+6++1D7HXX+sm0eS14jlGUgARkyt/3CxFt/Skp4wn0WhgUT5nUX08A K8mAVtQYVMupTRPagj3+6KZ8sYiC87C9xjvByHbHsGxBZNaGTloIK6mVWKsTLB7wwcZc //PHvhMeOTTes+6zkOPrHnDk1xDLq+yFjuVdHoSt5VLChWIAIRWOr0Xgqg+Eyu84c2gt tPTAoYCUJyVc/eqpjcHkUSYyCwZDbkhD4My6GoHawyW4Jj+SbPkO6jYj+eK0bSv002Xy g/ZmU4lv5Dh/mln0/eIGGeFXN8pR3yZxzU5TebtI/q7OMmwP0fEig40LRQt4IVsl6VUC +/fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=q4fWVKUQx5n8bQI1VGGVH6TnCQpqPiW0MSEh446FJxc=; b=zGUgBumJf1T0+4xRJtJbxY9NioxThIIUMpC/XqYqik8DB+a/EgI4ZmZd7oD34LBycr Y1viuvM2HVyn0JWm7R3GPJZOIkpMemwnSzIvc65TsNIZA/W+WRnoQqPmaxa9dtphEcD8 XE7jNSY0dOZlyx0x/OQ7dpVyvvP4Y+VzHoNCNQT/87EkXcXV4YyTAIxkReywXQU0uTSI QrKZTAtj2NGQ+SFyuRVuOn975UWGWspxR+H+Lv2zMdtHOAO1hrXjHG7Uz2cpxVdygmZR BwwTWdjs9iEaDU8Nt0GyJaUreIDJp7wbUpRFCanCuiW4ObwHIUTLkwpEczPj0BDNYj3f gfiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P0WpNtnp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id iq24-20020a17090afb5800b002333adf6321si177435pjb.47.2023.03.24.09.32.36; Fri, 24 Mar 2023 09:32:49 -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=@kernel.org header.s=k20201202 header.b=P0WpNtnp; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231868AbjCXQce (ORCPT + 99 others); Fri, 24 Mar 2023 12:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231819AbjCXQca (ORCPT ); Fri, 24 Mar 2023 12:32:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25FA11CF55 for ; Fri, 24 Mar 2023 09:32:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 24D9562BE1 for ; Fri, 24 Mar 2023 16:32:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12C7FC433EF; Fri, 24 Mar 2023 16:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679675527; bh=3PNX/74+gO354UCpwGADQlXhZg6ETuvttetxAJdAwJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P0WpNtnpJMAZoEKPRE9qYxgAzboyL6KYBJl/kiLSZfdRyb5QKxMQaHd1+6nbqsaro 6lGu7JnxcTAU+F45eMpy4xfUzde82hmH3iun38YGfNOjfyxPxCgIg8YIcvYzVZEYKe G9H3Em5GY2TqMoSAt3rpACK693gKLpxLu0kmpDt8LsXGNVi4wJd174EYtU0SjG6GbP TmttDpoLg8ltbXfM2wUa54mJW13RN1PiOrtvy7HQZQeAyhes4/xDrVMgayULUAZ0BS dgSHP+YxXzVjdP3kS1+l3rjXEpvs6msE5XTcAR3Fe9GgoYKdJvYPfzNijbX7VrQSr2 0OqXK8pBNdVrA== From: SeongJae Park To: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Cc: SeongJae Park , Andrew Morton , 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 Date: Fri, 24 Mar 2023 16:32:02 +0000 Message-Id: <20230324163202.47254-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230324-b4-kobj_type-damon2-v1-1-48ddbf1c8fcf@weissschuh.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 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 Hi Thomas, On Fri, 24 Mar 2023 15:35:27 +0000 "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. Thank you for catching this! > > Signed-off-by: Thomas Weißschuh Reviewed-by: SeongJae Park Thanks, SJ > --- > 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, > -- > Thomas Weißschuh