From patchwork Fri Dec 16 11:53:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 634973 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 6575DC4167B for ; Fri, 16 Dec 2022 11:54:46 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 604AC16F6; Fri, 16 Dec 2022 12:53:54 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 604AC16F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1671191684; bh=jfIMJ6TmP1cWJ87QRad98d693nmAOv5PARrxjq9F8lE=; h=From:To:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:Cc:From; b=WrbFFzkRwoMLmlAtjAqFDNx7nGFpPxMXRRsaDmLLv8+IqM1B69z/AVDAbuSBW8YAm gQUwIMMKZwKW5ViQuAJ7/5VQReklLRsJx2n45eS49JOSsz12/8l96fyaYNT+y3OD8V 2pmYCZ3C/F6zVqRfKqzFSnaD1z+/c8aHChn7KWJw= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 06894F804E0; Fri, 16 Dec 2022 12:53:54 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C7056F804E2; Fri, 16 Dec 2022 12:53:51 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8EF46F804CB for ; Fri, 16 Dec 2022 12:53:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8EF46F804CB Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=HoHAA9CQ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671191630; x=1702727630; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jfIMJ6TmP1cWJ87QRad98d693nmAOv5PARrxjq9F8lE=; b=HoHAA9CQli3YBtlzotUYOK0JBQCys+pp7OIJdRrep+P7Qh89db8ZQUAo 87msDc36v8PE68uev1sG8wUNv3pheXzfYHYpS45H/I/bnePAj2M4bKjTk 3Gw1DBL3hkqfNWf5UdrzYVcPyBV31b2Q/jRYZbzd/VC8mlbrKygr8MmZj EvzcamvD6wEmTK2LQtrRj0P8O6SuCd/seUFlVj1Vi7JFKT3SZQum82pLK 9hGza/2gDtg3T0z4e85BSfRTvxyA8G5WLOvIfOXuuIP7CzcXcxNySXlhb eoI4WL0L6+Q4CpmVLDz2mR2yT2SW+W90CuliaklO4U9D9uWb6UEuV+qNK A==; X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="405209220" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="405209220" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 03:53:47 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10562"; a="680474569" X-IronPort-AV: E=Sophos;i="5.96,249,1665471600"; d="scan'208";a="680474569" Received: from emnevill-mobl.ger.corp.intel.com (HELO pujfalus-desk.ger.corp.intel.com) ([10.252.6.47]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Dec 2022 03:53:44 -0800 From: Peter Ujfalusi To: lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH] ASoC: SOF: IPC3 topology: Print the conflicting bytes sizes Date: Fri, 16 Dec 2022 13:53:50 +0200 Message-Id: <20221216115350.28260-1-peter.ujfalusi@linux.intel.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, kai.vehmanen@linux.intel.com, seppo.ingalsuo@linux.intel.com, pierre-louis.bossart@linux.intel.com, ranjani.sridharan@linux.intel.com, daniel.baluta@nxp.com Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" From: Seppo Ingalsuo The error "Conflict in bytes vs. priv size." is too brief. With the printed sizes it's a lot easier to find the size issue in for binary control if such happens. Signed-off-by: Seppo Ingalsuo Reviewed-by: Daniel Baluta Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Signed-off-by: Peter Ujfalusi --- sound/soc/sof/ipc3-topology.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/ipc3-topology.c b/sound/soc/sof/ipc3-topology.c index b94cc40485ed..989395999d6e 100644 --- a/sound/soc/sof/ipc3-topology.c +++ b/sound/soc/sof/ipc3-topology.c @@ -1651,6 +1651,7 @@ static int sof_ipc3_route_setup(struct snd_sof_dev *sdev, struct snd_sof_route * static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_control *scontrol) { struct sof_ipc_ctrl_data *cdata; + size_t priv_size_check; int ret; if (scontrol->max_size < (sizeof(*cdata) + sizeof(struct sof_abi_hdr))) { @@ -1694,8 +1695,10 @@ static int sof_ipc3_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_ goto err; } - if (cdata->data->size + sizeof(struct sof_abi_hdr) != scontrol->priv_size) { - dev_err(sdev->dev, "Conflict in bytes vs. priv size.\n"); + priv_size_check = cdata->data->size + sizeof(struct sof_abi_hdr); + if (priv_size_check != scontrol->priv_size) { + dev_err(sdev->dev, "Conflict in bytes (%zu) vs. priv size (%zu).\n", + priv_size_check, scontrol->priv_size); ret = -EINVAL; goto err; }