Skip to content

Commit 32af724

Browse files
DeHessnashif
authored andcommitted
coding guidelines: comply with MISRA C:2012 Rule 11.2
avoid convert pointers to incomplete type using the pointer to first item Signed-off-by: Hess Nathan <[email protected]>
1 parent 5258b52 commit 32af724

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

kernel/include/mmu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
#define Z_VIRT_RAM_END (Z_VIRT_RAM_START + Z_VIRT_RAM_SIZE)
3737

3838
/* Boot-time virtual location of the kernel image. */
39-
#define Z_KERNEL_VIRT_START ((uint8_t *)(&z_mapped_start))
40-
#define Z_KERNEL_VIRT_END ((uint8_t *)(&z_mapped_end))
39+
#define Z_KERNEL_VIRT_START ((uint8_t *)&z_mapped_start[0])
40+
#define Z_KERNEL_VIRT_END ((uint8_t *)&z_mapped_end[0])
4141
#define Z_KERNEL_VIRT_SIZE (Z_KERNEL_VIRT_END - Z_KERNEL_VIRT_START)
4242

4343
#define Z_VM_OFFSET ((CONFIG_KERNEL_VM_BASE + CONFIG_KERNEL_VM_OFFSET) - \

kernel/userspace.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,8 @@ static int app_shmem_bss_zero(void)
929929
struct z_app_region *region, *end;
930930

931931

932-
end = (struct z_app_region *)&__app_shmem_regions_end;
933-
region = (struct z_app_region *)&__app_shmem_regions_start;
932+
end = (struct z_app_region *)&__app_shmem_regions_end[0];
933+
region = (struct z_app_region *)&__app_shmem_regions_start[0];
934934

935935
for ( ; region < end; region++) {
936936
#if defined(CONFIG_DEMAND_PAGING) && !defined(CONFIG_LINKER_GENERIC_SECTIONS_PRESENT_AT_BOOT)

0 commit comments

Comments
 (0)