Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3664992pxu; Sun, 11 Oct 2020 19:23:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwub80wW22K5+NGC1yHessswBtaMAxgxy/GVBVLICkTGuyhVV56RYaSOBJbv1OTnuBtoDha X-Received: by 2002:a50:88e5:: with SMTP id d92mr5501435edd.145.1602469430638; Sun, 11 Oct 2020 19:23:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602469430; cv=none; d=google.com; s=arc-20160816; b=faEjr/vjwSz6wDH3mikpjgssjinBQ8YPx+mizNZbQ2MRHO9eIxdIkliNA59xcaPcfK 2BBkaRGUaFI8JHU4y4dp79dtYbakzc8vFD631dl0vOn6old1U4wUB0ZHwGrUCxWoUZJd hZe+x/8H/vPV085WhTRNCi4AhFw6Q4ql3i+Es9svyKWMeLqHCaqUSVEGJZ9yVRIl2VA6 jT48IhfB1mxCWXoosKyyHVR6K1yC2vVuAbZuqBUwqtLzT5QnsACJ1biSQnnMxJAwomUM SLgTNaAkiTGGy0CxYygTD1eLNKs4MkLgYUl/4/yblwsU4dXntHMGnsMxKMsqy5MgqHRX dz8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=UliFJt+hhrYjiKtNa5XkgmjjqGT+UbztNQtPrx7sBQk=; b=siCHColNO+l6lmjebimal4Sn1pvpIFugrdBOmQNLPGgHBe2mPo6JVa4bbDMIksH9Lk MnFr36GssrXlAyYFMUotZD3Sxt2e/MEjO9aDYemzCRPQhVel2FnjEJxVAs13hTZVjfVB Uak3vD43uL63IQIR7jphn1Pjq2rIn988CUvzAGKe7pvrA6vAnKoSkUCqHjZ8wtC87BEI mmqe/u0Pg7hEJAp8MKP5uMwbnFHAK2rBdPai8WtevCGMqyY5319u7cv0ZVeif3vXmqw1 ggy/xcM396Duy4X0Yc6cnZwxc5Ewa3xXYeUN3Dcf32xyKRflVVFG+mJdqErjVBk1gpkJ i+8w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r25si14344606edc.210.2020.10.11.19.23.28; Sun, 11 Oct 2020 19:23:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726802AbgJLA1M (ORCPT + 99 others); Sun, 11 Oct 2020 20:27:12 -0400 Received: from netrider.rowland.org ([192.131.102.5]:40681 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726735AbgJLA1L (ORCPT ); Sun, 11 Oct 2020 20:27:11 -0400 Received: (qmail 615163 invoked by uid 1000); 11 Oct 2020 20:27:09 -0400 Date: Sun, 11 Oct 2020 20:27:09 -0400 From: Alan Stern To: Sudip Mukherjee Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-safety@lists.elisa.tech, linux-usb@vger.kernel.org Subject: Re: [PATCH] usb: host: ehci-sched: add comment about find_tt() not returning error Message-ID: <20201012002709.GA614913@rowland.harvard.edu> References: <20201011205008.24369-1-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201011205008.24369-1-sudipm.mukherjee@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 11, 2020 at 09:50:08PM +0100, Sudip Mukherjee wrote: > 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 > --- > 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); Acked-by: Alan Stern