Re: [GIT PULL] gpio: updates for v6.6
From: Linus Torvalds
Date: Tue Aug 29 2023 - 16:30:13 EST
On Tue, 29 Aug 2023 at 04:43, Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
>
> Driver improvements:
> - use autopointers and guards from cleanup.h in gpio-sim
So I've pulled this, but I'm not entirely convinced some of this was a cleanup.
That gpio_sim_config_make_device_group() change is "interesting". Doing
return &no_free_ptr(dev)->group;
looks a bit crazy. My first reaction to it was 'that can't be right".
It _is_ right, but I'm not convinced that getting rid of one kfree()
call in the error path above it is worth that kind of semantic
complexity.
I guess we'll get more used to this - and it will look a bit less
crazy in the process - but I did want to just note that I'm not
entirely convinced we should encourage things like this.
Linus