Skip to content

Commit

Permalink
include/cpu: Move __nomcount attribute
Browse files Browse the repository at this point in the history
When compiling under clang we get the following warning:

include/cpu.h:156:15: warning: 'no_instrument_function' attribute only applies to functions [-Wignored-attributes]
extern struct __nomcount cpu_thread *find_cpu_by_pir_nomcount(u32 pir);
              ^
include/compiler.h:27:36: note: expanded from macro '__nomcount'
                                               ^
This seems to be due to the attribute being applied to the function's
return type rather than to the function itself, so move __nomcount to
along the line so it's not part of the return type.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
  • Loading branch information
oohal committed Nov 14, 2019
1 parent 0b8f5ea commit 2899bda
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/cpu.c
Expand Up @@ -739,7 +739,7 @@ struct cpu_thread *find_cpu_by_pir(u32 pir)
return &cpu_stacks[pir].cpu;
}

struct __nomcount cpu_thread *find_cpu_by_pir_nomcount(u32 pir)
struct cpu_thread __nomcount *find_cpu_by_pir_nomcount(u32 pir)
{
if (pir > cpu_max_pir)
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion include/cpu.h
Expand Up @@ -153,7 +153,7 @@ extern struct cpu_thread *find_cpu_by_server(u32 server_no);
extern struct cpu_thread *find_cpu_by_pir(u32 pir);

/* Used for lock internals to avoid re-entrancy */
extern struct __nomcount cpu_thread *find_cpu_by_pir_nomcount(u32 pir);
extern struct cpu_thread __nomcount *find_cpu_by_pir_nomcount(u32 pir);

extern struct dt_node *get_cpu_node(u32 pir);

Expand Down

0 comments on commit 2899bda

Please sign in to comment.