* [PATCH] i2c: gpio: remove error checks with debugfs
@ 2023-09-21 8:40 Wolfram Sang
2023-09-21 21:35 ` Andi Shyti
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Wolfram Sang @ 2023-09-21 8:40 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Minjie Du, Andi Shyti, linux-i2c, linux-kernel
debugfs can handle error pointers in subsequent calls. So, remove the
error checks as suggested by kerneldoc of this function.
Reported-by: Minjie Du <duminjie@vivo.com>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
drivers/i2c/busses/i2c-gpio.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
index e5a5b9e8bf2c..fb35a75fe0e3 100644
--- a/drivers/i2c/busses/i2c-gpio.c
+++ b/drivers/i2c/busses/i2c-gpio.c
@@ -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);
--
2.35.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: gpio: remove error checks with debugfs
2023-09-21 8:40 [PATCH] i2c: gpio: remove error checks with debugfs Wolfram Sang
@ 2023-09-21 21:35 ` Andi Shyti
2023-09-22 7:35 ` Geert Uytterhoeven
2023-09-22 9:57 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Andi Shyti @ 2023-09-21 21:35 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc, Minjie Du, linux-i2c, linux-kernel
Hi Wolfram,
[...]
> diff --git a/drivers/i2c/busses/i2c-gpio.c b/drivers/i2c/busses/i2c-gpio.c
> index e5a5b9e8bf2c..fb35a75fe0e3 100644
> --- a/drivers/i2c/busses/i2c-gpio.c
> +++ b/drivers/i2c/busses/i2c-gpio.c
> @@ -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;
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.
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Andi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: gpio: remove error checks with debugfs
2023-09-21 8:40 [PATCH] i2c: gpio: remove error checks with debugfs Wolfram Sang
2023-09-21 21:35 ` Andi Shyti
@ 2023-09-22 7:35 ` Geert Uytterhoeven
2023-09-22 9:57 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2023-09-22 7:35 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Minjie Du, Andi Shyti, linux-i2c, linux-kernel
On Thu, Sep 21, 2023 at 11:23 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> debugfs can handle error pointers in subsequent calls. So, remove the
> error checks as suggested by kerneldoc of this function.
>
> Reported-by: Minjie Du <duminjie@vivo.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] i2c: gpio: remove error checks with debugfs
2023-09-21 8:40 [PATCH] i2c: gpio: remove error checks with debugfs Wolfram Sang
2023-09-21 21:35 ` Andi Shyti
2023-09-22 7:35 ` Geert Uytterhoeven
@ 2023-09-22 9:57 ` Wolfram Sang
2 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2023-09-22 9:57 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Minjie Du, Andi Shyti, linux-i2c, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
On Thu, Sep 21, 2023 at 10:40:15AM +0200, Wolfram Sang wrote:
> debugfs can handle error pointers in subsequent calls. So, remove the
> error checks as suggested by kerneldoc of this function.
>
> Reported-by: Minjie Du <duminjie@vivo.com>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied to for-next, thanks!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-22 9:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-21 8:40 [PATCH] i2c: gpio: remove error checks with debugfs Wolfram Sang
2023-09-21 21:35 ` Andi Shyti
2023-09-22 7:35 ` Geert Uytterhoeven
2023-09-22 9:57 ` Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox