Message ID | 20231016130934.1158504-6-andriy.shevchenko@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3448950vqb; Mon, 16 Oct 2023 06:10:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH2McD/AGKW/smE4ox7UgIkXdTbXHaQgDw46sbL/yycvxLDDrYnPYgH+aQiBnbNbldMlaGr X-Received: by 2002:a92:d1d0:0:b0:351:54db:c1bc with SMTP id u16-20020a92d1d0000000b0035154dbc1bcmr31591994ilg.0.1697461839899; Mon, 16 Oct 2023 06:10:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697461839; cv=none; d=google.com; s=arc-20160816; b=lJ7dGdrBpQ8OjU/Nv3aG9b7MOAg0Njz1q+/EPKt8RTG970bjuOV92K6HwJuq9pyh0Q amGFfpRbgeK2zJ6IA/V3TxoydjebPr/6RMH497+2g1E+PULipptkquNyvSm03DB885nb ObXihv4NqeKcJ/t5lQRqJdo9gfvcw4ybSqaiE3gorISp8BUYDlxu29JmlCp+GdUYMNyA tjt0mrXnX80O4tJsBMwrsqDhGyI/5pJluOYzkONRxFMHRgI+u/YKlnBoIXaY9d5p4ifG Vk4WIJKRBgqLAjN6prCGQjK8IEZdzPKXp7I1D5dt+vdBER6BvXGOl5BDQkwSP/uZrTVX xtpQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=UeE1YlwW1TLwGLoL80QnMKmXCTXeyGgzst1pq35qF1k=; fh=YYrWResMAxfU+C17BdM7l/WUXXvK87rdz5rOaZ9UMD0=; b=LpkNCHBPeA7dHolY4zYeb0Wy+biZ2NINp2f9gDTagMUUPkIDijtCK3OVhDH80h4aHY anLElRMSwLJst1CHX5ZCkNeVXL5fX66R6J0PVEQSVKYuGOiiBUKexLaXDyJ4Rupdjrbs 3087KpM01XfU6WhD6+G2wma1O3mOScsRjw2NU47+mZjMOh3C48P+n36vNQOcslbcmP0Y nkeiR+ArwF4knMtZUtUyPlygJu6rrpDo97LaR/T7fyGmnI2EqHkVfsZwezEQiRDtAujk zxPR6yH6liZ5ZvJCJBmnj0rQ8+6DE4BFDaDOtRuZLUNUM1IyKMh5FxBsGkynQpOtjK0g JwgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XOM8812j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z19-20020a63e113000000b005add209e106si6514346pgh.442.2023.10.16.06.10.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 06:10:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=XOM8812j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 3AEEF809A78D; Mon, 16 Oct 2023 06:10:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233675AbjJPNKF (ORCPT <rfc822;hjfbswb@gmail.com> + 18 others); Mon, 16 Oct 2023 09:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233639AbjJPNJw (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 16 Oct 2023 09:09:52 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4931EB; Mon, 16 Oct 2023 06:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697461788; x=1728997788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=hSDxuqmZzlGLTaad8H323ocWfeLLf3evwalEGIIxd/4=; b=XOM8812jA4R+p9xmnk0se/VFY7u06lCigl4tLDe980crf/LroXAHGAkk xaqZNghZ9L5TRtsVqA76O6zAHslYIdND4Zo5m5WWC/dCSusvUcClLtZad 22GvtseLLgvagfLQHW1VSUoXoHqOMAVKZftOXpxeCoPN6RzllsO0hyacB LIOhAk6QJASSaX+ng259I5vmQTj3/39nFWjVGqS+9dK5SIE//pE21sGMP N6i35D1lVTrK7Kv/rwxvev9uKaP7Sz21BpqUt8VlQNUWMFaT/YQEYp43l TgH2SydHlqM9Y3Es37RtBpdO4TV+/iGk4ZpAlnmavf6j7M38N4ZTAW+o9 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="416590164" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="416590164" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 06:09:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10863"; a="759385520" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="759385520" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 16 Oct 2023 06:09:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 30EBE9CE; Mon, 16 Oct 2023 16:09:42 +0300 (EEST) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Mathias Nyman <mathias.nyman@linux.intel.com>, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mathias Nyman <mathias.nyman@intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Subject: [PATCH v2 05/10] xhci: dbc: Check for errors first in xhci_dbc_stop() Date: Mon, 16 Oct 2023 16:09:29 +0300 Message-Id: <20231016130934.1158504-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b In-Reply-To: <20231016130934.1158504-1-andriy.shevchenko@linux.intel.com> References: <20231016130934.1158504-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 06:10:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779917746199190957 X-GMAIL-MSGID: 1779917746199190957 |
Series |
xhci: dbc: Update driver to use modern APIs
|
|
Commit Message
Andy Shevchenko
Oct. 16, 2023, 1:09 p.m. UTC
The usual patter is to check for errors and then continue if none.
Apply that pattern to xhci_dbc_stop() code.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/usb/host/xhci-dbgcap.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On 10/16/23 4:09 PM, Andy Shevchenko wrote: > The usual patter is to check for errors and then continue if none. Pattern. :-) > Apply that pattern to xhci_dbc_stop() code. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> [...] MBR, Sergey
On 16.10.2023 19.55, Sergei Shtylyov wrote: > On 10/16/23 4:09 PM, Andy Shevchenko wrote: > >> The usual patter is to check for errors and then continue if none. > > Pattern. :-) > I'll fix it while applying -Mathias
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index 660e3ee31dc6..6b9f4b839270 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -646,11 +646,11 @@ static void xhci_dbc_stop(struct xhci_dbc *dbc) spin_lock_irqsave(&dbc->lock, flags); ret = xhci_do_dbc_stop(dbc); spin_unlock_irqrestore(&dbc->lock, flags); + if (ret) + return; - if (!ret) { - xhci_dbc_mem_cleanup(dbc); - pm_runtime_put_sync(dbc->dev); /* note, was self.controller */ - } + xhci_dbc_mem_cleanup(dbc); + pm_runtime_put_sync(dbc->dev); /* note, was self.controller */ } static void