Message ID | 20230217-kobj_type-padata-v1-1-e70b6cab4875@weissschuh.net |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp674250wrn; Thu, 16 Feb 2023 19:37:25 -0800 (PST) X-Google-Smtp-Source: AK7set/tGzwzShsojzBA3QAraw0m/ElwbQY2JhivwfOcEVjnIP/aMYoXsOx0rdrHq950YPV4rYrG X-Received: by 2002:a05:6a21:9717:b0:c6:7673:f392 with SMTP id ub23-20020a056a21971700b000c67673f392mr6982216pzb.17.1676605045338; Thu, 16 Feb 2023 19:37:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676605045; cv=none; d=google.com; s=arc-20160816; b=FlkVlZbnxlFOwf4sX2YDCIFYGFjfCI8JqKDW26iInZQcZW4NfMdxZU8G3M0ii4AcPf JhqdCG3KSZrrnbKZhRcuQHI8B3nHhPsZ/ZRoR5WpN/YlR2KXzOVJIE5CectlIzLY/td9 9rqXxMdYMSKFZI0INI9osFkn1aH0ES97HPB2L6XbL20tZMeCWgLa2VZYcRK7oIl4pRAh gK4vxtS01maKJrGVgT2HIkoMwi9212SjoLS/Rg2i02ED7RRKcIrLzZPUidAOm4NYChCm DZd47Ji9gcyuFx8qG4q4IMPOczG4q5QD5GKnDEOUzvusmTe6To19Mc+DSliijkAJa7l+ jQeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:dkim-signature:from; bh=oBqoEvI6eZKJYxdKyQ9bvBkImmXOT6ZCNb89DnwvUxs=; b=oay4ejmGb/XbiHc0+MGpWcKmDQfTw5r9rB+xRxa5JN/vTBhigJUD3LdmcOIt4tYVYi kUaaniyCP4OEY09vUWURNUamJTIYBGJtP4mgzP9cf0omEDdd2eyb8krfmloQniDemebn wnDXpiLpIaYkXnRH7weIQ01KJxeLppXKBwCl9unIcl73KhNtYnsUZmY2qH/GetbkFuzI k2k/YA7CpdzBXJbS273/+vxRWND1UPP2yVC0HVpXJleklogo6DgVM3UhMN/8oElzDydH QSJl7t6wB5THTNu8gOafhS1v8iTF+WqYdOMdD+H0PltmMPcvcnXFYjeG+rYAW+DcctG7 qwsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b=afOOM1iV; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a170902a3c700b0019a7ef5e99fsi3275745plb.86.2023.02.16.19.37.11; Thu, 16 Feb 2023 19:37:25 -0800 (PST) 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=fail header.i=@weissschuh.net header.s=mail header.b=afOOM1iV; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbjBQDR6 (ORCPT <rfc822;aimixsaka@gmail.com> + 99 others); Thu, 16 Feb 2023 22:17:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229620AbjBQDR4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 16 Feb 2023 22:17:56 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA77974B; Thu, 16 Feb 2023 19:17:53 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= <linux@weissschuh.net> DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1676603871; bh=ztr+IdxQRuyl8zlbtckleV8yYV26Hon5GkrvjeCXFEU=; h=From:Date:Subject:To:Cc:From; b=afOOM1iVH7yC0qYEmdHyCXYUxJOZ/wI+wgcqpyIqPgrzmzdDG+7z3/4Gk9xtcr3+F XAIEMo5LLctMy1WLrofmrzfjXWws9p22wof8whxfSrWbUnSE1QjzxeDmoCqEUk8XJB PDdXmHWGWu0z5dUFFDJ+Ds7LYvX+tswrchBg4SMI= Date: Fri, 17 Feb 2023 03:17:49 +0000 Subject: [PATCH] padata: Make kobj_type structure constant MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230217-kobj_type-padata-v1-1-e70b6cab4875@weissschuh.net> X-B4-Tracking: v=1; b=H4sIANzx7mMC/x2N0QqDMAwAf0XybECzB4u/MoakbabZpJbWjQ3x3 xf2eAfHHVClqFQYmwOKvLXqlgz6toGwcJoFNRoDdXTpqB/wufnHtH+zYObIOyM5JzFI4IEcWOa 5CvrCKSwWpte6msxF7vr5f6638/wBMCwCNXcAAAA= To: Steffen Klassert <steffen.klassert@secunet.com>, Daniel Jordan <daniel.m.jordan@oracle.com> Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Th?= =?utf-8?q?omas_Wei=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676603869; l=1008; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ztr+IdxQRuyl8zlbtckleV8yYV26Hon5GkrvjeCXFEU=; b=XJNUk7Qrt62DXTVLIUYJKJzbykvAPZXCRfLiYSOkMlPlRs3CloLD4TRX2qiNyKKyN1fqwCYFX smwVNT1vvP9CX2qV7igv+fUPCmWOAwzOA74C5E8O1iU9MepET3AC2cY X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758047812390458330?= X-GMAIL-MSGID: =?utf-8?q?1758047812390458330?= |
Series |
padata: Make kobj_type structure constant
|
|
Commit Message
Thomas Weißschuh
Feb. 17, 2023, 3:17 a.m. UTC
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.
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
kernel/padata.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: 3ac88fa4605ec98e545fb3ad0154f575fda2de5f
change-id: 20230217-kobj_type-padata-288edceca728
Best regards,
Comments
On Fri, Feb 17, 2023 at 03:17:49AM +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. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> I see the symbol in .rodata now. Thanks. Acked-by: Daniel Jordan <daniel.m.jordan@oracle.com> > --- > kernel/padata.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/padata.c b/kernel/padata.c > index e007b8a4b738..106d08ee9ce2 100644 > --- a/kernel/padata.c > +++ b/kernel/padata.c > @@ -967,7 +967,7 @@ static const struct sysfs_ops padata_sysfs_ops = { > .store = padata_sysfs_store, > }; > > -static struct kobj_type padata_attr_type = { > +static const struct kobj_type padata_attr_type = { > .sysfs_ops = &padata_sysfs_ops, > .default_groups = padata_default_groups, > .release = padata_sysfs_release, > > --- > base-commit: 3ac88fa4605ec98e545fb3ad0154f575fda2de5f > change-id: 20230217-kobj_type-padata-288edceca728 > > Best regards, > -- > Thomas Weißschuh <linux@weissschuh.net> >
Thomas Weißschuh <linux@weissschuh.net> 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. > > Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> > --- > kernel/padata.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Patch applied. Thanks.
diff --git a/kernel/padata.c b/kernel/padata.c index e007b8a4b738..106d08ee9ce2 100644 --- a/kernel/padata.c +++ b/kernel/padata.c @@ -967,7 +967,7 @@ static const struct sysfs_ops padata_sysfs_ops = { .store = padata_sysfs_store, }; -static struct kobj_type padata_attr_type = { +static const struct kobj_type padata_attr_type = { .sysfs_ops = &padata_sysfs_ops, .default_groups = padata_default_groups, .release = padata_sysfs_release,