From patchwork Sun Feb 11 15:51:29 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: 13552511 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 C0015C4829B for ; Sun, 11 Feb 2024 15:51:11 +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:In-Reply-To:References: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: List-Owner; bh=dgT3pDTvizDN2uRreTb/lqrlmHvPJKK32++wZCROlJw=; b=OWbrJaVFMLuwXk hnFag/IqXU2zy8Vohs92eAbJoNSwxIaMstbhdSMjXRwX87WyAD+AhIzG8QWCP4Ea8CQAkrZzwvOFV Nu/fVlBzvoBO11fuZyZSHwB/EYFCqfwnfnwyIjNZ1CwvKIpmPWJOUNkx2nKmFC1s17xxkRVnzcybF uqGFuBOzx7ta2wKAwkcwkCEnYbqYVJWgnNbdiDxnkLmwSfRSw/yH5f0Q+D2tI+vD4NNaodFMAsmvo z5q1z9tX9e7vAfElw39rlCZrIyeY3FmMpNap8BV9lF8yL8yJ9CY74abA4mVPnHms+vxeDHbJyX5QW 2m2ogg1jquHZEikLjEqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZC6g-00000002xSm-3Sjx; Sun, 11 Feb 2024 15:51:02 +0000 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rZC6d-00000002xRv-2b21 for linux-arm-kernel@lists.infradead.org; Sun, 11 Feb 2024 15:51:01 +0000 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1d7232dcb3eso18768705ad.2 for ; Sun, 11 Feb 2024 07:50:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707666658; x=1708271458; h=cc:to:in-reply-to:references: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=1BNZ84Y3xDb3GMAj84ILySVuBx8QI76q/yJskyRslVo=; b=VU6i8yaSqe7IFUC4x2SNYuLRyPSfMdMbEN+wWjpJrxQwmmxHuNS5GC6nMWVXjHbuEH ramGF5gjc9Vh+KoiYzjAW733EOjZtApP+4C4UDgIj9NEUrIQv7c2FTQTZFzEBABRv7zL tki+E97/5mcFbVVN5ySE5jB3iZ8FoHWiEFCK0mvqA/0EwCAa5ZJyeIzXoSnoSxbXhfGe rMGP7t7+GruZaizs3jQd8W9eK7M1aYOhWNOtiJ//lPb2XlEpPRi8xOHb2z0VBl2HslEe 6BXfAiIuaBYn32mYklRlGZXPsXX5WuyWskFds7gUI74D00BiQXZKVIneTiLXtwDwVazO cB0Q== X-Gm-Message-State: AOJu0Yz4E9euNxahtyyCkzs2HANWlLRwdjr+yRc10E5g/kBa+SYPAt+X 5Wr5Dwmuh68B8vJ+ph9ANUd7m5uA5AkNcXhPk274a6dNmvmheKZ+GTZ9D8ZpyPNGcg== X-Google-Smtp-Source: AGHT+IHaj72MhLMXtnawIPoVxCOid24C0jX6e7gkX/cJBBCJhpTz6Wv6DoXLH3vtQ//rRTWankiyhw== X-Received: by 2002:a17:902:7488:b0:1d7:133e:5c09 with SMTP id h8-20020a170902748800b001d7133e5c09mr4640406pll.22.1707666658086; Sun, 11 Feb 2024 07:50:58 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCW0lmC8VOnsyE6ooalTe+rlhWXzTpJzmMMMaA/Q5rTdlFModaLNpA+dEyHtBUvf36SZUkQ3SHxR80msaxMq1k/ifZey4BjHJUE6et19FuS/+/TZzZn0xiatRtK2HWYD958UuBas0csfF32d0n9+6r0vbVHdIA9ui6Da7eMKMAk9k874 Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id g14-20020a1709029f8e00b001d995305c8bsm4412107plq.290.2024.02.11.07.50.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:50:57 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707666656; 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: in-reply-to:in-reply-to:references:references; bh=1BNZ84Y3xDb3GMAj84ILySVuBx8QI76q/yJskyRslVo=; b=Ka0K8Rd3HPVRfMeOpn11LRm959IdRpJ5RjJ/NYx58Lx6wpHYS4LHLprOjJOO6o1D6/oMC7 ecNazYLQtxSNRVDv20b4TZKNpsUGkuQ5KTK6kBSoXqbPwyzectNU2EQkJqmkQ62DlIpTW1 8FciazaNJYpUydMi55iEPu3PrIiB11LWIYUIAqAbRoaOMl/E+PfSuzZn2xdP8PUlF3qoew 63APsQ6T1b8H6LLR4o/fYtXIs+JuTRbNt/u+hZD0/SwFtD3FyvdPMaX/251kBYuFPvcrth tXHgWV2Hy0jQeROrXRY0GVAfIuRDvbEXIxUQikEGmWLv6m0OfoeBSirhrR5eqQ== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 11 Feb 2024 12:51:29 -0300 Subject: [PATCH 1/2] firmware: arm_ffa: Make ffa_bus_type const MIME-Version: 1.0 Message-Id: <20240211-bus_cleanup-firmware2-v1-1-1851c92c7be7@marliere.net> References: <20240211-bus_cleanup-firmware2-v1-0-1851c92c7be7@marliere.net> In-Reply-To: <20240211-bus_cleanup-firmware2-v1-0-1851c92c7be7@marliere.net> To: Sudeep Holla , Cristian Marussi Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman , "Ricardo B. Marliere" X-Developer-Signature: v=1; a=openpgp-sha256; l=1543; i=ricardo@marliere.net; h=from:subject:message-id; bh=la73JL/A1C8uRQjAcaKo8g4M6f9oZL367qO73DSOApM=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlyO0BEZtdBTMzyUB0v3ir9NUAdEUSjuOXoVPKw Ajio99rre+JAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcjtAQAKCRDJC4p8Y4ZY ptIXD/4mUxMskUGE+nNrEYzifLiSK8nfea/azJ7pr+wb2q+TIesolp2EP82z5CrE9B07oRGnjuv v2xvpgeBq392vt4eOGv6m4IyvojFNzjEkLsCxi+N3lvPZkC7B6U8fue5++loD/xl6AxW5BP6z8e W+RUQLeXmUYDGX2Qx5IHTiekL8pgoqMC8HDx9Vla2I05Xe1f4Mn80ZuXW4sIrS/deiQCN5NmsIj prJlAcW+kFSg3FE7QdOVOTQ4mi5TAdT722ZLpz1mbhn1d4+FHMIfvED83r0xnhhCJ9Q+k9Eh8TV oYJMLGBx7eowa4xe8Tl/O/yHeVK5q5xaVaPBvAtSDETNcrLVG0eyAyCDnAEaIPG/RYUK4W2Ldcg aHNaZKTQ7XuMGKAEHtGD2BHy/ZjxXqCA2CDgfHJxLqrVCDDw/cMKfoJcPP55cVu2dlsajFVPSR8 aSeni8lrClSxvvMQKjS1cjkZvhhb8D+w2z26/FT1lkc/2fZlSoLJVob/BvF3CDN7ORsRbsVjRfj m5C5Moi97E/uMChpkPWU4iv/IJx2iijTXfIwFU41EtMDD0GnwOrEbKLA06m5m5ve0PsOLmwjZmF Nbv54lSBXVfAeoTjYN8Ju8Sbk5qDSnKa/lQ8WUFCfx9CwoLxa57lsE+212Vy/w0o0lO7OUY+ltA 4385uq7vzYplz4w== 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-20240211_075059_705519_E0FAEF55 X-CRM114-Status: GOOD ( 13.14 ) 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 Now that the driver core can properly handle constant struct bus_type, move the ffa_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime. Cc: Greg Kroah-Hartman Suggested-by: Greg Kroah-Hartman Signed-off-by: Ricardo B. Marliere Reviewed-by: Cristian Marussi --- drivers/firmware/arm_ffa/bus.c | 2 +- include/linux/arm_ffa.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_ffa/bus.c b/drivers/firmware/arm_ffa/bus.c index 1c7940ba5539..2f557e90f2eb 100644 --- a/drivers/firmware/arm_ffa/bus.c +++ b/drivers/firmware/arm_ffa/bus.c @@ -105,7 +105,7 @@ static struct attribute *ffa_device_attributes_attrs[] = { }; ATTRIBUTE_GROUPS(ffa_device_attributes); -struct bus_type ffa_bus_type = { +const struct bus_type ffa_bus_type = { .name = "arm_ffa", .match = ffa_device_match, .probe = ffa_device_probe, diff --git a/include/linux/arm_ffa.h b/include/linux/arm_ffa.h index 3d0fde57ba90..c906f666ff5d 100644 --- a/include/linux/arm_ffa.h +++ b/include/linux/arm_ffa.h @@ -209,7 +209,7 @@ bool ffa_device_is_valid(struct ffa_device *ffa_dev) { return false; } #define module_ffa_driver(__ffa_driver) \ module_driver(__ffa_driver, ffa_register, ffa_unregister) -extern struct bus_type ffa_bus_type; +extern const struct bus_type ffa_bus_type; /* FFA transport related */ struct ffa_partition_info {