On Tue, Mar 27, 2018 at 05:37:18PM -0700, Laura Abbott wrote:
> On 03/18/2018 07:23 AM, Lukas Wunner wrote:
> > Actually, scratch that. If ngpio is usually smallish, we can just
> > allocate reasonably sized space for mask and bits on the stack,
> > and fall back to the kcalloc slowpath only if
On Tue, Mar 27, 2018 at 05:37:18PM -0700, Laura Abbott wrote:
> On 03/18/2018 07:23 AM, Lukas Wunner wrote:
> > Actually, scratch that. If ngpio is usually smallish, we can just
> > allocate reasonably sized space for mask and bits on the stack,
> > and fall back to the kcalloc slowpath only if
On 03/18/2018 07:23 AM, Lukas Wunner wrote:
On Sat, Mar 17, 2018 at 09:25:09AM +0100, Lukas Wunner wrote:
On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
On 2018-03-10 01:10, Laura Abbott wrote:
@@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
On 03/18/2018 07:23 AM, Lukas Wunner wrote:
On Sat, Mar 17, 2018 at 09:25:09AM +0100, Lukas Wunner wrote:
On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
On 2018-03-10 01:10, Laura Abbott wrote:
@@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
On Mon, Mar 19, 2018 at 9:00 AM, Lukas Wunner wrote:
> On Sun, Mar 18, 2018 at 09:34:12PM +0100, Rasmus Villemoes wrote:
>> On 2018-03-18 15:23, Lukas Wunner wrote:
>> > Actually, scratch that. If ngpio is usually smallish, we can just
>> > allocate reasonably sized space for
On Mon, Mar 19, 2018 at 9:00 AM, Lukas Wunner wrote:
> On Sun, Mar 18, 2018 at 09:34:12PM +0100, Rasmus Villemoes wrote:
>> On 2018-03-18 15:23, Lukas Wunner wrote:
>> > Actually, scratch that. If ngpio is usually smallish, we can just
>> > allocate reasonably sized space for mask and bits on
On Sun, Mar 18, 2018 at 09:34:12PM +0100, Rasmus Villemoes wrote:
> On 2018-03-18 15:23, Lukas Wunner wrote:
> >>> Other random thoughts: maybe two allocations for each loop iteration is
> >>> a bit much. Maybe do a first pass over the array and collect the maximal
> >>> chip->ngpio, do the memory
On Sun, Mar 18, 2018 at 09:34:12PM +0100, Rasmus Villemoes wrote:
> On 2018-03-18 15:23, Lukas Wunner wrote:
> >>> Other random thoughts: maybe two allocations for each loop iteration is
> >>> a bit much. Maybe do a first pass over the array and collect the maximal
> >>> chip->ngpio, do the memory
On 2018-03-18 15:23, Lukas Wunner wrote:
>>>
>>> Other random thoughts: maybe two allocations for each loop iteration is
>>> a bit much. Maybe do a first pass over the array and collect the maximal
>>> chip->ngpio, do the memory allocation and freeing outside the loop (then
>>> you'd of course
On 2018-03-18 15:23, Lukas Wunner wrote:
>>>
>>> Other random thoughts: maybe two allocations for each loop iteration is
>>> a bit much. Maybe do a first pass over the array and collect the maximal
>>> chip->ngpio, do the memory allocation and freeing outside the loop (then
>>> you'd of course
On Sat, Mar 17, 2018 at 09:25:09AM +0100, Lukas Wunner wrote:
> On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
> > On 2018-03-10 01:10, Laura Abbott wrote:
> > > @@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
> > > can_sleep,
> > >
> > > while (i
On Sat, Mar 17, 2018 at 09:25:09AM +0100, Lukas Wunner wrote:
> On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
> > On 2018-03-10 01:10, Laura Abbott wrote:
> > > @@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
> > > can_sleep,
> > >
> > > while (i
On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
> On 2018-03-10 01:10, Laura Abbott wrote:
> > @@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
> > can_sleep,
> >
> > while (i < array_size) {
> > struct gpio_chip *chip =
On Mon, Mar 12, 2018 at 04:00:36PM +0100, Rasmus Villemoes wrote:
> On 2018-03-10 01:10, Laura Abbott wrote:
> > @@ -2887,14 +2909,30 @@ void gpiod_set_array_value_complex(bool raw, bool
> > can_sleep,
> >
> > while (i < array_size) {
> > struct gpio_chip *chip =
On 2018-03-13 00:40, Laura Abbott wrote:
> On 03/12/2018 08:00 AM, Rasmus Villemoes wrote:
>>
>> Hm, it seems you're now only clearing the first word of mask, not the
>> entire allocation. Why not just use kcalloc() instead of kmalloc_array
>> to have it automatically cleared?
>
> Bleh, I didn't
On 2018-03-13 00:40, Laura Abbott wrote:
> On 03/12/2018 08:00 AM, Rasmus Villemoes wrote:
>>
>> Hm, it seems you're now only clearing the first word of mask, not the
>> entire allocation. Why not just use kcalloc() instead of kmalloc_array
>> to have it automatically cleared?
>
> Bleh, I didn't
On 03/12/2018 08:00 AM, Rasmus Villemoes wrote:
On 2018-03-10 01:10, Laura Abbott wrote:
/* collect all inputs belonging to the same chip */
first = i;
- memset(mask, 0, sizeof(mask));
+ memset(mask, 0, sizeof(*mask));
see below
@@
On 03/12/2018 08:00 AM, Rasmus Villemoes wrote:
On 2018-03-10 01:10, Laura Abbott wrote:
/* collect all inputs belonging to the same chip */
first = i;
- memset(mask, 0, sizeof(mask));
+ memset(mask, 0, sizeof(*mask));
see below
@@
On 2018-03-10 01:10, Laura Abbott wrote:
> /* collect all inputs belonging to the same chip */
> first = i;
> - memset(mask, 0, sizeof(mask));
> + memset(mask, 0, sizeof(*mask));
see below
> @@ -2887,14 +2909,30 @@ void
On 2018-03-10 01:10, Laura Abbott wrote:
> /* collect all inputs belonging to the same chip */
> first = i;
> - memset(mask, 0, sizeof(mask));
> + memset(mask, 0, sizeof(*mask));
see below
> @@ -2887,14 +2909,30 @@ void
The new challenge is to remove VLAs from the kernel
(see https://lkml.org/lkml/2018/3/7/621)
This patch replaces several VLAs with an appropriate call to
kmalloc_array.
Signed-off-by: Laura Abbott
---
drivers/gpio/gpiolib.c | 55
The new challenge is to remove VLAs from the kernel
(see https://lkml.org/lkml/2018/3/7/621)
This patch replaces several VLAs with an appropriate call to
kmalloc_array.
Signed-off-by: Laura Abbott
---
drivers/gpio/gpiolib.c | 55 +++---
1 file
22 matches
Mail list logo