summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJosh Law <objecting@objecting.org>2026-03-18 15:59:12 +0000
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>2026-03-19 08:43:55 +0900
commit306c36a76da2d6d2b5e91db925d41a9a8d77dbfd (patch)
tree5c8fdf97b5680ac33aab25234b273f8e7f2bf499 /include
parent73a9f74b86c6b88d1b6aec82adea56074ef2a9b9 (diff)
bootconfig: constify xbc_calc_checksum() data parameter
xbc_calc_checksum() only reads the data buffer, so mark the parameter as const void * and the internal pointer as const unsigned char *. Link: https://lore.kernel.org/all/20260318155919.78168-7-objecting@objecting.org/ Signed-off-by: Josh Law <objecting@objecting.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/bootconfig.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/bootconfig.h b/include/linux/bootconfig.h
index 25df9260d206..23a96c5edcf3 100644
--- a/include/linux/bootconfig.h
+++ b/include/linux/bootconfig.h
@@ -36,9 +36,9 @@ bool __init cmdline_has_extra_options(void);
* The checksum will be used with the BOOTCONFIG_MAGIC and the size for
* embedding the bootconfig in the initrd image.
*/
-static inline __init uint32_t xbc_calc_checksum(void *data, uint32_t size)
+static inline __init uint32_t xbc_calc_checksum(const void *data, uint32_t size)
{
- unsigned char *p = data;
+ const unsigned char *p = data;
uint32_t ret = 0;
while (size--)