From patchwork Sat Sep 17 15:48:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 607175 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 8156EECAAA1 for ; Sat, 17 Sep 2022 15:49:37 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AB74015C2; Sat, 17 Sep 2022 17:48:44 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AB74015C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663429774; bh=KJ2d1h/ScbAm9LkjGUq+lGDs8/mqJolHtgttuMLeHvs=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=LrV3AwdokaDlyU4ZkYHGAK6lusvbbPTrplR3Sq79cXR2tUww4fNlOF3jvbynUTZJ/ 9PVbW0C/u8ECEU/N05oSJ3aBMbXtwGjnCv9Tlzqpe2V7ycCKonA4JWjXTm7IMPWen/ tdK7x+rvvF7wyX3vQfQljVAMWwV7G8K3oc1L1KGs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 46A46F80134; Sat, 17 Sep 2022 17:48:44 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9977EF80423; Sat, 17 Sep 2022 17:48:42 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 198D4F800E5 for ; Sat, 17 Sep 2022 17:48:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 198D4F800E5 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="hPLlzzQH" Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28HEvR6I010074; Sat, 17 Sep 2022 10:48:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=TB36sGrqFlva4VA79Qj0rQIM5Mb0u8akbGYI3B1YqH8=; b=hPLlzzQHefNSLHKm2ObwbkV3lI1s+UMuR2lji3azldHAqo6iAaFnJGkf5yp1zxK1XQEH wPXLyHCZuKghJPRLfUTzZDXrvoJ0ggsfuk9PPXolGinQTcdc0r6OLjVkEnDbI2h3un6I 70LaIEGC9NfilsOPV1l7AQuCw3Dc+XTAyG6OZ/e/Tx5A7/pjBAjlU7u3cF7Sc0OD7bzL xC4Ai91Pcf2GZ2c9TaK2d6/95NbEZyorRs5tsYeWP8YZ4BTKO+hvHaAjDFJwrO3wRhFM 31BFPIz6K8LJXK0un8Jno+oDortDnpGIDnd+BwTv+Wxsmuq0Mu+Fec3cK8CxBB4ADxgk qQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3jnanmgavj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 17 Sep 2022 10:48:33 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.12; Sat, 17 Sep 2022 10:48:31 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.12 via Frontend Transport; Sat, 17 Sep 2022 10:48:31 -0500 Received: from debianA11184.ad.cirrus.com (unknown [198.61.65.112]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id EDBB2468; Sat, 17 Sep 2022 15:48:24 +0000 (UTC) From: Richard Fitzgerald To: , , , Subject: [PATCH 1/2] soundwire: cadence: Fix error check in cdns_xfer_msg() Date: Sat, 17 Sep 2022 16:48:21 +0100 Message-ID: <20220917154822.690472-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-GUID: eUpNl5-D3xga4PDjQSa0UWmMPdyK_GEb X-Proofpoint-ORIG-GUID: eUpNl5-D3xga4PDjQSa0UWmMPdyK_GEb X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Richard Fitzgerald , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" _cdns_xfer_msg() returns an sdw_command_response value, not a negative error code. Signed-off-by: Richard Fitzgerald Reviewed-by: Pierre-Louis Bossart --- drivers/soundwire/cadence_master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index ca241bbeadd9..3543a923ee6b 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -708,7 +708,7 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) for (i = 0; i < msg->len / CDNS_MCP_CMD_LEN; i++) { ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN, CDNS_MCP_CMD_LEN, false); - if (ret < 0) + if (ret != SDW_CMD_OK) goto exit; } From patchwork Sat Sep 17 15:48:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 606992 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 DD59BECAAA1 for ; Sat, 17 Sep 2022 15:50:04 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A66CD1662; Sat, 17 Sep 2022 17:49:12 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A66CD1662 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663429802; bh=A9WniNPPq3o5d3/WIUkoNLpzB40HLRBwwfvQ8Dl4zbI=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=igxmIw4n6AiWugZ0FLUZxgb/xExoD+swf63mwYczdVONBDb0i4OK2Kzg4sZ7wgZg3 ZHHf4r40PO7I/g6E/IJIgvcZMlMdTShGMYg1iALZAOaOpcP5uZKRCxnwW6LLMR8WNM Rc/evHTHKjmem6lADxzMGKihEieYTFNyFtZTwEjI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8AB3EF80537; Sat, 17 Sep 2022 17:48:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 348F9F80249; Sat, 17 Sep 2022 17:48:47 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 EB0B0F80249 for ; Sat, 17 Sep 2022 17:48:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EB0B0F80249 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=cirrus.com header.i=@cirrus.com header.b="bZ6olJVg" Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28HFmbdC028028; Sat, 17 Sep 2022 10:48:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=PODMain02222019; bh=vJHaMLJvcCzzgtqNWiXZsB/9X6s3SfKiDcoQeDm4FFM=; b=bZ6olJVgI8XqZpFG5M1+zLqLGu31bSekptfqhHSvQGQumrFPJm7BLHXXA9rjjuGUg06V OnWi8XYDSncvf8QKEmJAb2KyJypcNJm1zM2HtU6bUCycXBe/nNjtTO7Rv3LKkYKLRxmf N3f2tu9qYhlBY5A8XD0fEjR0yuYDkh8btY/W3jl3Qfjt/2c1rvjzCbw/vWraEmdUBJVT hfSG5N6kE2ylGK7PDHIYt8T7303ZAI0N+eV+PzmSg8y7FVqdplkz5x8grWBU14KMhhuV ccwlBbXoZvSqKUUQPRL+pnCCYSm3D0+UqVjRaimJX0Eb0YliuI6UOncEETU+4dKm/Wu1 Tg== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3jnbn08bd4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 17 Sep 2022 10:48:37 -0500 Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.12; Sat, 17 Sep 2022 10:48:35 -0500 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.12 via Frontend Transport; Sat, 17 Sep 2022 10:48:35 -0500 Received: from debianA11184.ad.cirrus.com (unknown [198.61.65.112]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 411482BA; Sat, 17 Sep 2022 15:48:35 +0000 (UTC) From: Richard Fitzgerald To: , , , Subject: [PATCH 2/2] soundwire: cadence: Simplify error paths in cdns_xfer_msg() Date: Sat, 17 Sep 2022 16:48:22 +0100 Message-ID: <20220917154822.690472-2-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220917154822.690472-1-rf@opensource.cirrus.com> References: <20220917154822.690472-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: VTRd6noz-XehbOX2jNDJSU56AgkzW945 X-Proofpoint-ORIG-GUID: VTRd6noz-XehbOX2jNDJSU56AgkzW945 X-Proofpoint-Spam-Reason: safe Cc: patches@opensource.cirrus.com, alsa-devel@alsa-project.org, Richard Fitzgerald , linux-kernel@vger.kernel.org X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There's no need to goto an exit label to return from cdns_xfer_msg(). It doesn't do any cleanup, only a return statement. Replace the gotos with returns. Signed-off-by: Richard Fitzgerald --- drivers/soundwire/cadence_master.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c index 3543a923ee6b..30b8c628fdbd 100644 --- a/drivers/soundwire/cadence_master.c +++ b/drivers/soundwire/cadence_master.c @@ -709,17 +709,14 @@ cdns_xfer_msg(struct sdw_bus *bus, struct sdw_msg *msg) ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN, CDNS_MCP_CMD_LEN, false); if (ret != SDW_CMD_OK) - goto exit; + return ret; } if (!(msg->len % CDNS_MCP_CMD_LEN)) - goto exit; + return SDW_CMD_OK; - ret = _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN, - msg->len % CDNS_MCP_CMD_LEN, false); - -exit: - return ret; + return _cdns_xfer_msg(cdns, msg, cmd, i * CDNS_MCP_CMD_LEN, + msg->len % CDNS_MCP_CMD_LEN, false); } EXPORT_SYMBOL(cdns_xfer_msg);