From nobody Fri Apr 3 06:26:52 2026 Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23B672BDC0B for ; Wed, 25 Feb 2026 06:52:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772002340; cv=none; b=NrPQao7TjVQqDg//xDWjHfycPGn5643+oNK0X9jsWQ6zVUfTUJLm5AH1tZVJVy70T4zEWBB+kl5DDAiQkjs7WoKHu94O5HMuiYX2BhCmULofu42Mtj9bKK78HTkL/b37W6LFszHx1co6nfdaElFz4HIC3J9u6T4jVBLs3v43azY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772002340; c=relaxed/simple; bh=wWlnhUKYqV8Wx/7Onzg/8pKZVFcNwdYvLbRKD8COaVc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GpvfhLJPc4gxSrJrhGoNA5uaJoHxTcSq73oha7HNOcmCYgpFEE8dN3eNamUd5Bz8DhnlyWIhZkc7P9Ar2iYgVTu8o8789Cmp7ANTbzsVLrPpPLkXVRLH1Ej8LIEnhtDOHl3/R6jbISofoJ862Wt6NT26G5G0wKUM8IlTRuPhGTk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VBzfC6y1; arc=none smtp.client-ip=209.85.215.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VBzfC6y1" Received: by mail-pg1-f195.google.com with SMTP id 41be03b00d2f7-c6e23cb81f4so2393109a12.2 for ; Tue, 24 Feb 2026 22:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772002338; x=1772607138; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pDedFaVY+KaOvNB2BxP1xWzhD01NDhi5iX3Ein+K0U8=; b=VBzfC6y1tatOMh7V65zNo4ttdmTWe25uBOx9JVQvyY3rWhLbYqjTa7ocg3QFnp2U4P gL8NBL67BJuKRU3GnKtMRLHGBAh9hv0dynzCMdSp4/SA0Xvd09GRq7dXjCJsebe/CfYq BLGRoIyF4s4Pf459H6joid/9zAPGmfeHCGA+Xma3E09K/J0+LyIW14jCza7njj+QtuNN SFfWdMGV3MKzm74oxb4/LgyYO3EzZt9HuFKqpsLeca772omb8xpu53+vQUDaoBWDfMCP 9KS3iqbg5ZUw8GpvAxgNQlCkZQs7BTPo6elOaPv2X9t66KkXC3o8gxTaDEK0UG9iD1NS G8lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772002338; x=1772607138; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pDedFaVY+KaOvNB2BxP1xWzhD01NDhi5iX3Ein+K0U8=; b=dt4nqozHQnBgOs+pMc3QmFlQsdTQv+mEUa5Y7KjujmVQKiG7KR08mDcqMpmKVfnQvD 57wEnRWNzqQhvL2EgP2M92TnjX2raCXN4wnQSLA8w+QQ62hLv5TPddZVVJcPxalbA0eg qvnnlW2YY1Fm/BrrW7yJaKnwVrYUkA0oWgiZkB/ltx32oMoz6dJHH5+mHUnZAggzAmhk 7tPtLziiHo0YaqRNvcv7L+KDsO2vmwTwhBs5I74l8xAkUqKq268M1aDc2kbTkjlhdCk3 IPyCgCDtnJLOaL/8DIbue7sLAt4eu0zvFihRpk1sGZDlMgrIsePzuK8WiFDgu8KDlwOF 4YUQ== X-Forwarded-Encrypted: i=1; AJvYcCWIieGiN397lIPH0y/FrLIKe7v+drLIlfjN3KHfPOCoiYN3/TIMjY4lVdu6BWFt1CdHgnZ0opJwE00YMsI=@vger.kernel.org X-Gm-Message-State: AOJu0YwjHfvSYfY32A+GTqe5LLvKuTzF+1429p4f5ySMmVT4GJNUzsni tBEEsUBZ5VcZ1ZHe9V1AvWY4SyTWxNtFphfBXd+BexwCjUiAnhJEmSChyFp00gTZQ0U= X-Gm-Gg: ATEYQzw/jWjdBoWott+rQil1ff8VMOvajJP7NrjV4gzVGxjvtNgkj0hYLxPlrcGiq8a WlgjEwGUO++hLNhqJ8FZHAfGD8gE5IbgYplbIbYR34RB6eTYQWqrY8tFOoDDEvwd0YTSaDF66k2 3VMu9u7PDfQZdlDxRvtJg44zlAGtI051Wc3nbzKOjsdpnUtEDrGmTXeY6H/jwfOM8KRfAbez45I mxJTjtCHmzEE7soSirw8V3itDRFHrT1g9K/HEDOuqfRmrOx7+Ghtw3oWczH50yNUF7qx+6roMPa 65OaC29tI09vUviBX5Tkr+aSyXevJJtcctz8E4pXpz6Te0lvdOcwdXYpA6SZZmjkoacyERafH8m /ROLaEGrXEGCj6LfjgAABF+tHRmtetaLBlLU7SARwdoA7aVRKlHsXmNQzd1QuP8M3sT+azpuO9X SJdcNUQLchSaFMBYNDqHfYp01dFuzB8OHzJTqWunTisKjB8MNP33KePgRw9X5JkviNFphxpQOqz B2HsqQ= X-Received: by 2002:a05:6a21:b8f:b0:393:c607:9d3c with SMTP id adf61e73a8af0-39545f79318mr12151549637.47.1772002338417; Tue, 24 Feb 2026 22:52:18 -0800 (PST) Received: from zeeshan-Standard-PC-Q35-ICH9-2009.. ([110.93.227.54]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3591349c87bsm434207a91.2.2026.02.24.22.52.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Feb 2026 22:52:17 -0800 (PST) From: Zeeshan Ahmad To: Thinh Nguyen , Greg Kroah-Hartman Cc: Dan Carpenter , linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Zeeshan Ahmad Subject: [PATCH v3] usb: dwc3: qcom: simplify error check in dwc3_qcom_find_num_ports() Date: Wed, 25 Feb 2026 11:51:57 +0500 Message-ID: <20260225065157.8952-1-zeeshanahmad022019@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260225064245.8833-1-zeeshanahmad022019@gmail.com> References: <20260225064245.8833-1-zeeshanahmad022019@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The platform_get_irq_byname_optional() function returns a non-zero IRQ number on success and a negative error code on failure. It never returns zero. The current implementation in the modern dwc3-qcom driver checks for a return value less than or equal to zero. Since zero is not a valid return value, simplify the check to only look for negative error codes. This aligns the logic with the standard return contract of the platform IRQ APIs. Signed-off-by: Zeeshan Ahmad Acked-by: Thinh Nguyen --- v3: - Fix missing version changelog in the v2 submission. v2: - Targeted the modern dwc3-qcom.c driver instead of the legacy one=20 as suggested by Thinh Nguyen. - Audited the modern driver to confirm the same redundant error=20 check exists there. - Updated the commit message to specifically mention the modern=20 dwc3-qcom driver. drivers/usb/dwc3/dwc3-qcom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 9ac75547820d..f43f73ac36ff 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -526,14 +526,14 @@ static int dwc3_qcom_find_num_ports(struct platform_d= evice *pdev) int irq; =20 irq =3D platform_get_irq_byname_optional(pdev, "dp_hs_phy_1"); - if (irq <=3D 0) + if (irq < 0) return 1; =20 for (port_num =3D 2; port_num <=3D DWC3_QCOM_MAX_PORTS; port_num++) { sprintf(irq_name, "dp_hs_phy_%d", port_num); =20 irq =3D platform_get_irq_byname_optional(pdev, irq_name); - if (irq <=3D 0) + if (irq < 0) return port_num - 1; } =20 --=20 2.43.0