From patchwork Tue Jun 11 17:58:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10987993 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 369B013AF for ; Tue, 11 Jun 2019 17:59:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24F2B27FA8 for ; Tue, 11 Jun 2019 17:59:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1908528628; Tue, 11 Jun 2019 17:59:03 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 A9DCF27FA8 for ; Tue, 11 Jun 2019 17:59:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406791AbfFKR7C (ORCPT ); Tue, 11 Jun 2019 13:59:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:49648 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406781AbfFKR7B (ORCPT ); Tue, 11 Jun 2019 13:59:01 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 5D40F2086D; Tue, 11 Jun 2019 17:59:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560275940; bh=MK9z6qc6477w3QjwaHDf+E3M5nkEx1R3Vk/Ui/ZFJBc=; h=Date:From:To:Cc:Subject:From; b=zX2SpavHeYz6Xkr3kk/NPf9QskVWlUTyrRA22+8TtRPBvTTMHGF0frmsREIEaELZF kKX+I1TnZV15Bg6wfCuxVLic3YJYh/O6QUljlAwatp9Tm0agp9KO7Rg3va7t1SS9es 6HrzD5/9lhlsEpA3MKpVDo7+6u15w9DjPeQOwk3A= Date: Tue, 11 Jun 2019 19:58:58 +0200 From: Greg Kroah-Hartman To: Luca Tettamanti , Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org Subject: [PATCH] hwmon: asus_atk0110: no need to check return value of debugfs_create functions Message-ID: <20190611175858.GA10077@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@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: Luca Tettamanti Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/hwmon/asus_atk0110.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 22be78cc5a4c..b5f0abde916b 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c @@ -789,33 +789,16 @@ static const struct file_operations atk_debugfs_ggrp_fops = { static void atk_debugfs_init(struct atk_data *data) { struct dentry *d; - struct dentry *f; data->debugfs.id = 0; d = debugfs_create_dir("asus_atk0110", NULL); - if (!d || IS_ERR(d)) - return; - f = debugfs_create_x32("id", 0600, d, &data->debugfs.id); - if (!f || IS_ERR(f)) - goto cleanup; - - f = debugfs_create_file_unsafe("gitm", 0400, d, data, - &atk_debugfs_gitm); - if (!f || IS_ERR(f)) - goto cleanup; - - f = debugfs_create_file("ggrp", 0400, d, data, - &atk_debugfs_ggrp_fops); - if (!f || IS_ERR(f)) - goto cleanup; + debugfs_create_x32("id", 0600, d, &data->debugfs.id); + debugfs_create_file_unsafe("gitm", 0400, d, data, &atk_debugfs_gitm); + debugfs_create_file("ggrp", 0400, d, data, &atk_debugfs_ggrp_fops); data->debugfs.root = d; - - return; -cleanup: - debugfs_remove_recursive(d); } static void atk_debugfs_cleanup(struct atk_data *data)