Message ID | 20230214-kobj_type-iommu-v1-1-e7392834b9d0@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 s9csp2735330wrn; Mon, 13 Feb 2023 19:30:16 -0800 (PST) X-Google-Smtp-Source: AK7set9zn3ZZttPr0XAhcl9qiOFDGq/4tXULhjyWJZIhBK2cT3UfatNtRav9NCnTDBbqlWMIYcB7 X-Received: by 2002:a17:906:c58:b0:8b0:c7aa:3b53 with SMTP id t24-20020a1709060c5800b008b0c7aa3b53mr1212726ejf.70.1676345415952; Mon, 13 Feb 2023 19:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676345415; cv=none; d=google.com; s=arc-20160816; b=j9AfTYxcKRRiIxOsQD6dwyxU5v/hneIfeiFrzgshDt0gvDaa9nDNIU+8O+JiT1UT3b X5kCz+oe7F7X01hV/UnxvZEuvwTmvx66pSXeYti980f6v6IH8E35WaxU/U3V3Vn35Ol5 kRi7t/M0lt43fYK2rVUa8Tp1v60B/WRQAxJuORH77TfiAOpcF3bDBgsNVlKIr5WxzVov IdBIPNV+lSX8Q6JyrIFYj055y+jRR4+1qVsGSmnbCd8qPMTias2bVZHmqkJ1uDb6HVF5 yxsAU4Z0lskRKG1pYVIU68PIZuQRbaTzalNaDjQzqQZgzk5j91w9lWP4H82wH9f7+dVI xI7A== 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=mU4nPke77ZtQn3C5r02hrRZNALUffvXZI12aIkShgcg=; b=Uw9ryfMw/wtEgmt0sxvDKNaPlka9VBzTP9U4OXaSs2s81ri1EMCCWYQ1lscsN1+Er3 6SQWHXQQHDmVPlE9LmGLnbUPN1OKVefxVYz86iNKTm+9VcvcOdm/zHJ8MnNTMk0M/oqN V8N0SY1VPPnDl+6aP/D+y8/Yxi9ed9IbxWxgAIFxKmMl5kLsdE60Z7kkpTHYd1aHEGAx OcNPb5TbjBGnElOWIGbuo3tqznBcNUc0PT/JyLOJRjKtpETg07WQDAVm+JhW3FqX4uK2 QEzTkvZ9lmmgmTV71seVIlxhfa+P5cEk9O4cGqanzvZaeaMCm7FDnUKX0PKVQ5Tyr3rB RjnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@weissschuh.net header.s=mail header.b="mb/WwRgT"; 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 26-20020a170906009a00b008af28973deasi17412935ejc.33.2023.02.13.19.29.52; Mon, 13 Feb 2023 19:30:15 -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="mb/WwRgT"; 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 S231449AbjBNDZ7 (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Mon, 13 Feb 2023 22:25:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbjBNDZ5 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Feb 2023 22:25:57 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF2E15CA0 for <linux-kernel@vger.kernel.org>; Mon, 13 Feb 2023 19:25:56 -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=1676345155; bh=p4L49mbChSxCQh+1gr3d/qeZBfH3UZf9pKaoK+b7mC0=; h=From:Date:Subject:To:Cc:From; b=mb/WwRgTL2QhEmlKMLH/u7+r0ezedOvfC4jlXmXwgmwcvhTdUBxkvwn8adUWVVK6T U+OtIjsfhQTKsQm2jACTdTQHMyDgsT8m7BG53uhs+gEzub71sepOtmaYk7QiqTz5ax EbSLc8MLxXuwzXe6Uy5LzuWJ+cpgDEyWJzgcXvQ0= Date: Tue, 14 Feb 2023 03:25:53 +0000 Subject: [PATCH] iommu: make kobj_type structure constant MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230214-kobj_type-iommu-v1-1-e7392834b9d0@weissschuh.net> X-B4-Tracking: v=1; b=H4sIAED/6mMC/x2NUQqDMBAFryL73UASldJepZSSmKduq4kktbSId +/i58xjeBsVZEaha7VRxocLpyhgThV1o4sDFAdhstrW2ppGvZJ/Pt6/RYY0z6u6AAFNHYw+tyS VdwXKZxe7Ubq4TpPIJaPn73Fzu+/7HxIrOax2AAAA To: Joerg Roedel <joro@8bytes.org>, Will Deacon <will@kernel.org>, Robin Murphy <robin.murphy@arm.com> Cc: iommu@lists.linux.dev, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_We?= =?utf-8?q?i=C3=9Fschuh?= <linux@weissschuh.net> X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676345153; l=991; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=p4L49mbChSxCQh+1gr3d/qeZBfH3UZf9pKaoK+b7mC0=; b=F2OI/YrWuEvRZ0lkOwWMT92t+p6WIJDy0d5wL95cCSpmLS0m3ZM+VI5h3SMG9TT7x5rOxfLhg TV3C6uBlrvQAtINdCaBQB5M/Ze90nUb4wHcrmAmSSpElFumXT545O8y 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?1757775570714635432?= X-GMAIL-MSGID: =?utf-8?q?1757775570714635432?= |
Series |
iommu: make kobj_type structure constant
|
|
Commit Message
Thomas Weißschuh
Feb. 14, 2023, 3:25 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>
---
drivers/iommu/iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
base-commit: f6feea56f66d34259c4222fa02e8171c4f2673d1
change-id: 20230214-kobj_type-iommu-9eede43d1075
Best regards,
Comments
On Tue, Feb 14, 2023 at 03:25:53AM +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> > --- Applied, thanks. Btw, b4 reported DKIM errors checking your patch submission. Can you check the DKIM setup on you email domain, please?
Hi Joerg, Mar 22, 2023 08:20:14 Joerg Roedel <joro@8bytes.org>: > On Tue, Feb 14, 2023 at 03:25:53AM +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> >> --- > > Applied, thanks. Thanks! > Btw, b4 reported DKIM errors checking your patch submission. Can you > check the DKIM setup on you email domain, please? Should be fixed for some time. (After this patch, though) Thanks for the hint! Thomas
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 5f6a85aea501..1dd4ec31301d 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -714,7 +714,7 @@ static void iommu_group_release(struct kobject *kobj) kfree(group); } -static struct kobj_type iommu_group_ktype = { +static const struct kobj_type iommu_group_ktype = { .sysfs_ops = &iommu_group_sysfs_ops, .release = iommu_group_release, };