summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorKees Cook <kees+treewide@kernel.org>2026-09-17 14:13:10 -0700
committerSebastian Reichel <sebastian.reichel@collabora.com>2026-10-04 18:21:31 +0200
commit6415ce7204af0e282f32c5ca69953d4224ac49fb (patch)
tree4573cc8c9fe656617019ef170220443feb915bd9 /include/linux
parentf945606a8cb34c97d644ed487282f96641b05185 (diff)
power: supply: qcom_smbx: Remove const from desc allocation type
In preparation for making the devm_kmalloc family of allocators type aware, we need to make sure that the returned type from the allocation matches the type of the variable being assigned. (Before, the allocator would always return "void *", which can be implicitly cast to any pointer type.) The assigned type is "struct power_supply_desc *", but the converted allocation type would be "const struct power_supply_desc *", as the size was taken from "smb_psy_desc", which is a "static const struct power_supply_desc". As there is no general way to remove const qualifiers, take the size from the assignment target instead. No change in allocation size results. Build tested ARCH=x86_64 allmodconfig with GCC 16.2.0: drivers/power/supply/qcom_smbx.o Assisted-by: LLM coccinelle Signed-off-by: Kees Cook <kees+treewide@kernel.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Link: https://patch.msgid.link/20260917211309.i.765-kees@kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions