diff mbox series

input: edt-ft5x06: no need to check return value of debugfs_create functions

Message ID 20190810105557.GA27295@kroah.com (mailing list archive)
State Mainlined
Commit 042cc4c778e1aa56f83ebe44b6f959c204861f08
Headers show
Series input: edt-ft5x06: no need to check return value of debugfs_create functions | expand

Commit Message

Greg KH Aug. 10, 2019, 10:55 a.m. UTC
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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Marco Felsch <m.felsch@pengutronix.de>
Cc: Rob Herring <robh@kernel.org>
Cc: linux-input@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/input/touchscreen/edt-ft5x06.c | 2 --
 1 file changed, 2 deletions(-)

Comments

dmitry.torokhov@gmail.com Aug. 12, 2019, 7:05 a.m. UTC | #1
On Sat, Aug 10, 2019 at 12:55:57PM +0200, Greg Kroah-Hartman wrote:
> 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: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Marco Felsch <m.felsch@pengutronix.de>
> Cc: Rob Herring <robh@kernel.org>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied, thank you.

> ---
>  drivers/input/touchscreen/edt-ft5x06.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
> index 3cc4341bbdff..5525f1fb1526 100644
> --- a/drivers/input/touchscreen/edt-ft5x06.c
> +++ b/drivers/input/touchscreen/edt-ft5x06.c
> @@ -764,8 +764,6 @@ edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata,
>  			      const char *debugfs_name)
>  {
>  	tsdata->debug_dir = debugfs_create_dir(debugfs_name, NULL);
> -	if (!tsdata->debug_dir)
> -		return;
>  
>  	debugfs_create_u16("num_x", S_IRUSR, tsdata->debug_dir, &tsdata->num_x);
>  	debugfs_create_u16("num_y", S_IRUSR, tsdata->debug_dir, &tsdata->num_y);
> -- 
> 2.22.0
>
diff mbox series

Patch

diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 3cc4341bbdff..5525f1fb1526 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -764,8 +764,6 @@  edt_ft5x06_ts_prepare_debugfs(struct edt_ft5x06_ts_data *tsdata,
 			      const char *debugfs_name)
 {
 	tsdata->debug_dir = debugfs_create_dir(debugfs_name, NULL);
-	if (!tsdata->debug_dir)
-		return;
 
 	debugfs_create_u16("num_x", S_IRUSR, tsdata->debug_dir, &tsdata->num_x);
 	debugfs_create_u16("num_y", S_IRUSR, tsdata->debug_dir, &tsdata->num_y);