Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp369533lqb; Fri, 24 May 2024 00:13:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWcVXksWDBxx00AcDnRw0x8/YKQGl85INncWPb2qcQsi5xa97X1MKzwdtcSZXsAmPkQGWmnr2qZma799uqD49x4DK/EjmNSHd/Qj3Sppg== X-Google-Smtp-Source: AGHT+IGDXFlnhqBSd5V5cXYA/goCVkHnT28p2lXdm33UUkw16Y7/uIYWnWbz70v7QHXu4tCqJTPf X-Received: by 2002:a05:6214:29cf:b0:6a9:fdfb:9877 with SMTP id 6a1803df08f44-6ab8f53aa6cmr79577416d6.12.1716534822500; Fri, 24 May 2024 00:13:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716534822; cv=pass; d=google.com; s=arc-20160816; b=fDcu1iJu855efNTFu6GAHgWiaS2DBmwG3MTCwumFbXEiTWh8yoYkCOprOx1tMJMPrc F//MpOSFTazStfxiJxpdzRdb2T9aJmmXloCss8WnJis0N91hiG8QUD68aLWWqflAk+f6 ZcfaZ4oG3jdxYfgwqLlRNrxMA2bxsh33aL7zx7FMGCSUrlPfmWcjHQb3x4tiHh1twkBN xB8YaBYbh46eLyvA6ANzN5Rxneplsf0jvws2qn3tVPfb1EL0iAguHzvEKYS/QInSYj/6 X6Y6JWi6abQXProtsSl6IEGb15DR87y16cNRBIS+eb91LfpEfpelfdaSew9Ewa/kAz1U 8gSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:message-id:content-transfer-encoding:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:subject:date :from:dkim-signature; bh=ToijQzMYDaq75RfQAX+0+bpsXPI3uX0/kEegyo9vYrc=; fh=+ld1hJN+ptVM38xLPn5PkAKrLXwU1GXGG2GPw/g1xHM=; b=UHIKC7q93ia5HUdQSBGXaoYdlq+qHUm4WgCfWorRA1vRU/NWfg+M9JlBcpQhq9GTEu Dyn2U/gcgWZvZ4Gy+6V1BaaSsRTju/tpt9XQriAw2JBMkNr4ThXLKtlE1AeShpVcHdDx 50yrh12AmGlwVMhJnkPtwrshbBSV4sWKt5MbCIoWQiybiZmjrvfuXg6/ZCezCtl695/2 IzypjwxB3F7c6OpUpNoKLoYMhxuYDpmtgQAuH4nsSI28J62+12NvFXwtuMu3/QpjV7zk +tnPWrVAVtlykPem7+yeuyz6059mH9FWNuBP9U1NKotch39I1ztWxFcqwtz6A3KOKeYo YbiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=Bld0O95j; arc=pass (i=1 spf=pass spfdomain=marcan.st dkim=pass dkdomain=marcan.st dmarc=pass fromdomain=marcan.st); spf=pass (google.com: domain of linux-kernel+bounces-188386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac1616adecsi10567566d6.401.2024.05.24.00.13.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 00:13:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-188386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@marcan.st header.s=default header.b=Bld0O95j; arc=pass (i=1 spf=pass spfdomain=marcan.st dkim=pass dkdomain=marcan.st dmarc=pass fromdomain=marcan.st); spf=pass (google.com: domain of linux-kernel+bounces-188386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-188386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3F4E91C2102D for ; Fri, 24 May 2024 07:13:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 64F97128828; Fri, 24 May 2024 07:13:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=marcan.st header.i=@marcan.st header.b="Bld0O95j" Received: from mail.marcansoft.com (marcansoft.com [212.63.210.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B5C708F5A; Fri, 24 May 2024 07:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.63.210.85 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716534812; cv=none; b=XMj3iDrsgnpeHNaZhkuKhvJJQR/ZZgk9l5d9VZcIWxXGa8DV5PFiTQd837y9ZNdMMoAtLt/hSQ5VdepuMwgTW9TSnCF2s9vgJR4+E6mm6K1tMuoexvGJbvnERwSTVs0tOPztdjtUI+9+6Sk/p0ECVaHmF2/dSPhzKc5IZZ4tw+E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716534812; c=relaxed/simple; bh=qSjCs6Ul6ojhpPYSK0ZQVIJa3AR8PdI5qM0Fn+3yBdU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=VlCg+D22/pvB510b0um0iizybXV6itcNo3xRPaxrs/QlLhlFuryKPsDrYWGVTOJDFMdMMGKCX7GEY58ONSC6t0YOUj/boTFMTiSlbSHeHwJh+GBl1AQ2lip/1yZOb7J8y0C6tgBVLF0MobfzjBDR6u6APP6rVolLjLqR2030R+k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=marcan.st; spf=pass smtp.mailfrom=marcan.st; dkim=pass (2048-bit key) header.d=marcan.st header.i=@marcan.st header.b=Bld0O95j; arc=none smtp.client-ip=212.63.210.85 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=marcan.st Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=marcan.st Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sendonly@marcansoft.com) by mail.marcansoft.com (Postfix) with ESMTPSA id 7BE133FA37; Fri, 24 May 2024 07:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=marcan.st; s=default; t=1716534472; bh=qSjCs6Ul6ojhpPYSK0ZQVIJa3AR8PdI5qM0Fn+3yBdU=; h=From:Date:Subject:To:Cc; b=Bld0O95jSq1Wc3K3MI5TbwrffzqDn4V+xD9E2GiHUPJE6lrFoElBw1qcIGPR7csxN Lt/BtFCfPlCkEC99p5O4OnRNUXu8/c3s+NQBAlOdlYSssSp3Dd/qGi+8RrWfMfEksq iQBtFjUYxORbu1MvGr3hqJPz6YtZ+pAipWcGizSgCYGUZNZ2afEmFgHI6GquO9eacy EqryhqHvwKYHvbUWJiQyhFCIeQib6G8xxhYU4Nr/NaJY9qVxpWRjI0FrxUQQMsquDZ k1KJfYE8ZwiQG25vPjMelz88bsGPD3qDUU3+D/8WetfKCei07CWYYYflX8I2QWO8JQ eF4dBuFEw/EyA== From: Hector Martin Date: Fri, 24 May 2024 16:07:41 +0900 Subject: [PATCH] xhci: Remove dead code in xhci_move_dequeue_past_td() Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240524-xhci-deadcode-v1-1-a4453a756e0f@marcan.st> X-B4-Tracking: v=1; b=H4sIALw8UGYC/x3MSwqAIBRG4a3IHSeY2HMr0aC8f3UnGQohRHtPG n6Dcx5KiIJEo3oo4pYk4SyoK0X+WM4dWriYrLHONNbpfHjRjIV9YOh+3SxWdK0ZmEpzRWyS/98 0v+8HZXcjt18AAAA= To: Mathias Nyman , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Hector Martin X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1605; i=marcan@marcan.st; h=from:subject:message-id; bh=qSjCs6Ul6ojhpPYSK0ZQVIJa3AR8PdI5qM0Fn+3yBdU=; b=owGbwMvMwCUm+yP4NEe/cRLjabUkhrQAm6PiYb88WX9VGif+VN/wLtr6ybOMaW4+n8+nrVsmv nD2q7m9HaUsDGJcDLJiiiyNJ3pPdXtOP6eumjIdZg4rE8gQBi5OAZhI91VGhiu2Knc3+J97d8n+ u9utJhGtqQnF/WePJO6qmlx1VrSnSILhD+/VtEMXAhylhdReH7SzuPJ3uX3owkXF/3PqFTRXffy 1lQEA X-Developer-Key: i=marcan@marcan.st; a=openpgp; fpr=FC18F00317968B7BE86201CBE22A629A4C515DD5 This codepath is trivially dead, since the function is never called with a non-NULL td (the only callsite is immediately preceded by a NULL guard). Signed-off-by: Hector Martin --- drivers/usb/host/xhci-ring.c | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 575f0fd9c9f1..f1ed728d9f8c 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -656,25 +656,6 @@ static int xhci_move_dequeue_past_td(struct xhci_hcd *xhci, stream_id); return -ENODEV; } - /* - * A cancelled TD can complete with a stall if HW cached the trb. - * In this case driver can't find td, but if the ring is empty we - * can move the dequeue pointer to the current enqueue position. - * We shouldn't hit this anymore as cached cancelled TRBs are given back - * after clearing the cache, but be on the safe side and keep it anyway - */ - if (!td) { - if (list_empty(&ep_ring->td_list)) { - new_seg = ep_ring->enq_seg; - new_deq = ep_ring->enqueue; - new_cycle = ep_ring->cycle_state; - xhci_dbg(xhci, "ep ring empty, Set new dequeue = enqueue"); - goto deq_found; - } else { - xhci_warn(xhci, "Can't find new dequeue state, missing td\n"); - return -EINVAL; - } - } hw_dequeue = xhci_get_hw_deq(xhci, dev, ep_index, stream_id); new_seg = ep_ring->deq_seg; --- base-commit: a38297e3fb012ddfa7ce0321a7e5a8daeb1872b6 change-id: 20240524-xhci-deadcode-8bf2ebe7609d Best regards, -- Hector Martin