Skip to content

Commit c815635

Browse files
jbrzozoskilemrey
authored andcommitted
subsys: profiler: Fix warning
Change fixes warning when building with CONFIG_PROFILER_SYSVIEW Signed-off-by: Justin Brzozoski <[email protected]>
1 parent ef63e69 commit c815635

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

include/profiler.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717

1818
#include <zephyr/types.h>
19+
#include <misc/util.h>
20+
#include <misc/__assert.h>
1921

2022
#ifndef CONFIG_MAX_NUMBER_OF_CUSTOM_EVENTS
2123
/** Maximum number of custom events. */

subsys/profiler/profiler_common_shell.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ static int disable_event_profiling(const struct shell *shell, size_t argc,
106106
return 0;
107107
}
108108

109-
110-
SHELL_CREATE_STATIC_SUBCMD_SET(sub_profiler)
111-
{
109+
SHELL_STATIC_SUBCMD_SET_CREATE(sub_profiler,
112110
SHELL_CMD_ARG(list, NULL, "Display list of events",
113111
display_registered_events, 0, 0),
114112
SHELL_CMD_ARG(enable, NULL, "Enable profiling of event with given ID",
@@ -118,6 +116,5 @@ SHELL_CREATE_STATIC_SUBCMD_SET(sub_profiler)
118116
disable_event_profiling, 1,
119117
sizeof(profiler_enabled_events) * 8),
120118
SHELL_SUBCMD_SET_END
121-
};
122-
119+
);
123120
SHELL_CMD_REGISTER(profiler, &sub_profiler, "Profiler commands", NULL);

subsys/profiler/profiler_sysview.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void event_module_description(void)
5757
static u32_t shorten_mem_address(const void *event_mem_address)
5858
{
5959
#ifdef CONFIG_SRAM_BASE_ADDRESS
60-
return (u32_t)(event_mem_address - CONFIG_SRAM_BASE_ADDRESS);
60+
return (u32_t)(((u8_t *)event_mem_address) - CONFIG_SRAM_BASE_ADDRESS);
6161
#else
6262
return (u32_t)event_mem_address;
6363
#endif

0 commit comments

Comments
 (0)