lkml.org 
[lkml]   [2012]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v3 7/9] perf header: Add check_perf_magic() func
Date
On Mon, 24 Sep 2012 23:24:09 +0800, Feng Tang wrote:
[snip]
> +/* Return 0 if matched */
> +int check_perf_magic(u64 magic)
> +{
> + if (!memcmp(&magic, __perf_magic1, sizeof(magic))
> + || magic == __perf_magic2
> + || magic == __perf_magic2_sw)
> + return 0;
> +
> + return -1;
> +}

Just an idea. How about returning version number instead of 0 so that
it can be used elsewhere those check is needed and possibly wants to
know the version number also?

Thanks,
Namhyung


\
 
 \ /
  Last update: 2012-09-25 04:21    [W:0.280 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site