lkml.org 
[lkml]   [2023]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] gpiolib: use __counted_by() for GPIO descriptors
On Tue, Dec 19, 2023 at 01:57:06PM +0100, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
>
> Pull the array of GPIO descriptors into struct gpio_device as a flexible
> array and use __counted_by() to control its size.

How big is the struct gpio_device? Unifying like this might provoke subtle
errors on very fragmented memory, where k*alloc() might not find enough free
space. Note, k*alloc() guarantees finding only memory for a single page.
With PAGE_SIZE = 4k, this might be an issue.

I would suggest, if nothing prevents us from switching, to use kvmalloc().

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2023-12-19 16:12    [W:1.024 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site