]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bootconfig: constify xbc_calc_checksum() data parameter
authorJosh Law <objecting@objecting.org>
Wed, 18 Mar 2026 15:59:12 +0000 (15:59 +0000)
committerMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 18 Mar 2026 23:43:55 +0000 (08:43 +0900)
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>
include/linux/bootconfig.h

index 25df9260d206da38063c6343514f99b78d6b9e7e..23a96c5edcf3d5330e0f0caa6afc04fd65839e99 100644 (file)
@@ -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--)