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 BC567C7EE23 for ; Mon, 27 Feb 2023 03:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229816AbjB0DVf (ORCPT ); Sun, 26 Feb 2023 22:21:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbjB0DVd (ORCPT ); Sun, 26 Feb 2023 22:21:33 -0500 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B521FF06; Sun, 26 Feb 2023 19:21:32 -0800 (PST) From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1677468090; bh=pwAr4IcABcpaKfjReOPmkgEkSQjrSvAGXYILulSm0gM=; h=From:Date:Subject:To:Cc:From; b=McozBUvbP0l7qh5s6Kn4nC6vqB2W8kMjyy4KqP1x3ScwtVpkrd45Ol9VLU+DTW0ug uv4dwh3LxW9op3Tg/iHSfEv1vVCQsuWxW/N+ifCnUtdhNTD/oq/tQ6UhYok8LUhCsr EYsbgSQjwSy+FXcGZ4GYvIOlUXzJ3Xx32xUlJDbQ= Date: Mon, 27 Feb 2023 03:21:27 +0000 Subject: [PATCH] efi: make kobj_type structure constant MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20230227-kobj_type-firmware-efi-v1-1-26221abace3c@weissschuh.net> X-B4-Tracking: v=1; b=H4sIALYh/GMC/x2N2wrCQAwFf6Xk2UCN2IK/IiLZbdZG67ZkvZXSf zf0cYYznAWKmEqBU7WAyUeLjtlhv6sg9pxvgto5A9V0qIlafIzhfn3Nk2BSe37ZBCUpUorcNkc mIgaPAxfBYJxj73l+D4PLyXz6297Ol3X9A/cRkzx9AAAA To: Ard Biesheuvel Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.12.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1677468088; l=1024; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=pwAr4IcABcpaKfjReOPmkgEkSQjrSvAGXYILulSm0gM=; b=sc+FDFVb7BbroNSy7MXVjIaaqxVx1PkrgUHay3UeN0qy7Av0X5eGn7sY4IuOuLUdxM71T8aXG RBgjpFaM3pzAHJuvcPomANwuNzCfWLIWIwTVSfuhzM60XdbO5Eyxvdn X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 --- drivers/firmware/efi/esrt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/esrt.c b/drivers/firmware/efi/esrt.c index 87729c365be1..c61398634d75 100644 --- a/drivers/firmware/efi/esrt.c +++ b/drivers/firmware/efi/esrt.c @@ -156,7 +156,7 @@ static void esre_release(struct kobject *kobj) kfree(entry); } -static struct kobj_type esre1_ktype = { +static const struct kobj_type esre1_ktype = { .release = esre_release, .sysfs_ops = &esre_attr_ops, .default_groups = esre1_groups, --- base-commit: 2fcd07b7ccd5fd10b2120d298363e4e6c53ccf9c change-id: 20230227-kobj_type-firmware-efi-2fca765a222a Best regards, -- Thomas Weißschuh