From patchwork Thu Jun 13 18:38:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10993459 X-Patchwork-Delegate: rui.zhang@intel.com 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 958EB924 for ; Thu, 13 Jun 2019 18:38:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8073822A68 for ; Thu, 13 Jun 2019 18:38:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F28222B27; Thu, 13 Jun 2019 18:38:14 +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 E27AC22A68 for ; Thu, 13 Jun 2019 18:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726705AbfFMSiN (ORCPT ); Thu, 13 Jun 2019 14:38:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:34304 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726626AbfFMSiN (ORCPT ); Thu, 13 Jun 2019 14:38:13 -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 4C061208CA; Thu, 13 Jun 2019 18:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560451092; bh=mCeTL7k6bagP7YI+YzWTIBqj23rm7VuKVFZ3HMOfpZU=; h=Date:From:To:Cc:Subject:From; b=uREaLO0oEkfJtBwIh15u3Z2XsoMRSh2tWjKbYRz5hSRkYHSrreLsaFmCDrtGTrelh jGHXkEVzYiS1TBi8LOZ7xaI/XlaLaTVqKs8yNB68HjDd2j6z6+TdzwTmQBJ0iz5qou /WxL1Ln+bau2jZ1saixMaKQxG8H6Wt9bAeH/zwAw= Date: Thu, 13 Jun 2019 20:38:10 +0200 From: Greg Kroah-Hartman To: Zhang Rui , Eduardo Valentin , Daniel Lezcano , Finn Thain Cc: linux-pm@vger.kernel.org Subject: [PATCH] thermal: intel_powerclamp: no need to check return value of debugfs_create functions Message-ID: <20190613183810.GC32085@kroah.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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: Zhang Rui Cc: Eduardo Valentin Cc: Daniel Lezcano Cc: Finn Thain Cc: linux-pm@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Reviewed-by: Daniel Lezcano --- drivers/thermal/intel/intel_powerclamp.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/intel/intel_powerclamp.c b/drivers/thermal/intel/intel_powerclamp.c index ac7256b5f020..39c6b589f2ed 100644 --- a/drivers/thermal/intel/intel_powerclamp.c +++ b/drivers/thermal/intel/intel_powerclamp.c @@ -713,17 +713,9 @@ DEFINE_SHOW_ATTRIBUTE(powerclamp_debug); static inline void powerclamp_create_debug_files(void) { debug_dir = debugfs_create_dir("intel_powerclamp", NULL); - if (!debug_dir) - return; - - if (!debugfs_create_file("powerclamp_calib", S_IRUGO, debug_dir, - cal_data, &powerclamp_debug_fops)) - goto file_error; - return; - -file_error: - debugfs_remove_recursive(debug_dir); + debugfs_create_file("powerclamp_calib", S_IRUGO, debug_dir, cal_data, + &powerclamp_debug_fops); } static enum cpuhp_state hp_state;