Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Josh Law and committed by
Masami Hiramatsu (Google)
306c36a7 73a9f74b

+2 -2
+2 -2
include/linux/bootconfig.h
··· 36 36 * The checksum will be used with the BOOTCONFIG_MAGIC and the size for 37 37 * embedding the bootconfig in the initrd image. 38 38 */ 39 - static inline __init uint32_t xbc_calc_checksum(void *data, uint32_t size) 39 + static inline __init uint32_t xbc_calc_checksum(const void *data, uint32_t size) 40 40 { 41 - unsigned char *p = data; 41 + const unsigned char *p = data; 42 42 uint32_t ret = 0; 43 43 44 44 while (size--)