From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1806BC31E45 for ; Thu, 13 Jun 2019 18:38:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E15CE2133D for ; Thu, 13 Jun 2019 18:38:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560451094; bh=mCeTL7k6bagP7YI+YzWTIBqj23rm7VuKVFZ3HMOfpZU=; h=Date:From:To:Cc:Subject:List-ID:From; b=GzsFK5YjUeLFUMjeVzx7lqxcnzPx/boLGqnx3eX8x5i+kY2ELtoGN7q0BHVTgPzC4 tSqUZWKMU/Rncyqx7nbTZb9KL7zw4VPfJrVTI+2MHUEveqkYM9VSfHHeeahFwf/Oam 7RHzpjs3Xk+LDfMqUY3/+w/LxVn3deVOJgl56vrg= 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-Type: text/plain; charset=us-ascii 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 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 --- 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; -- 2.22.0