Commit f953e929 authored by Abramo Bagnara's avatar Abramo Bagnara Committed by Anas Nashif
Browse files

coding guidelines: partially comply with MISRA C:2012 Rule 11.8



In particular:

- modified parameter types to receive a const pointer when a
  non-const pointer is not needed

- avoided redundant casts

- used cast to const pointer when a non-const pointer is not needed

Signed-off-by: default avatarAbramo Bagnara <abramo.bagnara@bugseng.com>
parent 829f63f9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ int arch_mem_domain_max_partitions_get(void)
/*
 * Validate the given buffer is user accessible or not
 */
int arch_buffer_validate(void *addr, size_t size, bool write)
int arch_buffer_validate(const void *addr, size_t size, bool write)
{
	return arc_core_mpu_buffer_validate(addr, size, write);
}
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ int arc_core_mpu_get_max_domain_partition_regions(void)
/**
 * @brief validate the given buffer is user accessible or not
 */
int arc_core_mpu_buffer_validate(void *addr, size_t size, bool write)
int arc_core_mpu_buffer_validate(const void *addr, size_t size, bool write)
{
	/*
	 * For ARC MPU, smaller region number takes priority.
+1 −1
Original line number Diff line number Diff line
@@ -779,7 +779,7 @@ int arc_core_mpu_get_max_domain_partition_regions(void)
/**
 * @brief validate the given buffer is user accessible or not
 */
int arc_core_mpu_buffer_validate(void *addr, size_t size, bool write)
int arc_core_mpu_buffer_validate(const void *addr, size_t size, bool write)
{
	int r_index;
	int key = arch_irq_lock();
+1 −1
Original line number Diff line number Diff line
@@ -324,7 +324,7 @@ int arch_mem_domain_max_partitions_get(void)
	return ARM_CORE_MPU_MAX_DOMAIN_PARTITIONS_GET(available_regions);
}

int arch_buffer_validate(void *addr, size_t size, bool write)
int arch_buffer_validate(const void *addr, size_t size, bool write)
{
	return arm_core_mpu_buffer_validate(addr, size, write);
}
+1 −1
Original line number Diff line number Diff line
@@ -261,7 +261,7 @@ int arm_core_mpu_get_max_available_dyn_regions(void);
 *       spans multiple enabled MPU regions (even if these regions all
 *       permit user access).
 */
int arm_core_mpu_buffer_validate(void *addr, size_t size, bool write);
int arm_core_mpu_buffer_validate(const void *addr, size_t size, bool write);

#endif /* CONFIG_ARM_MPU */

Loading