From patchwork Sun Oct 11 20:50:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 11831283 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D8CFC697 for ; Sun, 11 Oct 2020 20:52:45 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B3B120678 for ; Sun, 11 Oct 2020 20:52:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=lists.elisa.tech header.i=@lists.elisa.tech header.b="GlRcvA1U" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1B3B120678 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+72012+76+4688437+8417402@lists.elisa.tech X-Received: by 127.0.0.2 with SMTP id WtyUYY4689772xYkEFP4AnKj; Sun, 11 Oct 2020 13:52:44 -0700 X-Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web11.26151.1602449563823751497 for ; Sun, 11 Oct 2020 13:52:44 -0700 X-Received: by mail-wr1-f65.google.com with SMTP id y12so11410545wrp.6 for ; Sun, 11 Oct 2020 13:52:43 -0700 (PDT) X-Gm-Message-State: bd4u8cn0NzDNmF2vYiKr2zS5x4688437AA= X-Google-Smtp-Source: ABdhPJykx39k7lJpZgr3XUsTS9T3knOzW1oWqFZE6F2SU3I+AdRkgJbZGCoEbfMtNLTjpzWHHhv0NQ== X-Received: by 2002:a5d:6a51:: with SMTP id t17mr9957357wrw.80.1602449562207; Sun, 11 Oct 2020 13:52:42 -0700 (PDT) X-Received: from localhost.localdomain (host-92-5-241-147.as43234.net. [92.5.241.147]) by smtp.gmail.com with ESMTPSA id y66sm4070595wmd.14.2020.10.11.13.52.41 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Oct 2020 13:52:41 -0700 (PDT) From: "Sudip Mukherjee" To: Alan Stern , Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, linux-usb@vger.kernel.org, Sudip Mukherjee Subject: [linux-safety] [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error Date: Sun, 11 Oct 2020 21:50:08 +0100 Message-Id: <20201011205008.24369-1-sudipm.mukherjee@gmail.com> Precedence: Bulk List-Unsubscribe: Sender: linux-safety@lists.elisa.tech List-Id: Mailing-List: list linux-safety@lists.elisa.tech; contact linux-safety+owner@lists.elisa.tech Delivered-To: mailing list linux-safety@lists.elisa.tech List-Post: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lists.elisa.tech; q=dns/txt; s=20140610; t=1602449564; bh=qrE1s6kHD8M0nIxTGcA44bm3vRJj0ImWaxnHK/KcMOQ=; h=Cc:Date:From:Subject:To; b=GlRcvA1U+GVztndZIGwY0aGVxXuHUoYKsBZG912XV0eN2aOdHP62vCd3cxB6l33gTUp lYmSyVNn1yjTFnQzAC2YJzyvRaccNV2IbA9ezrkESPNepVoOGfUp5inFMiRUJ/EByM0na LExymikJXwH4dd8Aob97IKOmNWeYu3PJb14= Add a comment explaining why find_tt() will not return error even though find_tt() is checking for NULL and other errors. Signed-off-by: Sudip Mukherjee Acked-by: Alan Stern --- drivers/usb/host/ehci-sched.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 6dfb242f9a4b..0f85aa9b2fb1 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -244,6 +244,12 @@ static void reserve_release_intr_bandwidth(struct ehci_hcd *ehci, /* FS/LS bus bandwidth */ if (tt_usecs) { + /* + * find_tt() will not return any error here as we have + * already called find_tt() before calling this function + * and checked for any error return. The previous call + * would have created the data structure. + */ tt = find_tt(qh->ps.udev); if (sign > 0) list_add_tail(&qh->ps.ps_list, &tt->ps_list); @@ -1337,6 +1343,12 @@ static void reserve_release_iso_bandwidth(struct ehci_hcd *ehci, } } + /* + * find_tt() will not return any error here as we have + * already called find_tt() before calling this function + * and checked for any error return. The previous call + * would have created the data structure. + */ tt = find_tt(stream->ps.udev); if (sign > 0) list_add_tail(&stream->ps.ps_list, &tt->ps_list);