Message ID | 20230202074127.4108100-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [-next] watchdog: diag288_wdt: use kmemdup() to allocate memory | expand |
On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: > Use kmemdup() helper instead of open-coding to simplify > the code when allocating ebc_cmd. > > Generated by: scripts/coccinelle/api/memdup.cocci > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > --- > 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.
On 2/2/23 05:22, Heiko Carstens wrote: > On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: >> Use kmemdup() helper instead of open-coding to simplify >> the code when allocating ebc_cmd. >> >> Generated by: scripts/coccinelle/api/memdup.cocci >> >> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> >> --- >> 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
On Thu, Feb 02, 2023 at 05:35:40AM -0800, Guenter Roeck wrote: > On 2/2/23 05:22, Heiko Carstens wrote: > > On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: > > > Use kmemdup() helper instead of open-coding to simplify > > > the code when allocating ebc_cmd. > > > > > > Generated by: scripts/coccinelle/api/memdup.cocci > > > > > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > > > --- > > > 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. 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.
On Thu, Feb 02, 2023 at 03:06:24PM +0100, Heiko Carstens wrote: > On Thu, Feb 02, 2023 at 05:35:40AM -0800, Guenter Roeck wrote: > > On 2/2/23 05:22, Heiko Carstens wrote: > > > On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: > > > > Use kmemdup() helper instead of open-coding to simplify > > > > the code when allocating ebc_cmd. > > > > > > > > Generated by: scripts/coccinelle/api/memdup.cocci > > > > > > > > Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> > > > > --- > > > > 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. > > 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
On 2023/2/2 21:35, Guenter Roeck wrote: > On 2/2/23 05:22, Heiko Carstens wrote: >> On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: >>> Use kmemdup() helper instead of open-coding to simplify >>> the code when allocating ebc_cmd. >>> >>> Generated by: scripts/coccinelle/api/memdup.cocci >>> >>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> >>> --- >>> 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. I sent the patch to all the maintainers that get by './scripts/get_maintainer.pl drivers/watchdog/diag288_wdt.c' Thanks, Yang > > Guenter > > .
On 2/2/23 18:40, Yang Yingliang wrote: > > On 2023/2/2 21:35, Guenter Roeck wrote: >> On 2/2/23 05:22, Heiko Carstens wrote: >>> On Thu, Feb 02, 2023 at 03:41:27PM +0800, Yang Yingliang wrote: >>>> Use kmemdup() helper instead of open-coding to simplify >>>> the code when allocating ebc_cmd. >>>> >>>> Generated by: scripts/coccinelle/api/memdup.cocci >>>> >>>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> >>>> --- >>>> 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. > I sent the patch to all the maintainers that get by './scripts/get_maintainer.pl drivers/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
diff --git a/drivers/watchdog/diag288_wdt.c b/drivers/watchdog/diag288_wdt.c index 6ca5d9515d85..8c2832308284 100644 --- a/drivers/watchdog/diag288_wdt.c +++ b/drivers/watchdog/diag288_wdt.c @@ -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);
Use kmemdup() helper instead of open-coding to simplify the code when allocating ebc_cmd. Generated by: scripts/coccinelle/api/memdup.cocci Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- drivers/watchdog/diag288_wdt.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)