All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
@ 2023-02-02  7:41 Yang Yingliang
  2023-02-02 13:22 ` Heiko Carstens
  0 siblings, 1 reply; 7+ messages in thread
From: Yang Yingliang @ 2023-02-02  7:41 UTC (permalink / raw)
  To: linux-watchdog; +Cc: wim, linux, hca, yangyingliang

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(-)

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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-02  7:41 [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory Yang Yingliang
@ 2023-02-02 13:22 ` Heiko Carstens
  2023-02-02 13:35   ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Heiko Carstens @ 2023-02-02 13:22 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-watchdog, wim, linux

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-02 13:22 ` Heiko Carstens
@ 2023-02-02 13:35   ` Guenter Roeck
  2023-02-02 14:06     ` Heiko Carstens
  2023-02-03  2:40     ` Yang Yingliang
  0 siblings, 2 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-02-02 13:35 UTC (permalink / raw)
  To: Heiko Carstens, Yang Yingliang; +Cc: linux-watchdog, wim

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-02 13:35   ` Guenter Roeck
@ 2023-02-02 14:06     ` Heiko Carstens
  2023-02-02 15:41       ` Guenter Roeck
  2023-02-03  2:40     ` Yang Yingliang
  1 sibling, 1 reply; 7+ messages in thread
From: Heiko Carstens @ 2023-02-02 14:06 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: Yang Yingliang, linux-watchdog, wim

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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-02 14:06     ` Heiko Carstens
@ 2023-02-02 15:41       ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-02-02 15:41 UTC (permalink / raw)
  To: Heiko Carstens; +Cc: Yang Yingliang, linux-watchdog, wim

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-02 13:35   ` Guenter Roeck
  2023-02-02 14:06     ` Heiko Carstens
@ 2023-02-03  2:40     ` Yang Yingliang
  2023-02-03  4:52       ` Guenter Roeck
  1 sibling, 1 reply; 7+ messages in thread
From: Yang Yingliang @ 2023-02-03  2:40 UTC (permalink / raw)
  To: Guenter Roeck, Heiko Carstens; +Cc: linux-watchdog, wim, yangyingliang


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
>
> .

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory
  2023-02-03  2:40     ` Yang Yingliang
@ 2023-02-03  4:52       ` Guenter Roeck
  0 siblings, 0 replies; 7+ messages in thread
From: Guenter Roeck @ 2023-02-03  4:52 UTC (permalink / raw)
  To: Yang Yingliang, Heiko Carstens; +Cc: linux-watchdog, wim

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-03  4:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02  7:41 [PATCH -next] watchdog: diag288_wdt: use kmemdup() to allocate memory Yang Yingliang
2023-02-02 13:22 ` Heiko Carstens
2023-02-02 13:35   ` Guenter Roeck
2023-02-02 14:06     ` Heiko Carstens
2023-02-02 15:41       ` Guenter Roeck
2023-02-03  2:40     ` Yang Yingliang
2023-02-03  4:52       ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.