From mboxrd@z Thu Jan 1 00:00:00 1970 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 55017CAC5B5 for ; Thu, 25 Sep 2025 20:36:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=BQFj3Uo8ilD9DkV7i7N/0dnNEvz96lNNazFJoCH0aTI=; b=Z+EwODWsQRDlT8UgQkV+bgKFJy n92MyxrCROw6yJfh+Zsug0EFYoN0FWkQOeBtUVPINjjPXMj+uMpr6AuzzntNu7N59SwqHFbd6glIn 21WxLe3qKMCisurC/BXkVqMEbsdw0wMsnlwWXvEmKmas1d4s30L9LCqZTgf+qjUPgm6dRyXhHDHV5 IHBIG27FyNRyjlXEGl20tl3NjfLfbO9xR3aPyHXDyG/wV++V3m+iFe8qspfAwF7uB13OIQt7mdAMc pJc+gYPjsjiveYU8T9zjt8I54LI7iAXLqRkogwxGG6trMXHpQM2twBCLnJpHorVmdilAfrtUtq+IB bx052zGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v1shW-0000000CmpF-1pEm; Thu, 25 Sep 2025 20:36:26 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v1shU-0000000Cmo5-1QdX for linux-arm-kernel@lists.infradead.org; Thu, 25 Sep 2025 20:36:25 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9464E1C2B; Thu, 25 Sep 2025 13:36:15 -0700 (PDT) Received: from pluto.fritz.box (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 042AA3F694; Thu, 25 Sep 2025 13:36:20 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org Cc: sudeep.holla@arm.com, james.quinlan@broadcom.com, f.fainelli@gmail.com, vincent.guittot@linaro.org, etienne.carriere@st.com, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, dan.carpenter@linaro.org, d-gole@ti.com, souvik.chakravarty@arm.com, Cristian Marussi Subject: [PATCH 01/10] firmware: arm_scmi: Define a common SCMI_MAX_PROTOCOLS value Date: Thu, 25 Sep 2025 21:35:45 +0100 Message-ID: <20250925203554.482371-2-cristian.marussi@arm.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20250925203554.482371-1-cristian.marussi@arm.com> References: <20250925203554.482371-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250925_133624_413820_B6AF859D X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. 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 Add a common definition of SCMI_MAX_PROTOCOLS and use it all over the SCMI stack. Signed-off-by: Cristian Marussi --- drivers/firmware/arm_scmi/notify.c | 4 +--- include/linux/scmi_protocol.h | 3 +++ 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/arm_scmi/notify.c b/drivers/firmware/arm_scmi/notify.c index dee9f238f6fd..78e9e27dc9ec 100644 --- a/drivers/firmware/arm_scmi/notify.c +++ b/drivers/firmware/arm_scmi/notify.c @@ -94,8 +94,6 @@ #include "common.h" #include "notify.h" -#define SCMI_MAX_PROTO 256 - #define PROTO_ID_MASK GENMASK(31, 24) #define EVT_ID_MASK GENMASK(23, 16) #define SRC_ID_MASK GENMASK(15, 0) @@ -1673,7 +1671,7 @@ int scmi_notification_init(struct scmi_handle *handle) ni->gid = gid; ni->handle = handle; - ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTO, + ni->registered_protocols = devm_kcalloc(handle->dev, SCMI_MAX_PROTOCOLS, sizeof(char *), GFP_KERNEL); if (!ni->registered_protocols) goto err; diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h index 688466a0e816..59527193d6dd 100644 --- a/include/linux/scmi_protocol.h +++ b/include/linux/scmi_protocol.h @@ -926,8 +926,11 @@ enum scmi_std_protocol { SCMI_PROTOCOL_VOLTAGE = 0x17, SCMI_PROTOCOL_POWERCAP = 0x18, SCMI_PROTOCOL_PINCTRL = 0x19, + SCMI_PROTOCOL_LAST = 0x7f, }; +#define SCMI_MAX_PROTOCOLS 256 + enum scmi_system_events { SCMI_SYSTEM_SHUTDOWN, SCMI_SYSTEM_COLDRESET, -- 2.51.0