Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-28 Thread Joe Perches
On Sun, 2016-08-28 at 11:28 +0200, Julia Lawall wrote: > I do think that there is some value in doing similar things in a uniform > way, using meaningful names, even if in a particular case it doesn't help > performance or reduce code size.  Even duplicating code could be OK if it > is not in a cr

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-28 Thread Julia Lawall
On Sat, 27 Aug 2016, Joe Perches wrote: > On Sat, 2016-08-27 at 09:02 +0200, SF Markus Elfring wrote: > > > If you _really wanted to clear up this code and make it more > > > robust/better, it'd probably be nicer to convert the > > > struct list_head **sn_irq_lh to a single struct list_head * >

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-27 Thread Joe Perches
On Sat, 2016-08-27 at 09:02 +0200, SF Markus Elfring wrote: > > If you _really wanted to clear up this code and make it more > > robust/better, it'd probably be nicer to convert the > > struct list_head **sn_irq_lh to a single struct list_head * > > That would be less data space overall given the a

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-27 Thread walter harms
Am 26.08.2016 20:02, schrieb SF Markus Elfring: > From: Markus Elfring > Date: Fri, 26 Aug 2016 18:32:53 +0200 > > * A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "kmallo

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-27 Thread SF Markus Elfring
>>> @@ -474,12 +474,12 @@ void __init sn_irq_lh_init(void) >>> { >>>int i; >>> >>> - sn_irq_lh = kmalloc(sizeof(struct list_head *) * NR_IRQS, GFP_KERNEL); >>> + sn_irq_lh = kmalloc_array(NR_IRQS, sizeof(*sn_irq_lh), GFP_KERNEL); >>>if (!sn_irq_lh) >>>panic

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-26 Thread Joe Perches
On Fri, 2016-08-26 at 15:57 -0400, Julia Lawall wrote: > On Fri, 26 Aug 2016, SF Markus Elfring wrote: > > From: Markus Elfring > > Date: Fri, 26 Aug 2016 18:32:53 +0200 > > > > * A multiplication for the size determination of a memory allocation > >   indicated that an array data structure should

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-26 Thread kbuild test robot
Hi Markus, [auto build test ERROR on ia64/next] [also build test ERROR on v4.8-rc3] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] [Suggest to use git(>=2.9.0) format-patch --base= (or --base=auto for convenience) to record what (public, well-k

Re: [PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-26 Thread Julia Lawall
On Fri, 26 Aug 2016, SF Markus Elfring wrote: > From: Markus Elfring > Date: Fri, 26 Aug 2016 18:32:53 +0200 > > * A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "kmalloc_

[PATCH 1/5] IA64-IRQ: Use kmalloc_array() in sn_irq_lh_init()

2016-08-26 Thread SF Markus Elfring
From: Markus Elfring Date: Fri, 26 Aug 2016 18:32:53 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kmalloc_array". This issue was detected by using the Coccinelle s