From patchwork Mon Feb 19 12:03:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Ricardo B. Marliere" X-Patchwork-Id: 13562583 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EE7AEC48BF8 for ; Mon, 19 Feb 2024 12:02:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Message-Id:MIME-Version:Subject: Date:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=4maUxifMAE9wURQIuCbM2PlYxO9bWWSjOYzY7bWaoy4=; b=e+BSlMkfsERo3s WQBPpjREXaHVDyg6Hz6JmNuetloSv++r/Z3GJFoF8htZLO69x8iuDpjr0dG52z/OccER0yVAl6N8e fp+c10xAEpx5M8/9OfFKpWpBGy40REnyBpbi3/QUI1PK/6xT+mxwVMk7AYveD4KQhLBBL1fDZriSl Njq4MMcWj0090K3NE8tYmT1aGVF2DTfgPC1HuWCNV5trIUpvwn64eyRpnukK6qS8e1pqbubL4c9Xo ARydJa09ydLxdiKIqoyVoFv8Xr1BH6XvdpfFUMFGBYTfS7hHtOjM0KVE6gfCsYWi5ir4Zy/JW6ZV3 wspV4egzXvINDVcRMV2w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rc2M0-0000000AKrs-0QnO; Mon, 19 Feb 2024 12:02:36 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rc2Lx-0000000AKr0-1FpV for linux-arm-kernel@lists.infradead.org; Mon, 19 Feb 2024 12:02:34 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-5ce942efda5so2395065a12.2 for ; Mon, 19 Feb 2024 04:02:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708344152; x=1708948952; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:dkim-signature:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=H2hACCCQq6ctsb61YdZfXiP9Cf/ZpEuBHB2ZECqqD5A=; b=qPVTl1pXNxFSlb+YP/IJO2LqDaHd0/suFkLTFMP60zvK34ixdKirOqY9QZaK5MR/qp mrGOHWUjqvoBz3yAVcKEIyVqs7SpCe5wyWEIhY75ZAqgALjcqJmcqW+B+Ybx97w6lAKb SmGCdxW6CQKxIsGvKrGxOmXxYuArivwi5Gq58HBxoKdXUeyUt3nw2zxMhx5YhkQWLunV 1pVuuz3LrlChMi64TiE5cFHUVVbZaskpMK1ZIchdJG/MvQ/U7kxijAtIYisyrREUkiPi QKMLPn5woSb9KWkcR8r57u2gW2lQutNfx2IBjWmXACe0Iublu2jGMDfF08mQyyVzK/uS K7NA== X-Forwarded-Encrypted: i=1; AJvYcCWFSmvBa0OERFErjySsfMDJ1Xr5H+6sq+c4OnpfRNlrHgR0WUn40HYbwW67VylVjH+s5kcM2A5tE6PAj2hCTBW6xAf5IHWpAkc6tXux5hGaYhUuqrI= X-Gm-Message-State: AOJu0YzXvw4/Qp6XU092F6Wr6vCqSKU+iyH3tYK4VgrBtoP0FrtGza1U UFqTybEJwe3Rm29VMSjmgSulcbPnHNLDIJx23n7lsDmq/es8dUWu X-Google-Smtp-Source: AGHT+IEO+YceAxGq2zoMcU6dSkph8vmrCIO81MsGwhvnHlOxsV6tVSs3Bi29WEspnQG7z4rGjj8g5g== X-Received: by 2002:a17:90a:d243:b0:299:9ba4:abe6 with SMTP id o3-20020a17090ad24300b002999ba4abe6mr1749666pjw.46.1708344150939; Mon, 19 Feb 2024 04:02:30 -0800 (PST) Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id gw3-20020a17090b0a4300b0029718f72ad3sm5126787pjb.44.2024.02.19.04.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 04:02:30 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1708344149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H2hACCCQq6ctsb61YdZfXiP9Cf/ZpEuBHB2ZECqqD5A=; b=GLA3jWiPfbc35JQVF/PpwYZwxKUTNUioga/Ok1SoTYCgQTMIjQGElW2L2aK2wXrjQ1vXnE +rCYxAJaXrqtRLmLTM7DqEIqTmrTN+Ety2TkswvsF8iqVw0vF/kUpSO+rHVXa8hvrrP8fH g9KXDgectJMv8K7GmQZ9o31BzcYiaaQOP/EDwyVAYQRJo+bngUEQTxPmF7A2pVUcHVc2q0 9YB7e/4VyDMvbnLZWmHWQtbP4/f2LufRVpOyyeUDD++NLKsvJ/iMnIgsrvY+vZJKmkEjWU pKakv9y0qJWVgumDUucFWnZsMJmYFnun4cOo9sAt0LD6C7r6tI9DZQOC3gLILQ== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Mon, 19 Feb 2024 09:03:11 -0300 Subject: [PATCH next] bus: fsl-mc: constify the struct device_type usage MIME-Version: 1.0 Message-Id: <20240219-device_cleanup-fsl-mc-v1-1-d206b8b90f2b@marliere.net> X-B4-Tracking: v=1; b=H4sIAH5D02UC/x2M7QpAMBRAX0X3t1sz5ONVJM12xy1GG1Ly7pafp 845DwTyTAHa5AFPFwfeXIQsTUDPyk2EbCKDFLIQMmvQREnToBdS7tzRhgVXjaM0ta1UmYvaQGx 3T5bv/9uBo/uA/n0/rKXtfm0AAAA= To: Stuart Yoder , Laurentiu Tudor , Li Yang Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=6005; i=ricardo@marliere.net; h=from:subject:message-id; bh=V4QRYQ76YEpXXNMyK5V0fnE0QpgAewPnLJMPRZ8+iSU=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBl00OC7UwZ8Nbbx/scP4H7DsOPAQv3LfbSIDf7w Pd5guhK1ZOJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZdNDggAKCRDJC4p8Y4ZY piGBD/0bu6xlhMehhehiv7GOBEfHsJlzUi2KMB8YcoxxTzu5gAxpsmRGTP+o5QPMkq4thc+fp+W va20fT14amRdGHGlgOHY/PbRwA86NbKik7Jnw+uuSwhONhu1Ws1c4HuYJhZG2WPcYrRZOPxEzFg tSu84QZEGMYqoKHPKZ4criSJXv0PqdRqhnJY/ogPbudPJd5ctRFQ17Y2Q6QoR/S/InoXVajONRy ICxqEbeWKlw7ikvQVIBuoCvC+5x9yWB3MkwbfG/KwCyLgPNyPB/bID8qw8avDrIR6O+JdYCuhzy a4YTpf2/UYIgM+s+3SXZE8JWoscZVB2OV0/4YrdHga8/nzW8OPVdBeFDeyOGZADigEjWo+11cMm tf0AgyJlzCXdTAjKOQ0vqzJiUMOizGok7hK6/krmlLyGiYgnDQKQTmTNG9xf0xf6seVe0mnVMnw u1sL6Iukrfek7rNZ7jHLfg+09qd59fTU5X4JZEOlLWweCZSiS7PlmiIdV2S45lNEGL4C/6O3sNm TXGCDlf1NrxfAT+L+mf+c87pl5Hny3fzmrcy9H1FxZzs37TlQhYsHsnfNOKzepW5BZ7dRNoCa9m +R1QjJPzW+wKNgvVZBtBAdGaSC+VMXCCSZisoeyiZhBwXeA64gJ4kMb8hfNqmGGtqLRQb80OI/h 1dl9deN300fRuyQ== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240219_040233_378622_881FA68D X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Since commit aed65af1cc2f ("drivers: make device_type const"), the driver core can properly handle constant struct device_type. Move all the device_type variables used in the bus to be constant structures as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere --- drivers/bus/fsl-mc/fsl-mc-bus.c | 32 ++++++++++++++++---------------- include/linux/fsl/mc.h | 30 +++++++++++++++--------------- 2 files changed, 31 insertions(+), 31 deletions(-) --- base-commit: b401b621758e46812da61fa58a67c3fd8d91de0d change-id: 20240219-device_cleanup-fsl-mc-b2d8f7a5308d Best regards, diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c index 78b96cd63de9..f75ca3f0d75a 100644 --- a/drivers/bus/fsl-mc/fsl-mc-bus.c +++ b/drivers/bus/fsl-mc/fsl-mc-bus.c @@ -320,82 +320,82 @@ struct bus_type fsl_mc_bus_type = { }; EXPORT_SYMBOL_GPL(fsl_mc_bus_type); -struct device_type fsl_mc_bus_dprc_type = { +const struct device_type fsl_mc_bus_dprc_type = { .name = "fsl_mc_bus_dprc" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dprc_type); -struct device_type fsl_mc_bus_dpni_type = { +const struct device_type fsl_mc_bus_dpni_type = { .name = "fsl_mc_bus_dpni" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpni_type); -struct device_type fsl_mc_bus_dpio_type = { +const struct device_type fsl_mc_bus_dpio_type = { .name = "fsl_mc_bus_dpio" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpio_type); -struct device_type fsl_mc_bus_dpsw_type = { +const struct device_type fsl_mc_bus_dpsw_type = { .name = "fsl_mc_bus_dpsw" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpsw_type); -struct device_type fsl_mc_bus_dpbp_type = { +const struct device_type fsl_mc_bus_dpbp_type = { .name = "fsl_mc_bus_dpbp" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpbp_type); -struct device_type fsl_mc_bus_dpcon_type = { +const struct device_type fsl_mc_bus_dpcon_type = { .name = "fsl_mc_bus_dpcon" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpcon_type); -struct device_type fsl_mc_bus_dpmcp_type = { +const struct device_type fsl_mc_bus_dpmcp_type = { .name = "fsl_mc_bus_dpmcp" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpmcp_type); -struct device_type fsl_mc_bus_dpmac_type = { +const struct device_type fsl_mc_bus_dpmac_type = { .name = "fsl_mc_bus_dpmac" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpmac_type); -struct device_type fsl_mc_bus_dprtc_type = { +const struct device_type fsl_mc_bus_dprtc_type = { .name = "fsl_mc_bus_dprtc" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dprtc_type); -struct device_type fsl_mc_bus_dpseci_type = { +const struct device_type fsl_mc_bus_dpseci_type = { .name = "fsl_mc_bus_dpseci" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpseci_type); -struct device_type fsl_mc_bus_dpdmux_type = { +const struct device_type fsl_mc_bus_dpdmux_type = { .name = "fsl_mc_bus_dpdmux" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdmux_type); -struct device_type fsl_mc_bus_dpdcei_type = { +const struct device_type fsl_mc_bus_dpdcei_type = { .name = "fsl_mc_bus_dpdcei" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdcei_type); -struct device_type fsl_mc_bus_dpaiop_type = { +const struct device_type fsl_mc_bus_dpaiop_type = { .name = "fsl_mc_bus_dpaiop" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpaiop_type); -struct device_type fsl_mc_bus_dpci_type = { +const struct device_type fsl_mc_bus_dpci_type = { .name = "fsl_mc_bus_dpci" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpci_type); -struct device_type fsl_mc_bus_dpdmai_type = { +const struct device_type fsl_mc_bus_dpdmai_type = { .name = "fsl_mc_bus_dpdmai" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdmai_type); -struct device_type fsl_mc_bus_dpdbg_type = { +const struct device_type fsl_mc_bus_dpdbg_type = { .name = "fsl_mc_bus_dpdbg" }; EXPORT_SYMBOL_GPL(fsl_mc_bus_dpdbg_type); diff --git a/include/linux/fsl/mc.h b/include/linux/fsl/mc.h index a1b3de87a3d1..4b9311f122e0 100644 --- a/include/linux/fsl/mc.h +++ b/include/linux/fsl/mc.h @@ -438,21 +438,21 @@ struct fsl_mc_device *fsl_mc_get_endpoint(struct fsl_mc_device *mc_dev, extern struct bus_type fsl_mc_bus_type; -extern struct device_type fsl_mc_bus_dprc_type; -extern struct device_type fsl_mc_bus_dpni_type; -extern struct device_type fsl_mc_bus_dpio_type; -extern struct device_type fsl_mc_bus_dpsw_type; -extern struct device_type fsl_mc_bus_dpbp_type; -extern struct device_type fsl_mc_bus_dpcon_type; -extern struct device_type fsl_mc_bus_dpmcp_type; -extern struct device_type fsl_mc_bus_dpmac_type; -extern struct device_type fsl_mc_bus_dprtc_type; -extern struct device_type fsl_mc_bus_dpseci_type; -extern struct device_type fsl_mc_bus_dpdmux_type; -extern struct device_type fsl_mc_bus_dpdcei_type; -extern struct device_type fsl_mc_bus_dpaiop_type; -extern struct device_type fsl_mc_bus_dpci_type; -extern struct device_type fsl_mc_bus_dpdmai_type; +extern const struct device_type fsl_mc_bus_dprc_type; +extern const struct device_type fsl_mc_bus_dpni_type; +extern const struct device_type fsl_mc_bus_dpio_type; +extern const struct device_type fsl_mc_bus_dpsw_type; +extern const struct device_type fsl_mc_bus_dpbp_type; +extern const struct device_type fsl_mc_bus_dpcon_type; +extern const struct device_type fsl_mc_bus_dpmcp_type; +extern const struct device_type fsl_mc_bus_dpmac_type; +extern const struct device_type fsl_mc_bus_dprtc_type; +extern const struct device_type fsl_mc_bus_dpseci_type; +extern const struct device_type fsl_mc_bus_dpdmux_type; +extern const struct device_type fsl_mc_bus_dpdcei_type; +extern const struct device_type fsl_mc_bus_dpaiop_type; +extern const struct device_type fsl_mc_bus_dpci_type; +extern const struct device_type fsl_mc_bus_dpdmai_type; static inline bool is_fsl_mc_bus_dprc(const struct fsl_mc_device *mc_dev) {