diff mbox

[Vivid,SRU] UBUNTU: SAUCE: Don't use atomic read in evlist.c

Message ID 1436288410-10244-1-git-send-email-chris.j.arges@canonical.com
State New
Headers show

Commit Message

Chris J Arges July 7, 2015, 5 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1410673

commit 19a64c0f56ebb33fd8a19ac65351161557846236 introduced a build error
because it references atomic_read before changes to evlist.h adding atomic_t
and proper includes files. Instead of including additional changes, use the
older way of simply using refcnt without using atomic_read.

Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
---
 tools/perf/util/evlist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luis Henriques July 7, 2015, 5:03 p.m. UTC | #1
On Tue, Jul 07, 2015 at 12:00:10PM -0500, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1410673
> 
> commit 19a64c0f56ebb33fd8a19ac65351161557846236 introduced a build error
> because it references atomic_read before changes to evlist.h adding atomic_t
> and proper includes files. Instead of including additional changes, use the
> older way of simply using refcnt without using atomic_read.
> 
> Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
> ---
>  tools/perf/util/evlist.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 5460e65..cc171f0 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -643,7 +643,7 @@ union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)
>  	/*
>  	 * Check if event was unmapped due to a POLLHUP/POLLERR.
>  	 */
> -	if (!atomic_read(&md->refcnt))
> +	if (!md->refcnt)
>  		return NULL;
>  
>  	head = perf_mmap__read_head(md);
> -- 
> 1.9.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Cheers,
--
Luís
Brad Figg July 7, 2015, 5:04 p.m. UTC | #2
On Tue, Jul 07, 2015 at 12:00:10PM -0500, Chris J Arges wrote:
> BugLink: http://bugs.launchpad.net/bugs/1410673
> 
> commit 19a64c0f56ebb33fd8a19ac65351161557846236 introduced a build error
> because it references atomic_read before changes to evlist.h adding atomic_t
> and proper includes files. Instead of including additional changes, use the
> older way of simply using refcnt without using atomic_read.
> 
> Signed-off-by: Chris J Arges <chris.j.arges@canonical.com>
> ---
>  tools/perf/util/evlist.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
> index 5460e65..cc171f0 100644
> --- a/tools/perf/util/evlist.c
> +++ b/tools/perf/util/evlist.c
> @@ -643,7 +643,7 @@ union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)
>  	/*
>  	 * Check if event was unmapped due to a POLLHUP/POLLERR.
>  	 */
> -	if (!atomic_read(&md->refcnt))
> +	if (!md->refcnt)
>  		return NULL;
>  
>  	head = perf_mmap__read_head(md);
> -- 
> 1.9.1
> 
> 
> -- 
> kernel-team mailing list
> kernel-team@lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

Looks good.
Tim Gardner July 14, 2015, 9:37 p.m. UTC | #3
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
diff mbox

Patch

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 5460e65..cc171f0 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -643,7 +643,7 @@  union perf_event *perf_evlist__mmap_read(struct perf_evlist *evlist, int idx)
 	/*
 	 * Check if event was unmapped due to a POLLHUP/POLLERR.
 	 */
-	if (!atomic_read(&md->refcnt))
+	if (!md->refcnt)
 		return NULL;
 
 	head = perf_mmap__read_head(md);