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: 199623 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2302721dyd; Mon, 12 Feb 2024 00:37:35 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXCsDWRrbYkBrnZ6N29MIpOF6olxtviF7t8dNHD5eykHwUK1KIg75JhEhTR9JdYlbdwQmiffKNy0/cXyBoz8lJlUR+XYg== X-Google-Smtp-Source: AGHT+IHtZB3ljU8mT2p7ygSW4JT43f968egTHQn/EMM8SDG/XgtgG+PupApGzbLoiGAnUARKgp3f X-Received: by 2002:aa7:c246:0:b0:560:cdcb:cdf6 with SMTP id y6-20020aa7c246000000b00560cdcbcdf6mr3861984edo.38.1707727055464; Mon, 12 Feb 2024 00:37:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707727055; cv=pass; d=google.com; s=arc-20160816; b=yH72Ng3ZqJdZKtnErkThuqJ8N579zQgXvnUjl8bLG5zowgYQsZocydsX6XM4GnrY12 Y4LJ4KJ6hTvwfU/Zoj11HPlJO/qB4dmwJ28LJFh4xpeoM06UF3q8BSbM7LaWIrxDZYqD 7iGF5A1y9TqhfUowst9a05ORWFV+och64RI7/0mAdpaLyRpQE4fYt2f81Fa8DYHxPczF vb+cZa7gOvSdvOE2+tskmle6Ph2SDMUaVr5FW8Y2elbIOo2+PabSeqqfMN8aDGHhzfkc OhAFWWxZhThz7nnRl6QDGC2LWXFGaqCX2MjDjcZ+cYNH767VrP3JPQM/qSH/xMpxKRI2 MJxg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=1BNZ84Y3xDb3GMAj84ILySVuBx8QI76q/yJskyRslVo=; fh=5nrAEYGC7xS5mOboqkHUt14Y7v7xcp1FWKmjtU7Tu6g=; b=Y98s/YNijqHWKoqxXyg+6EfaNO39A8PE59+zAW4u6TZ56wbHGouNVZ+cWk8qrdImba gMMVE+OCnEb5wjGHGGm0R3xvNKRCy4ImzkCOQoJbk4fVP5hc+huDjC32aM2yIioDExe0 PyhA2tyXwb1zjN044v0Qp9Bxn+CgFQhK813CYBnG5YD+x3AAqBZLOZy1a0NAqMLtyIB5 /OXlxhGbVt8Tp33UnTvOzGXnR0Qj5hsZWZgHhdS164Y4+zjWrR5JujGBGB0tuRBGRugU FOJ0/UXLy2cZeldgpzuKG/lDzHbWi57XPiuzkBQ03YhbMRZZxZ8PD1wpvjMSXRFfZS0k +GVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Ka0K8Rd3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60850-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60850-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCXW3NTU5alDNorRqy5lL722XyZqmB1FFEzzoffWnKrGJJDv8ZeoCNvlOf8+QwGKNNf0ZI9ZxFBn03pE0WsWCPISQvkO2g== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q11-20020aa7d44b000000b0056158484c5csi2437644edr.253.2024.02.12.00.37.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 00:37:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60850-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=Ka0K8Rd3; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60850-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60850-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 522791F229C6 for ; Sun, 11 Feb 2024 15:51:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 814455C90A; Sun, 11 Feb 2024 15:51:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="Ka0K8Rd3" Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3358E5C5F3 for ; Sun, 11 Feb 2024 15:50:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707666660; cv=none; b=fU+BI65W65TwzITM/cd6VOdDk5zcPQbLaQRBdY27rwUB2ZqAgkDUMon2PGm5ucbWPDN400FN6ayTULkTzgLyw113mV322zKD6pbCULgv9vS68gN+0VlEdWBcL4n77xUb9BiESpCMz6Of1Bsrvh78uhHUmvr7ySCVDmmARFEhhHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707666660; c=relaxed/simple; bh=la73JL/A1C8uRQjAcaKo8g4M6f9oZL367qO73DSOApM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=On3okp3OmGph7G+pF2UYd/6oNptK1blGPalC8yjxt56jXbjtqW+QsaaDahrddkq6l9yAELdDIRHF3ecXK/p5zauZJ7yVgAU5gJsNfD8ISdTs+Iv7c0/mqWA9GgTqtYFfCwayNbJSeBHUjo6B9G9sOYByRDMuBGB4RjXGLOLWCJQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=Ka0K8Rd3; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1d72f71f222so19673365ad.1 for ; Sun, 11 Feb 2024 07:50:58 -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=W9f5gv+ZHECwI7Fh9ei4nx7kQSKtpE3Cuc5f5g6oxD77YxXpi72kxFNRXLFZbsskkz jZgme+bUVbPUE8fh6A5LASX1DtvedWMfj+pJ0pTj0eiAvQSXcQty/a8NlA+UQW0YhBFa /tP3QJLpwygEKnFtirMzWVi6LuNCr2TvLIPB1yW8bwrpIefn8qxkfV6PuwH1OrRYzvvX HXsdNDejrmZS4bSyfkECq7A3x+jdg0ta7aMnxKQp54FoNvJ2UOUVMlGSzgq3uj9SWm1o Lpf7nut4iZ6Rus75M8zHC8EPIDHF7vAR/ULrh4hLK0QgpTpOzzyO7jWYwSDceLyUkV7C MwJA== X-Forwarded-Encrypted: i=1; AJvYcCWWaJ9Nt65UeMB5wXyqn/AaAo/F8y7e8yQGBMzCioDi28NTSe5UTGP7rZuk7pKCkHzGG6Vs6NK2pYiqUxBC0YE8sBFeG0nYg62MHRZF X-Gm-Message-State: AOJu0Ywn8m/o0itmNbP9HUT21+wfhtp7nhtaPwqKROzmyRLNNrQfZt4G AjxH8Y7zemBfeML7E5T9Md2qL892IMheJzLrjIq7+yHW90LXlanc 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 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790681604999679285 X-GMAIL-MSGID: 1790681604999679285 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 { From patchwork Sun Feb 11 15:51:30 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: 199597 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2274358dyd; Sun, 11 Feb 2024 23:10:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV9fucpBLserhiU1xoLMgAJxLPAOluw1Km03wf3MIdRtTPPSGVxw/kAW0BvCCyUa0M4ZlKOw6NHUrCIeLPg9Yugph10rA== X-Google-Smtp-Source: AGHT+IG1ErlFrAXmUGV1jrZAls111YopWR0DY476P6KVFoFfu24ggidXZRwkxGKFZCww3gorPFJr X-Received: by 2002:a05:620a:124f:b0:785:db11:4a7e with SMTP id a15-20020a05620a124f00b00785db114a7emr433743qkl.56.1707721814353; Sun, 11 Feb 2024 23:10:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707721814; cv=pass; d=google.com; s=arc-20160816; b=QKkc9qHyM46uyHwqrzIdLmmM2g5jUeI4yU3pCxVqZJ2h7GJBgTUa2EJVUPC7uIZVTZ wmC4Mp7orgTM8BotzYoRJA7BiqKUQMlFC73673FJGzjA0Lx1Sv0DSAPwtzKWdyHn7b6X We0E9DXULk59CdVIdi+D3mMGN72DY3Y1pO3gyl/tuPuv9awPWPY7zFrJ9YytUgQkZLD/ I5tPWemZiieMu+1Y7/QvmdXK6FpGM5tWxGB6UVgAO34Ni6vdu9SKyAQTJzvuKRXWPPDB 8u4ZSsxfghuusurukYUN3s68QNzRuLL5a6087Qf08I+Z0+r2T2bXmMyV47vG7HBl8gJD bW9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:dkim-signature:from; bh=A4Gcc4Xndyg3QpASX0JMqOkflhcAzBHLuuTQVBUmj7Q=; fh=8jMW+X+5dTzwwALJWEmpZ/SFDF9cQE0835Irh6O5rQ4=; b=P4WjsbkhmAPfUKDOu7vqOfXUlWjITvT95+F3zhFtYNEzuTYGfyCLncAJ4DCvWH/mXV cQPRT7G3lkAT5kwn9lZStsDIGOF1s29DghPjpEqzdSC8F2TLM+kXOUk6Yjxnn3d6omPf dcKrt739NyJWPPv/zmAChWiVaPtUvSlWWFtqu4N8twtYpLo2OL2JNMtHd2W9HixmrNuf j3UffTlFRZfYRX3WbALGPtj7C3oNJrdFgWYMxnxblGuRG5qCvPMUpMcLjooe7kCuBC2p KxxZYTKnqLAWgFgaur6E5pRLEHWlrB7QP5mzzBJVcxK/Y4baZfdtfuN85M5MfT9pxjYv fTvw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=JwaG85w2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60851-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net X-Forwarded-Encrypted: i=2; AJvYcCWPXk3akbmxkIT3rb8PwsX50ePtg5pGDSiQCvWtTWoL2kA0Ni6Jpc8oG6lU7eVqukBR6cTf0R6KY98ne+ZgcDFudt4wZw== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h20-20020a05620a401400b007856325a291si5542988qko.714.2024.02.11.23.10.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 23:10:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marliere.net header.s=2024 header.b=JwaG85w2; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=marliere.net dmarc=pass fromdomain=marliere.net); spf=pass (google.com: domain of linux-kernel+bounces-60851-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60851-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=marliere.net Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5AEEF1C2153D for ; Sun, 11 Feb 2024 15:51:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 39E695CDD9; Sun, 11 Feb 2024 15:51:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b="JwaG85w2" Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0146E5C616 for ; Sun, 11 Feb 2024 15:51:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707666663; cv=none; b=M5mV99mhRkzACIDjkX+kTcIDacSPYCOgMA5v+cJ7m8npbLvohiEOYyNheDh/llmGhQ5RtpGcJ2GQfI2bN99TVDDdCskLQtTNkHmwFny8/7dHAkfpQLxUspDkpVa5hNxdSVjLnropRWsWM1ssiFQ045HPjygkinZw1EcnnbdQIxI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707666663; c=relaxed/simple; bh=2DXxJu+KPQUi1akz0xAbwCY6WPF6YuYAvQw6ywMU71k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KSqZPSj/E/BNcBy9DfkFj188tPuI+y6A23j/Rn5+yzayq2EFWEJHgbyru/10rBiCIVYm3yVTwaGempS+IbAp370e+AUAjRz9TYhxry80XpOIPAfIDhkimWVhebquWNYKTNR3Od2mEl0+Ku7L74XJcOhQpPjTnd9/Od51jB7tAWQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=marliere.net header.i=@marliere.net header.b=JwaG85w2; arc=none smtp.client-ip=209.85.214.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=marliere.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1d746856d85so18526915ad.0 for ; Sun, 11 Feb 2024 07:51:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707666661; x=1708271461; 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=A4Gcc4Xndyg3QpASX0JMqOkflhcAzBHLuuTQVBUmj7Q=; b=MxQ/QHKqxgqySKiO/ds8iOiChI2uaZPniMj6EN7mkVcAFHzgQ3f2FFS0021MdUrmgB TTg6n4OIyNVOOTXkB+1MNAG06mA9N0eiq0J4qyzD95qKD4eQxR4h09JXZYclmkSnxB1t 85eCMFHKYbAOI+zDD5FARy35qxpmX2c7hc8j2FG0dXl3HzB01jk3NHeAWS1dzbVFCFvE xDKm8TBOMbyZ1+2dIWEihKmi13aWt23DfwOLEC2zvDj3KxqCgevaAnEE9HeL7D2Vn9Dz 3Mh3H6PSecjMsJtgT4gNYVd4Mt0bWDA+D+ja2w/d7PPf5TTkoMXh8LOf0gAJgyZumM79 1moA== X-Forwarded-Encrypted: i=1; AJvYcCVfiXr3AFKtBSJRhJZfgcRli6RzeSt2vXDULqhUkLTF/NEq5lA17vrbV+7ZpGroO6rdZybMbw4os656B8gDsSi5+eKL8CnvzyrL8nXI X-Gm-Message-State: AOJu0Yxit+2bl+Oy/rpR25VyqMa2ErsU4LpdOvGxWrZZWVA581z6Vxmv 9x8bRN6crI9OS1I2/tiQuWa3LAhywCroEKvRz2Szq9LU72hqzI+GluPK8eHHnAmhRQ== X-Received: by 2002:a17:902:f68e:b0:1d9:859f:b505 with SMTP id l14-20020a170902f68e00b001d9859fb505mr4436425plg.21.1707666661324; Sun, 11 Feb 2024 07:51:01 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWv1bTfqA5q8d4YOoEhJXKCFE/XCtNFUDccZIs6B+JlL8NgGMXSedkp/N36JzOI/IvTi1kYy0OpSqphpHpcHdsAgoLaz2jY7NAu1Lo7A9Ysl5Dd6uPtgjOTgyi3slv81xhtb5Ug1xtnm3J4ET2UlwOqgIu72B6Cprb3kKv3IhshdQ0j Received: from mail.marliere.net ([24.199.118.162]) by smtp.gmail.com with ESMTPSA id p4-20020a170902eac400b001d9630e3396sm4457627pld.193.2024.02.11.07.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 07:51:00 -0800 (PST) From: "Ricardo B. Marliere" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marliere.net; s=2024; t=1707666659; 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=A4Gcc4Xndyg3QpASX0JMqOkflhcAzBHLuuTQVBUmj7Q=; b=JwaG85w2MwtkXsefAeGkqQVomcKeKVGed2aK+7hzc7QWU8PQtj/Pmp3V17wFLZxt8o9bZr erqils/vfcN6kbUTxjdr12CpiZHFO3HNo5Xq2mhW3tcL2wi9KeauwhPD0RKDGJQzErzboA Iq6UHEq5JrNAXaB0e4oqrsq2m5G0aH0NDQsbypzA0liTl5JMY4jXYExZMHj1kYPaDtTeO2 en9znPsj4CTOZBZW2IofsyGwyxP+H+Cf4zCGJ8VM7+W+XXd5MlxstVhxDrYPUcu3AHjUqK ieWtdrdNwbNbHou5HMQJu2vhJ1j/wDTl95z5m3Fi743Ts/pQCzTVD+SsONsL4g== Authentication-Results: ORIGINATING; auth=pass smtp.auth=ricardo@marliere.net smtp.mailfrom=ricardo@marliere.net Date: Sun, 11 Feb 2024 12:51:30 -0300 Subject: [PATCH 2/2] firmware: arm_scmi: make scmi_bus_type const Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240211-bus_cleanup-firmware2-v1-2-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=1600; i=ricardo@marliere.net; h=from:subject:message-id; bh=2DXxJu+KPQUi1akz0xAbwCY6WPF6YuYAvQw6ywMU71k=; b=owEBbQKS/ZANAwAKAckLinxjhlimAcsmYgBlyO0CNpjVnQm1f4mTaBU/yng6HbD1pirl70Kw+ 1tn3hP+mbaJAjMEAAEKAB0WIQQDCo6eQk7jwGVXh+HJC4p8Y4ZYpgUCZcjtAgAKCRDJC4p8Y4ZY ppioD/93LqVA4qwg6m2/98RBhSmHxrXXzvXmKkMdJHAOgvt1uTubajTkqHdxRXNBCwOuaSkvHNY hHsmHSAwVz0NRbUc0tabRMFntHZrd3hqD3iV6NtbivHn8NqS98Mh6FKBqSbr6XXMzU2fRu3Q1j8 P/DL9d1xN6e7ejbei+8q8NkOfOrIV2Yq+7J47IjEEUNPPs7Z766RdWH8KO0nHe8O3zY6zUKpeqM 4qGXOw71sCQX9AAixnu2MWirQSf0873ddN8Msq+o+WzecXanCwGBvvR/cFDQqxVqL87L2ndwwUk R1DtDVa6dlS6raZvquBUMt3wObX+hP+UiKLrCgIj8CxcLxCmcZ6Sd06jhfCQP21uwQhOqgL9yk4 VezjtVrSeSX3q+qHQp89Bk0lvKkjC6lkE9qVnRELEzKvkD73raS0OL4KqvklL7i7hyZOkYdzeev jAdP5h54FnRcUTnfwnBJczyzomhBI8Sb+R3xzzjnAUsN8w4p1R+k7jRDopGe+AED9VMH3YljP1V cFpARItZ8mA5Jlt8wGNjofRoSthRSCpxdpHpn50qq1Qre1FFln8xvFZ/fAHm/3mWfrk6yn+HY+S wD083Syz/MbXHKFZRyo7huiKrPaQRFvxEooWvV7PYJ2f6h5j0RheVwl5tTSREV28+ChuBEgfNiS JHijGvapEGABAHw== X-Developer-Key: i=ricardo@marliere.net; a=openpgp; fpr=030A8E9E424EE3C0655787E1C90B8A7C638658A6 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790676109218656698 X-GMAIL-MSGID: 1790676109218656698 Now that the driver core can properly handle constant struct bus_type, move the scmi_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_scmi/bus.c | 2 +- drivers/firmware/arm_scmi/common.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/arm_scmi/bus.c b/drivers/firmware/arm_scmi/bus.c index c15928b8c5cc..609a6496c1d4 100644 --- a/drivers/firmware/arm_scmi/bus.c +++ b/drivers/firmware/arm_scmi/bus.c @@ -263,7 +263,7 @@ static void scmi_dev_remove(struct device *dev) scmi_drv->remove(scmi_dev); } -struct bus_type scmi_bus_type = { +const struct bus_type scmi_bus_type = { .name = "scmi_protocol", .match = scmi_dev_match, .probe = scmi_dev_probe, diff --git a/drivers/firmware/arm_scmi/common.h b/drivers/firmware/arm_scmi/common.h index 00b165d1f502..6affbfdd1dec 100644 --- a/drivers/firmware/arm_scmi/common.h +++ b/drivers/firmware/arm_scmi/common.h @@ -141,7 +141,7 @@ scmi_revision_area_get(const struct scmi_protocol_handle *ph); void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph, u8 *prot_imp); -extern struct bus_type scmi_bus_type; +extern const struct bus_type scmi_bus_type; #define SCMI_BUS_NOTIFY_DEVICE_REQUEST 0 #define SCMI_BUS_NOTIFY_DEVICE_UNREQUEST 1