watchdog: diag288_wdt: use kmemdup() to allocate memory
Subsystems (2)
PATCH 1/1 watchdog: diag288_wdt: use kmemdup() to allocate memory
Use kmemdup() helper instead of open-coding to simplify the code when allocating ebc_cmd.
Generated by: scripts/coccinelle/api/memdup.cocci
--- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/watchdog/diag288_wdt.c +1 -2
@@ -273,12 +273,11 @@ static int __init diag288_init(void)watchdog_set_nowayout (&wdt_dev, nowayout_info);if (MACHINE_IS_VM ) { - ebc_cmd =kmalloc (sizeof (ebc_begin),GFP_KERNEL ); + ebc_cmd =kmemdup (ebc_begin,sizeof (ebc_begin),GFP_KERNEL );if (!ebc_cmd) {pr_err ("The watchdog cannot be initialized\n" );return -ENOMEM ; } -memcpy (ebc_cmd, ebc_begin,sizeof (ebc_begin)); ret =__diag288_vm (WDT_FUNC_INIT ,15 , ebc_cmd,sizeof (ebc_begin));kfree (ebc_cmd);
Signature · 1 line
2.25.1
Heiko Carstens
maintainerQuoted 9 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Yang Yingliang <[email protected]>--- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
Guenter Roeck
maintainerQuoted 6 lines · Heiko Carstens
Quoted 5 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocci
Quoted 7 lines
Quoted 4 lines
Signed-off-by Yang Yingliang <[email protected]>--- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
It looks like you decided to bypass even sending your patches to the watchdog mailing list. I know I have not been as responsive there as I should be, but that it no reason to bypass the maintainers completely.
Guenter
Heiko Carstens
maintainerQuoted 12 lines · Guenter Roeck
Quoted 11 lines · Heiko Carstens
Quoted 9 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Yang Yingliang <[email protected]>--- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
It looks like you decided to bypass even sending your patches to the watchdog mailing list. I know I have not been as responsive there as I should be, but that it no reason to bypass the maintainers completely.
This is s390 only code which is broken. I doubt that anybody cares about s390 specific inline assemblies.
But yes, besides that you are correct.
Guenter Roeck
maintainerQuoted 16 lines · Heiko Carstens
Quoted 15 lines · Guenter Roeck
Quoted 13 lines · Heiko Carstens
Quoted 9 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Yang Yingliang <[email protected]>--- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
Quoted 7 lines
Quoted 3 lines
It looks like you decided to bypass even sending your patches to the watchdog mailing list. I know I have not been as responsive there as I should be, but that it no reason to bypass the maintainers completely.
This is s390 only code which is broken. I doubt that anybody cares about s390 specific inline assemblies.
s/s390/<pick your platform>/g
I guess with that logic we can abolish watchdog subsystem maintenance pretty much completely. After all, pretty much all watchdogs are only of interest for a limited audience.
Guenter
Quoted 12 lines · Guenter Roeck
Quoted 11 lines · Heiko Carstens
Quoted 9 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Yang Yingliang <[email protected]>---
drivers/watchdog/diag288_wdt.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 6 lines
Quoted 2 lines
Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
It looks like you decided to bypass even sending your patches to the watchdog mailing list. I know I have not been as responsive there as I should be, but that it no reason to bypass the maintainers completely.
I sent the patch to all the maintainers that get by './scripts/get_maintainer.pl drivers/watchdog/diag288_wdt.c'
Thanks,
Yang
Quoted 4 lines
Guenter
.
Guenter Roeck
maintainerQuoted 14 lines · Yang Yingliang
Quoted 12 lines · Guenter Roeck
Quoted 11 lines · Heiko Carstens
Quoted 9 lines · Yang Yingliang
Use
kmemdup()helper instead of open-coding to simplify the code when allocatingebc_cmd.Generated by:
scripts/coccinelle/api/memdup.cocciSigned-off-by Yang Yingliang <[email protected]>---
drivers/watchdog/diag288_wdt.c| 3 +--1 file changed, 1 insertion(+), 2 deletions(-)
Quoted 8 lines
Quoted 6 lines
Quoted 2 lines
Thanks, but this code will be changed differently with the next merge window. Therefore I will not apply patch.
It looks like you decided to bypass even sending your patches to the watchdog mailing list. I know I have not been as responsive there as I should be, but that it no reason to bypass the maintainers completely.
I sent the patch to all the maintainers that get by '
./scripts/get_maintainer.pldrivers/watchdog/diag288_wdt.c'
I did not refer to your patch, but to Heiko's patch series (which since has been applied to the mainline kernel).
Guenter