]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
platform/x86: dell-wmi-sysman: Clean up security buffer helpers
authorThorsten Blum <thorsten.blum@linux.dev>
Tue, 31 Mar 2026 16:03:11 +0000 (18:03 +0200)
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 7 Apr 2026 14:22:42 +0000 (17:22 +0300)
commit2d5821579d39621fcce1b3d19ea25a2a9cf59cd9
treee007b73ce9aa6790ac195af38777cfbfef52a4e4
parent955165c3e537668b9a5a6eb26397281b88143002
platform/x86: dell-wmi-sysman: Clean up security buffer helpers

In calculate_security_buffer(), call strlen() once and use ALIGN() to
round up to an even size.

In populate_security_buffer(), also avoid recomputing strlen(), rename
the u32 pointer from 'seclen' to 'seclenp' to avoid confusion with the
new length variable, and drop the memcpy() guard since calling it with
size 0 is a no-op and therefore safe.

Use 'const char *' for the read-only source string in both helpers.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260331160310.608857-3-thorsten.blum@linux.dev
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
drivers/platform/x86/dell/dell-wmi-sysman/dell-wmi-sysman.h
drivers/platform/x86/dell/dell-wmi-sysman/sysman.c