From patchwork Fri Feb 23 14:18:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael J. Ruhl" X-Patchwork-Id: 13569142 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 A6607C5478C for ; Fri, 23 Feb 2024 14:19:35 +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:MIME-Version:Message-ID:Date:Subject:Cc :To: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=5k95svmTEyMDXWVx/QgvomhdCsHznUmhF25avQm2J6M=; b=usg44VYPEUh24R 3HfrCvBgiYez4Cput13kZqaOGRFISAPMoww80vdxPt4ADbq+fhzi5S9hS3H1Ah118LDDU1KOWStJR enML9BsxpTTzH9iVlf05OW82lJaS/Dd/lO3pr5xBJCN9LmOzG4zZI0pWYPg2pDC5qtCdvnYdh3QdH 5j8hD4VkfVzG6r7W9vXCzxgoeoM2SYKIDG5y5kisGPx4bN2BRMJZKufJgA2EsyrzeqnyyqHGw0+zI LjCHtW44hJ5dIQVgW4+3or8EZ5KhLEYdqZh/Y+o1QHZguMA4j26jSD2JDCY/N6qv9cUz0qLfmq8Jl AUNSkeG/wONqE6V5Oheg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdWOU-00000009jRH-3znE; Fri, 23 Feb 2024 14:19:18 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rdWOS-00000009jQc-2NXn for linux-arm-kernel@lists.infradead.org; Fri, 23 Feb 2024 14:19:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1708697957; x=1740233957; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=tYze8IrJ1yAvzoappL3XtvPJ27bpcIPpI0JnZ5rnTDI=; b=Zm3L6uuFqtkDirqMgdIfCdtXX4g7HKzy49Zb+rMtqAw56U1ZQ0C1tr0W LIKKlzIDrob9WxTNUzzbQQ/M9f7RsaD7l7eZyAcMjBiXzIqyfodOYjh3A KNC920+9xSveVty3FqAijsIe5/r7mRJadZeEcwuIyKDbw53hCjHpIMiMB ylWKGfmHiMJ5br2hyjnl4/c+TMNuZBFhBOxP9Yp24WeZ7YviDQZUiJPZN S8LmQUlDuF5pAqO0YMDp7vr2tqoIV27janJrFzQJvwVDBJLsZxKkYiY7G qXI3E+d9dg8Ofl5GDjWz8MrzYUIDsZZjc6c8hvoACUGt6AabYzHufbEvq w==; X-IronPort-AV: E=McAfee;i="6600,9927,10992"; a="20451887" X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="20451887" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 06:19:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,180,1705392000"; d="scan'208";a="6291708" Received: from awvttdev-05.aw.intel.com ([10.228.212.156]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Feb 2024 06:19:11 -0800 From: "Michael J. Ruhl" To: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andriy.shevchenko@linux.intel.com Cc: "Michael J. Ruhl" Subject: [PATCH] clkdev: Update clkdev id usage to allow for longer names Date: Fri, 23 Feb 2024 09:18:14 -0500 Message-ID: <20240223141857.3794855-1-michael.j.ruhl@intel.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240223_061916_672126_C71AB2C6 X-CRM114-Status: GOOD ( 10.72 ) 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 clkdev ID information is limited to arrays of 20 and 16 bytes (MAX_DEV_ID/MAX_CON_ID). It is possible that the IDs could be longer that. If so, the lookup will fail because the "real ID" will not match the copied value. Increase the size of the IDs to allow for longer names. Signed-off-by: Michael J. Ruhl --- drivers/clk/clkdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clkdev.c b/drivers/clk/clkdev.c index ee37d0be6877..38549db691f4 100644 --- a/drivers/clk/clkdev.c +++ b/drivers/clk/clkdev.c @@ -144,8 +144,8 @@ void clkdev_add_table(struct clk_lookup *cl, size_t num) mutex_unlock(&clocks_mutex); } -#define MAX_DEV_ID 20 -#define MAX_CON_ID 16 +#define MAX_DEV_ID 32 +#define MAX_CON_ID 32 struct clk_lookup_alloc { struct clk_lookup cl;