]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
gpio: dwapb: reduce allocation to single kzalloc
authorRosen Penev <rosenp@gmail.com>
Fri, 20 Mar 2026 00:53:38 +0000 (17:53 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Mon, 23 Mar 2026 09:55:58 +0000 (10:55 +0100)
commit9a5bf2f53b76b1619c602f9e751fe4c0e64713ca
treea4511e70adae38a5a223424c8fda038226ef47fe
parenta6e53d05ab849779d55ca985566a1da7f22435b9
gpio: dwapb: reduce allocation to single kzalloc

Instead of kzalloc + kcalloc, Combine the two using a flexible array
member.

Allows using __counted_by for extra runtime analysis. Move counting
variable to right after allocation as required by __counted_by.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/20260320005338.30355-1-rosenp@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
drivers/gpio/gpio-dwapb.c