From patchwork Tue May 29 15:30:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10436269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1CEDB601C7 for ; Tue, 29 May 2018 15:32:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D10428782 for ; Tue, 29 May 2018 15:32:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0196C2889C; Tue, 29 May 2018 15:32:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 713E028782 for ; Tue, 29 May 2018 15:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935207AbeE2Pcc (ORCPT ); Tue, 29 May 2018 11:32:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:40160 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934963AbeE2Pcc (ORCPT ); Tue, 29 May 2018 11:32:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4952220899; Tue, 29 May 2018 15:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607951; bh=tQCYja8xkhoBnL6ownu7fKpMjgxSl/vXHAG5gcH/IZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C6xhl91ZwDr+8qUgSTH7ZXoyUaWaL9slTzI/XGF9xg0RcRECFW7G2s08cOkhrN9UQ CNwyXWVDggDPMEQnhuq2Y7BbvtlQPWU87oqKxcBdv+RtK/o23OjRgUxSQ39wOvjpFu swqv01JCEyUn4lp4tIoDnFDa7HJAmDSbSA8q2JoM= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Alan Stern Subject: [PATCH 06/22] USB: uhci: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:30:51 +0200 Message-Id: <20180529153107.12791-6-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180529153107.12791-1-gregkh@linuxfoundation.org> References: <20180529153107.12791-1-gregkh@linuxfoundation.org> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Cc: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/uhci-hcd.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/uhci-hcd.c b/drivers/usb/host/uhci-hcd.c index f9c3947577fc..6218bfe54f52 100644 --- a/drivers/usb/host/uhci-hcd.c +++ b/drivers/usb/host/uhci-hcd.c @@ -590,14 +590,10 @@ static int uhci_start(struct usb_hcd *hcd) init_waitqueue_head(&uhci->waitqh); #ifdef UHCI_DEBUG_OPS - dentry = debugfs_create_file(hcd->self.bus_name, - S_IFREG|S_IRUGO|S_IWUSR, uhci_debugfs_root, - uhci, &uhci_debug_operations); - if (!dentry) { - dev_err(uhci_dev(uhci), "couldn't create uhci debugfs entry\n"); - return -ENOMEM; - } - uhci->dentry = dentry; + uhci->dentry = debugfs_create_file(hcd->self.bus_name, + S_IFREG|S_IRUGO|S_IWUSR, + uhci_debugfs_root, uhci, + &uhci_debug_operations); #endif uhci->frame = dma_zalloc_coherent(uhci_dev(uhci), @@ -882,8 +878,6 @@ static int __init uhci_hcd_init(void) if (!errbuf) goto errbuf_failed; uhci_debugfs_root = debugfs_create_dir("uhci", usb_debug_root); - if (!uhci_debugfs_root) - goto debug_failed; #endif uhci_up_cachep = kmem_cache_create("uhci_urb_priv", @@ -918,7 +912,6 @@ static int __init uhci_hcd_init(void) #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG) debugfs_remove(uhci_debugfs_root); -debug_failed: kfree(errbuf); errbuf_failed: