From patchwork Tue May 29 15:30:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 10436275 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 A8E47602BF for ; Tue, 29 May 2018 15:32:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98F3E28782 for ; Tue, 29 May 2018 15:32:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D8CE2889C; Tue, 29 May 2018 15:32:43 +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 3012328782 for ; Tue, 29 May 2018 15:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935626AbeE2Pcl (ORCPT ); Tue, 29 May 2018 11:32:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:40240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934963AbeE2Pck (ORCPT ); Tue, 29 May 2018 11:32:40 -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 B27F3208A2; Tue, 29 May 2018 15:32:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607960; bh=QhYQ4TKndoZ6PGUaNrujJmoBDPYePh/D//sFvBjipV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HN4Qn2jorRgiC1Qn2H9WuKe+CYpot5xyz0lPj18JfuNcEovD69abHBcLWqCKw/yHF omc83zXvXlHSh/MNZefa+IOm6W7+kG4z9DPAmeb86pHj9nfeJlLEuyeoNN5sVIIiGe oCvNucYn5frk6FQk6zOMCkvcjVexMopPf1xkcJJU= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Felipe Balbi , Johan Hovold , Andy Shevchenko Subject: [PATCH 09/22] USB: imx21-hcd: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:30:54 +0200 Message-Id: <20180529153107.12791-9-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: Felipe Balbi Cc: Johan Hovold Cc: Andy Shevchenko Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/imx21-dbg.c | 44 ++++++++---------------------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/drivers/usb/host/imx21-dbg.c b/drivers/usb/host/imx21-dbg.c index a213ed6f07b5..7fcf1d9dd7f3 100644 --- a/drivers/usb/host/imx21-dbg.c +++ b/drivers/usb/host/imx21-dbg.c @@ -417,46 +417,22 @@ DEFINE_SHOW_ATTRIBUTE(debug_isoc); static void create_debug_files(struct imx21 *imx21) { - imx21->debug_root = debugfs_create_dir(dev_name(imx21->dev), NULL); - if (!imx21->debug_root) - goto failed_create_rootdir; + struct dentry *root; - if (!debugfs_create_file("status", S_IRUGO, - imx21->debug_root, imx21, &debug_status_fops)) - goto failed_create; + root = debugfs_create_dir(dev_name(imx21->dev), NULL); + imx21->debug_root = root; - if (!debugfs_create_file("dmem", S_IRUGO, - imx21->debug_root, imx21, &debug_dmem_fops)) - goto failed_create; - - if (!debugfs_create_file("etd", S_IRUGO, - imx21->debug_root, imx21, &debug_etd_fops)) - goto failed_create; - - if (!debugfs_create_file("statistics", S_IRUGO, - imx21->debug_root, imx21, &debug_statistics_fops)) - goto failed_create; - - if (!debugfs_create_file("isoc", S_IRUGO, - imx21->debug_root, imx21, &debug_isoc_fops)) - goto failed_create; - - return; - -failed_create: - debugfs_remove_recursive(imx21->debug_root); - -failed_create_rootdir: - imx21->debug_root = NULL; + debugfs_create_file("status", S_IRUGO, root, imx21, &debug_status_fops); + debugfs_create_file("dmem", S_IRUGO, root, imx21, &debug_dmem_fops); + debugfs_create_file("etd", S_IRUGO, root, imx21, &debug_etd_fops); + debugfs_create_file("statistics", S_IRUGO, root, imx21, + &debug_statistics_fops); + debugfs_create_file("isoc", S_IRUGO, root, imx21, &debug_isoc_fops); } - static void remove_debug_files(struct imx21 *imx21) { - if (imx21->debug_root) { - debugfs_remove_recursive(imx21->debug_root); - imx21->debug_root = NULL; - } + debugfs_remove_recursive(imx21->debug_root); } #endif