From patchwork Tue May 29 15:30:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10436241 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 BCE2F602BF for ; Tue, 29 May 2018 15:31:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADAEC28813 for ; Tue, 29 May 2018 15:31:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2CA42888E; Tue, 29 May 2018 15:31:51 +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 48EE928813 for ; Tue, 29 May 2018 15:31:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935055AbeE2Pbu (ORCPT ); Tue, 29 May 2018 11:31:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:39738 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934867AbeE2Pbt (ORCPT ); Tue, 29 May 2018 11:31:49 -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 AC50920899; Tue, 29 May 2018 15:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607909; bh=Hext22QATpRMh3MoL4SMmgU3Iy8kFHY6YI27UnNe0ps=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b/qeQniTBVQ3o5Bn0yHQ4RmtJIsitYPZNchgsu53Uw8v57QsdNyvd2FMP4mpoddXO MaC239UWssyaZOJVVCdxzX4OKl5T+MgWx+IT0XWKMQB9nIun2GqBD5KDFtQiEUQxY8 NakOg1fKphnFN7SdphKx7r28OO3dfuVM6K72hUbM= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Felipe Balbi , Andy Shevchenko , Johan Hovold Subject: [PATCH 11/22] USB: fhci-hcd: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:30:56 +0200 Message-Id: <20180529153107.12791-11-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. There is also no need to keep the file dentries around at all, so remove those variables from the host controller structure. Cc: Felipe Balbi Cc: Andy Shevchenko Cc: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/fhci-dbg.c | 23 +++++------------------ drivers/usb/host/fhci.h | 2 -- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/drivers/usb/host/fhci-dbg.c b/drivers/usb/host/fhci-dbg.c index ebf9bb219f75..100048b3bd17 100644 --- a/drivers/usb/host/fhci-dbg.c +++ b/drivers/usb/host/fhci-dbg.c @@ -83,27 +83,14 @@ void fhci_dfs_create(struct fhci_hcd *fhci) struct device *dev = fhci_to_hcd(fhci)->self.controller; fhci->dfs_root = debugfs_create_dir(dev_name(dev), usb_debug_root); - if (!fhci->dfs_root) { - WARN_ON(1); - return; - } - - fhci->dfs_regs = debugfs_create_file("regs", S_IFREG | S_IRUGO, - fhci->dfs_root, fhci, &fhci_dfs_regs_fops); - fhci->dfs_irq_stat = debugfs_create_file("irq_stat", - S_IFREG | S_IRUGO, fhci->dfs_root, fhci, - &fhci_dfs_irq_stat_fops); - - WARN_ON(!fhci->dfs_regs || !fhci->dfs_irq_stat); + debugfs_create_file("regs", S_IFREG | S_IRUGO, fhci->dfs_root, fhci, + &fhci_dfs_regs_fops); + debugfs_create_file("irq_stat", S_IFREG | S_IRUGO, fhci->dfs_root, fhci, + &fhci_dfs_irq_stat_fops); } void fhci_dfs_destroy(struct fhci_hcd *fhci) { - if (!fhci->dfs_root) - return; - - debugfs_remove(fhci->dfs_irq_stat); - debugfs_remove(fhci->dfs_regs); - debugfs_remove(fhci->dfs_root); + debugfs_remove_recursive(fhci->dfs_root); } diff --git a/drivers/usb/host/fhci.h b/drivers/usb/host/fhci.h index e7ec41d62410..2ce5031d866d 100644 --- a/drivers/usb/host/fhci.h +++ b/drivers/usb/host/fhci.h @@ -262,8 +262,6 @@ struct fhci_hcd { #ifdef CONFIG_FHCI_DEBUG int usb_irq_stat[13]; struct dentry *dfs_root; - struct dentry *dfs_regs; - struct dentry *dfs_irq_stat; #endif };