Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp2453043rdb; Mon, 20 Nov 2023 11:08:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IGwNNvc5KvD0upe5X+g03kZqEwo2GnMA6GoptQR2LbkDuHk5PiIA5aP87urnsjBJFdC6/MW X-Received: by 2002:a17:902:d2cd:b0:1cf:6675:b313 with SMTP id n13-20020a170902d2cd00b001cf6675b313mr603210plc.22.1700507289556; Mon, 20 Nov 2023 11:08:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700507289; cv=none; d=google.com; s=arc-20160816; b=gce9ET3pxPvW8LatA/O/GbFJmi3VDKhaU5+YtQLZtT/rg2jENQhCDFpza8IREPwnsd FJVXNX4NdqWfAySD5W+20g6eUa276mLbQKLYCfnkjEb5PA4+qLE1nFQqrSFFk1LyGMKp 1xm3qDA0UenBC0eU36qjjyU/59nuLAhQo4zIy9HgKIoOLBdHAN7l+VvrHxhIWlM/TEV6 9KKBlcMiOaUQ5Vm9J/qpfmYVxR3yXH6vMPFU0eTsFqibvhHgY3FphZkUfoe8/bw1023Z wbi89YDLfjqYEjJagYyI5Lyn9Kpm+p9Pc7lKkmD4J4xy4/goxNNrC4wlbQEYdqRE6MEC Ydyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=FTpXl/MjWFr4GOxbA7yucE3ugQ9dkFJq52yIdGzpXCM=; fh=6pu/Hu042HChh718+qWoPctCY+1u//Tk2FTXnA+DAJU=; b=gULMbx1kq+TS8WCmY5Erxo4/2fcOX3WR2bQPjSJZ5L9Ptjt0stuu4zv4bedcpzd9yX PuspTz+MbRMZHik9VHUEVkQjBEBF3lARloS9z4VlX7dq8wfr/imFcyhuddtCgKVq0RUr i3cRO/DRruwKffYS8n6szU7vhMC+AY52xA90CF6/caWdWaGVTc0KVl2irUTMODWs4Fo6 UoViDSDyakz1412WKMYlDcbVqVjD9ttKZHnn3xWXeUb8pntkNu01AL3NlK6AM9AcF+C/ ignf0GFU/jjjWes30AKqURF4ucDQJ3zt4FwX6nwFZ0UPce3lsGAslpVv1/nv2DYySbT2 065A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itYyRfKl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id q4-20020a17090311c400b001c753d6b95fsi9005611plh.315.2023.11.20.11.08.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 11:08:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=itYyRfKl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 2485E803EC95; Mon, 20 Nov 2023 11:08:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232045AbjKTTHw (ORCPT + 99 others); Mon, 20 Nov 2023 14:07:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbjKTTHv (ORCPT ); Mon, 20 Nov 2023 14:07:51 -0500 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E62110F for ; Mon, 20 Nov 2023 11:07:45 -0800 (PST) Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-991c786369cso655295666b.1 for ; Mon, 20 Nov 2023 11:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700507263; x=1701112063; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FTpXl/MjWFr4GOxbA7yucE3ugQ9dkFJq52yIdGzpXCM=; b=itYyRfKlJ0k+Z5DM/8/r+qJotBFH0gQ4rizZjMjKZ04IyE5HryhW9ctYufd9bNwR3/ QoxuuPxSsfEpHY1O2Yr+4VA9+HiVNKVVGZU+U3jqtCnF2U75+w2bQjZm9+M9tz+xEh1G rwd2to9rK00jQyKGR/vNxEEf/WLu4ZIh3C0TSUBgETriwa9zIXTb46Aa2qGXmTq4jaQ4 fu6bzoOkEjb2UFLRBz/yZKiGQxORgG8JLBIiVURE1b9IVo30gS9wgaZ00sp+wUYb4ZZt Q2UmcP9rONk/T0mh8KDlR2DQCpenddeXS3Kb0nyOtXeBM7X3ZOuQbUuvXVC3kRKRWGRe BI+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700507263; x=1701112063; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FTpXl/MjWFr4GOxbA7yucE3ugQ9dkFJq52yIdGzpXCM=; b=uEITbcRhymA+TauYmot1go4+3zlicNpOkbd/t0mzt+nL2w8omrqKPPEMv5IQ9T3h51 IKoIR8ZZz5g2/JZoO/fw4xR7RQVkxRaJmRLuiBlDOJvhT29YUvRiZoeOBK28jTyv0qUU khPaVPhsVG6wiYDs3GNl78TNnSSm76eSsMEscmCLImhgiC5eGgrOBcXShn5Imskl/g6h XXpBiqFzKBJYaFwiZWqa2SrvaXgbOp+Yd0c9IpSCxYLmH0ZAT0yYENbzeHbbEx7Xf0Lf ajkYelHVl4NePoSqo+29kqSQdV4ypJ7Df7W0b3l/SWR+MFpyk+5ds3bbHBo0832xOs6F Kx9g== X-Gm-Message-State: AOJu0YyWsPp8jkeozM3w1SDeCgbw40cRQOOaaS/bi25b8nmoKxNf/XdL EeGzh8BBsIRDaRMimBCjakU6xw== X-Received: by 2002:a17:906:c244:b0:9db:e46c:569 with SMTP id bl4-20020a170906c24400b009dbe46c0569mr6001995ejb.45.1700507263410; Mon, 20 Nov 2023 11:07:43 -0800 (PST) Received: from krzk-bin.. ([178.197.222.11]) by smtp.gmail.com with ESMTPSA id a18-20020a1709066d5200b00977cad140a8sm4177521ejt.218.2023.11.20.11.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 11:07:43 -0800 (PST) From: Krzysztof Kozlowski To: Andy Gross , Bjorn Andersson , Konrad Dybcio , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale , linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/2] soundwire: qcom: drop unneeded qcom_swrm_stream_alloc_ports() cleanup Date: Mon, 20 Nov 2023 20:07:39 +0100 Message-Id: <20231120190740.339350-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 20 Nov 2023 11:08:07 -0800 (PST) The cleanup in "err" goto label clears bits from pconfig array which is a local variable. This does not have any effect outside of this function, so drop this useless code. Signed-off-by: Krzysztof Kozlowski --- drivers/soundwire/qcom.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index a1e2d6c98186..754870a4a047 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -1157,7 +1157,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, struct sdw_port_runtime *p_rt; struct sdw_slave *slave; unsigned long *port_mask; - int i, maxport, pn, nports = 0, ret = 0; + int maxport, pn, nports = 0, ret = 0; unsigned int m_port; mutex_lock(&ctrl->port_lock); @@ -1183,7 +1183,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, if (pn > maxport) { dev_err(ctrl->dev, "All ports busy\n"); ret = -EBUSY; - goto err; + goto out; } set_bit(pn, port_mask); pconfig[nports].num = pn; @@ -1205,12 +1205,7 @@ static int qcom_swrm_stream_alloc_ports(struct qcom_swrm_ctrl *ctrl, sconfig.bps = 1; sdw_stream_add_master(&ctrl->bus, &sconfig, pconfig, nports, stream); -err: - if (ret) { - for (i = 0; i < nports; i++) - clear_bit(pconfig[i].num, port_mask); - } - +out: mutex_unlock(&ctrl->port_lock); return ret; -- 2.34.1