i2c: gpio: remove error checks with debugfs
Subsystems (2)
Wolfram Sang
maintainerPATCH 1/1 i2c: gpio: remove error checks with debugfs
debugfs can handle error pointers in subsequent calls. So, remove the error checks as suggested by kerneldoc of this function.
--- drivers/i2c/busses/i2c-gpio.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/i2c/busses/i2c-gpio.c +1 -6
@@ -263,15 +263,10 @@ static void i2c_gpio_fault_injector_init(struct platform_device *pdev)* 'fault-injector' dir there. Until then, we have a global dir with * all adapters as subdirs. */ -if (!i2c_gpio_debug_dir) { +if (!i2c_gpio_debug_dir) i2c_gpio_debug_dir =debugfs_create_dir ("i2c-fault-injector" ,NULL ); -if (!i2c_gpio_debug_dir) -return ; - } priv->debug_dir =debugfs_create_dir (pdev->name, i2c_gpio_debug_dir); -if (!priv->debug_dir) -return ;init_completion (&priv->scl_irq_completion);
Signature · 1 line
2.35.1
Hi Wolfram,
[...]
Quoted 8 lines
drivers/i2c/busses/i2c-gpio.c +0
-0@@ -263,15 +263,10 @@ static void i2c_gpio_fault_injector_init(struct platform_device *pdev)* 'fault-injector' dir there. Until then, we have a global dir with * all adapters as subdirs. */
drivers/i2c/busses/i2c-gpio.c static void i2c_gpio_fault_injector_init(struct platform_device *pdev) · line 274
Quoted 10 lines
drivers/i2c/busses/i2c-gpio.c +1
-6-if (!i2c_gpio_debug_dir) { +if (!i2c_gpio_debug_dir) i2c_gpio_debug_dir =debugfs_create_dir ("i2c-fault-injector" ,NULL ); -if (!i2c_gpio_debug_dir) -return ; - } priv->debug_dir =debugfs_create_dir (pdev->name, i2c_gpio_debug_dir); -if (!priv->debug_dir) -return ;
nice... this reminds me of some more cleanups that needs to be done elsewhere.
Another good thing that comes out from this patch is that if a debgufs entry is not created it's not a big deal and we shouldn't return but move ahead with the function execution.
Andi
Quoted 5 lines · Wolfram Sang
debugfs can handle error pointers in subsequent calls. So, remove the error checks as suggested by kerneldoc of this function.
Reported-by Minjie Du <[email protected]>Signed-off-by Wolfram Sang <[email protected]>
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds
Quoted 5 lines · Wolfram Sang
debugfs can handle error pointers in subsequent calls. So, remove the error checks as suggested by kerneldoc of this function.
Reported-by Minjie Du <[email protected]>Signed-off-by Wolfram Sang <[email protected]>
Applied to for-next, thanks!