From patchwork Tue May 29 15:30:53 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: 10436273 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 C4BD2602BF for ; Tue, 29 May 2018 15:32:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B63ED28782 for ; Tue, 29 May 2018 15:32:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB1CB2888E; Tue, 29 May 2018 15:32:40 +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 E6AAD2889C for ; Tue, 29 May 2018 15:32:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935566AbeE2Pci (ORCPT ); Tue, 29 May 2018 11:32:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:40206 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934963AbeE2Pci (ORCPT ); Tue, 29 May 2018 11:32:38 -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 133F920899; Tue, 29 May 2018 15:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527607957; bh=c3Z75WVB3PApZBVl/sQARkYg926l8MWYAM77cvrUau8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MDeniXzkt8twIHBb7016j8gz0T7VDuynGJ4tb/c1pa1X4tcCNDp8T6JT4R+brqeFH 0kEUMhzSDFUFFheW+HHyccOShLlgyMBBlrA/leNgdOxZ3/wP/1f1HSTKCbGZdkkur1 k4vGtiSKL42dhn74wvJ1nnVkrFr2rejO2IWRVkZo= From: Greg Kroah-Hartman To: linux-usb@vger.kernel.org Cc: Greg Kroah-Hartman , Olav Kongas Subject: [PATCH 08/22] USB: isp116x-hcd: no need to check return value of debugfs_create functions Date: Tue, 29 May 2018 17:30:53 +0200 Message-Id: <20180529153107.12791-8-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: Olav Kongas Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/isp116x-hcd.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/usb/host/isp116x-hcd.c b/drivers/usb/host/isp116x-hcd.c index 4602ed801f0a..74da136d322a 100644 --- a/drivers/usb/host/isp116x-hcd.c +++ b/drivers/usb/host/isp116x-hcd.c @@ -1198,14 +1198,11 @@ static int isp116x_debug_show(struct seq_file *s, void *unused) } DEFINE_SHOW_ATTRIBUTE(isp116x_debug); -static int create_debug_file(struct isp116x *isp116x) +static void create_debug_file(struct isp116x *isp116x) { isp116x->dentry = debugfs_create_file(hcd_name, S_IRUGO, NULL, isp116x, &isp116x_debug_fops); - if (!isp116x->dentry) - return -ENOMEM; - return 0; } static void remove_debug_file(struct isp116x *isp116x) @@ -1215,8 +1212,8 @@ static void remove_debug_file(struct isp116x *isp116x) #else -#define create_debug_file(d) 0 -#define remove_debug_file(d) do{}while(0) +static inline void create_debug_file(struct isp116x *isp116x) { } +static inline void remove_debug_file(struct isp116x *isp116x) { } #endif /* CONFIG_DEBUG_FS */ @@ -1643,16 +1640,10 @@ static int isp116x_probe(struct platform_device *pdev) device_wakeup_enable(hcd->self.controller); - ret = create_debug_file(isp116x); - if (ret) { - ERR("Couldn't create debugfs entry\n"); - goto err7; - } + create_debug_file(isp116x); return 0; - err7: - usb_remove_hcd(hcd); err6: usb_put_hcd(hcd); err5: