perf: Use ACCESS_ONCE() instead of volatile cast
PATCH 1/1 perf: Use ACCESS_ONCE() instead of volatile cast
Use ACCESS_ONCE() instead of the cast to volatile and read. This is just a style change which is reader friendly.
--- tools/perf/util/session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/session.h +1 -1
@@ -126,5 +126,5 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,extern volatile int session_done; -#define session_done () (*(volatile int *)(&session_done)) +#define session_done () ACCESS_ONCE(session_done)#endif /* __PERF_SESSION_H */
Signature · 1 line
2.1.0
Hi Pranith,
Quoted 4 lines · Pranith Kumar
Use
ACCESS_ONCE()instead of the cast to volatile and read. This is just a style change which is reader friendly.Signed-off-by Pranith Kumar <[email protected]>
Thanks,
Namhyung
Quoted 15 lines
--- tools/perf/util/session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/perf/util/session.h +1
-1@@ -126,5 +126,5 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,extern volatile int session_done; -#define session_done () (*(volatile int *)(&session_done)) +#define session_done () ACCESS_ONCE(session_done)#endif /* __PERF_SESSION_H */
Em Wed, Sep 24, 2014 at 11:31:07AM +0900, Namhyung Kim escreveu:
Quoted 9 lines
Hi Pranith,
Quoted 4 lines · Pranith Kumar
Use
ACCESS_ONCE()instead of the cast to volatile and read. This is just a style change which is reader friendly.Signed-off-by Pranith Kumar <[email protected]>Acked-by Namhyung Kim <[email protected]>
Thanks, applied.
tip-bot for Pranith Kumar
merge bot[tip:perf/core] perf tools: Use ACCESS_ONCE() instead of volatile cast
In reply to Pranith Kumarperf tools: Use ACCESS_ONCE() instead of volatile cast
Commit-ID: 1da34daf24823f19cfd56c97973334cd95635926 Gitweb: http://git.kernel.org/tip/1da34daf24823f19cfd56c97973334cd95635926 Author: Pranith Kumar <[email protected]> AuthorDate: Tue, 23 Sep 2014 10:55:08 -0400 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Fri, 26 Sep 2014 12:36:03 -0300
perf tools: Use ACCESS_ONCE() instead of volatile cast
Use ACCESS_ONCE() instead of the cast to volatile and read. This is just a style change which is reader friendly.
--- tools/perf/util/session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/session.h +1 -1
@@ -126,5 +126,5 @@ int __perf_session__set_tracepoints_handlers(struct perf_session *session,extern volatile int session_done; -#define session_done () (*(volatile int *)(&session_done)) +#define session_done () ACCESS_ONCE(session_done)#endif /* __PERF_SESSION_H */