lkml.org 
[lkml]   [2023]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 1/2] gpio: sim: fix an invalid __free() usage
On Sun, 17 Sept 2023 at 02:12, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>
> + has_line_names = true;
> + max_offset = max(line->offset, max_offset);

I really don't understand why you kept this old broken logic.

I sent a much better version of this function that didn't need that
pointless has_line_names thing or the 'max()' thing, by just making
the code a lot simpler.

Whatever.

> + line_names_size = gpio_sim_get_line_names_size(bank);
> + if (line_names_size) {
> + line_names = kcalloc(line_names_size, sizeof(*line_names),
> + GFP_KERNEL);
> + if (!line_names)
> + return ERR_PTR(-ENOMEM);
> +
> + gpio_sim_set_line_names(bank, line_names);
>
> - if (line_names)
> properties[prop_idx++] = PROPERTY_ENTRY_STRING_ARRAY_LEN(
> "gpio-line-names",
> line_names, line_names_size);
> + }

But I do like this reorganization.

Linus

\
 
 \ /
  Last update: 2023-09-17 18:48    [W:0.039 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site