Skip to content

Commit

Permalink
thermal: intel_powerclamp: no need to check return value of debugfs_c…
Browse files Browse the repository at this point in the history
…reate functions

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 <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: linux-pm@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jun 18, 2019
1 parent 72c9f26 commit c008c67
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions drivers/thermal/intel/intel_powerclamp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c008c67

Please sign in to comment.