From patchwork Sat Feb 11 03:32:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Patchwork-Id: 13136854 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01FEC636D4 for ; Sat, 11 Feb 2023 03:32:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbjBKDcq (ORCPT ); Fri, 10 Feb 2023 22:32:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229675AbjBKDcn (ORCPT ); Fri, 10 Feb 2023 22:32:43 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [IPv6:2a01:4f8:c010:41de::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A00BD3A084; Fri, 10 Feb 2023 19:32:41 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=weissschuh.net; s=mail; t=1676086359; bh=xCR+Ptx6qu9QePzl0md5Tsxq8IclLdgajMp2skUDWSc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=tjJ371sCoO1zJbo7cmqZNdMb2QRhvV5t2iWk3im7znsFjqLfTX/pxHH+uAaL8a9T3 //NN5GCYPGBaQNtuHZl/sOPwyAbUxmGvYLUk2mOQqZiNNXsxDLa9gwihMyiRwev3bM lsI/Jq58r6WgjI+MSMGDizgdXvwVN9El+6D6fZl4= Date: Sat, 11 Feb 2023 03:32:29 +0000 Subject: [PATCH 1/3] net: bridge: make kobj_type structure constant MIME-Version: 1.0 Message-Id: <20230211-kobj_type-net-v1-1-e3bdaa5d8a78@weissschuh.net> References: <20230211-kobj_type-net-v1-0-e3bdaa5d8a78@weissschuh.net> In-Reply-To: <20230211-kobj_type-net-v1-0-e3bdaa5d8a78@weissschuh.net> To: Roopa Prabhu , Nikolay Aleksandrov , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Trond Myklebust , Anna Schumaker , Chuck Lever , Jeff Layton Cc: bridge@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, =?utf-8?q?Thomas_W?= =?utf-8?q?ei=C3=9Fschuh?= X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1676086354; l=853; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=xCR+Ptx6qu9QePzl0md5Tsxq8IclLdgajMp2skUDWSc=; b=3aDYol7gtnPLDHJSwXBlVN4BDObAVRLqF9OMQ5NSZZNm/Q0NK+m80glqETx4nA62qGsG3Sn2R BipVF0Z8vquDqfEi5RLD7lwkMmJIy5wI/KI1M5EXd10qNp9hM5WxpaY X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/bridge/br_if.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index ad13b48e3e08..24f01ff113f0 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -269,7 +269,7 @@ static void brport_get_ownership(const struct kobject *kobj, kuid_t *uid, kgid_t net_ns_get_ownership(dev_net(p->dev), uid, gid); } -static struct kobj_type brport_ktype = { +static const struct kobj_type brport_ktype = { #ifdef CONFIG_SYSFS .sysfs_ops = &brport_sysfs_ops, #endif