Re: [PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-14 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 14, 2013 at 02:05:52PM +0300, Adrian Hunter escreveu:
> On 14/08/13 07:32, David Ahern wrote:
> > Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
> > with compiler version:
> > Signed-off-by: David Ahern 
> > Cc: Adrian Hunter 
> > Cc: Jiri Olsa 
> 
> Acked-by: Adrian Hunter 

Applied
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-14 Thread Adrian Hunter
On 14/08/13 07:32, David Ahern wrote:
> Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
> with compiler version:
> $ gcc --version
> gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
> 
> Failure message is:
> 
> tests/code-reading.c: In function ‘do_sort_something’:
> tests/code-reading.c:305:13: error: stack protector not protecting local 
> variables: variable length buffer [-Werror=stack-protector]
> cc1: all warnings being treated as errors
> make: *** [/tmp/junk/tests/code-reading.o] Error 1
> make: *** Waiting for unfinished jobs
> 
> v2: as Adrian noticed changed sizeof to ARRAY_SIZE
> 
> Signed-off-by: David Ahern 
> Cc: Adrian Hunter 
> Cc: Jiri Olsa 

Acked-by: Adrian Hunter 


> ---
>  tools/perf/tests/code-reading.c |   11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
> index eec1421..df9afd9 100644
> --- a/tools/perf/tests/code-reading.c
> +++ b/tools/perf/tests/code-reading.c
> @@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
>  
>  static void do_sort_something(void)
>  {
> - size_t sz = 40960;
> - int buf[sz], i;
> + int buf[40960], i;
>  
> - for (i = 0; i < (int)sz; i++)
> - buf[i] = sz - i - 1;
> + for (i = 0; i < (int)ARRAY_SIZE(buf); i++)
> + buf[i] = ARRAY_SIZE(buf) - i - 1;
>  
> - qsort(buf, sz, sizeof(int), comp);
> + qsort(buf, ARRAY_SIZE(buf), sizeof(int), comp);
>  
> - for (i = 0; i < (int)sz; i++) {
> + for (i = 0; i < (int)ARRAY_SIZE(buf); i++) {
>   if (buf[i] != i) {
>   pr_debug("qsort failed\n");
>   break;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-14 Thread Adrian Hunter
On 14/08/13 07:32, David Ahern wrote:
 Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
 with compiler version:
 $ gcc --version
 gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
 
 Failure message is:
 
 tests/code-reading.c: In function ‘do_sort_something’:
 tests/code-reading.c:305:13: error: stack protector not protecting local 
 variables: variable length buffer [-Werror=stack-protector]
 cc1: all warnings being treated as errors
 make: *** [/tmp/junk/tests/code-reading.o] Error 1
 make: *** Waiting for unfinished jobs
 
 v2: as Adrian noticed changed sizeof to ARRAY_SIZE
 
 Signed-off-by: David Ahern dsah...@gmail.com
 Cc: Adrian Hunter adrian.hun...@intel.com
 Cc: Jiri Olsa jo...@redhat.com

Acked-by: Adrian Hunter adrian.hun...@intel.com


 ---
  tools/perf/tests/code-reading.c |   11 +--
  1 file changed, 5 insertions(+), 6 deletions(-)
 
 diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
 index eec1421..df9afd9 100644
 --- a/tools/perf/tests/code-reading.c
 +++ b/tools/perf/tests/code-reading.c
 @@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
  
  static void do_sort_something(void)
  {
 - size_t sz = 40960;
 - int buf[sz], i;
 + int buf[40960], i;
  
 - for (i = 0; i  (int)sz; i++)
 - buf[i] = sz - i - 1;
 + for (i = 0; i  (int)ARRAY_SIZE(buf); i++)
 + buf[i] = ARRAY_SIZE(buf) - i - 1;
  
 - qsort(buf, sz, sizeof(int), comp);
 + qsort(buf, ARRAY_SIZE(buf), sizeof(int), comp);
  
 - for (i = 0; i  (int)sz; i++) {
 + for (i = 0; i  (int)ARRAY_SIZE(buf); i++) {
   if (buf[i] != i) {
   pr_debug(qsort failed\n);
   break;
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-14 Thread Arnaldo Carvalho de Melo
Em Wed, Aug 14, 2013 at 02:05:52PM +0300, Adrian Hunter escreveu:
 On 14/08/13 07:32, David Ahern wrote:
  Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
  with compiler version:
  Signed-off-by: David Ahern dsah...@gmail.com
  Cc: Adrian Hunter adrian.hun...@intel.com
  Cc: Jiri Olsa jo...@redhat.com
 
 Acked-by: Adrian Hunter adrian.hun...@intel.com

Applied
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-13 Thread David Ahern
Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

v2: as Adrian noticed changed sizeof to ARRAY_SIZE

Signed-off-by: David Ahern 
Cc: Adrian Hunter 
Cc: Jiri Olsa 
---
 tools/perf/tests/code-reading.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index eec1421..df9afd9 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
 
 static void do_sort_something(void)
 {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;
 
-   for (i = 0; i < (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i < (int)ARRAY_SIZE(buf); i++)
+   buf[i] = ARRAY_SIZE(buf) - i - 1;
 
-   qsort(buf, sz, sizeof(int), comp);
+   qsort(buf, ARRAY_SIZE(buf), sizeof(int), comp);
 
-   for (i = 0; i < (int)sz; i++) {
+   for (i = 0; i < (int)ARRAY_SIZE(buf); i++) {
if (buf[i] != i) {
pr_debug("qsort failed\n");
break;
-- 
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] perf tests: Fix compile failure on do_sort_something - v2

2013-08-13 Thread David Ahern
Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

v2: as Adrian noticed changed sizeof to ARRAY_SIZE

Signed-off-by: David Ahern dsah...@gmail.com
Cc: Adrian Hunter adrian.hun...@intel.com
Cc: Jiri Olsa jo...@redhat.com
---
 tools/perf/tests/code-reading.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index eec1421..df9afd9 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
 
 static void do_sort_something(void)
 {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;
 
-   for (i = 0; i  (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i  (int)ARRAY_SIZE(buf); i++)
+   buf[i] = ARRAY_SIZE(buf) - i - 1;
 
-   qsort(buf, sz, sizeof(int), comp);
+   qsort(buf, ARRAY_SIZE(buf), sizeof(int), comp);
 
-   for (i = 0; i  (int)sz; i++) {
+   for (i = 0; i  (int)ARRAY_SIZE(buf); i++) {
if (buf[i] != i) {
pr_debug(qsort failed\n);
break;
-- 
1.7.10.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-08 Thread David Ahern

On 8/8/13 1:58 AM, Adrian Hunter wrote:

On 08/08/13 00:59, David Ahern wrote:

Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

Signed-off-by: David Ahern 
Cc: Adrian Hunter 
Cc: Jiri Olsa 
---
  tools/perf/tests/code-reading.c |   11 +--
  1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8e0943b..4bde8be 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)

  static void do_sort_something(void)
  {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;

-   for (i = 0; i < (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i < (int)sizeof(buf); i++)



Should that be ARRAY_SIZE not sizeof


oops, yes it should.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-08 Thread David Ahern

On 8/8/13 1:58 AM, Adrian Hunter wrote:

On 08/08/13 00:59, David Ahern wrote:

Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

Signed-off-by: David Ahern dsah...@gmail.com
Cc: Adrian Hunter adrian.hun...@intel.com
Cc: Jiri Olsa jo...@redhat.com
---
  tools/perf/tests/code-reading.c |   11 +--
  1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8e0943b..4bde8be 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)

  static void do_sort_something(void)
  {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;

-   for (i = 0; i  (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i  (int)sizeof(buf); i++)



Should that be ARRAY_SIZE not sizeof


oops, yes it should.

David
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-07 Thread Adrian Hunter
On 08/08/13 00:59, David Ahern wrote:
> Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
> with compiler version:
> $ gcc --version
> gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
> 
> Failure message is:
> 
> tests/code-reading.c: In function ‘do_sort_something’:
> tests/code-reading.c:305:13: error: stack protector not protecting local 
> variables: variable length buffer [-Werror=stack-protector]
> cc1: all warnings being treated as errors
> make: *** [/tmp/junk/tests/code-reading.o] Error 1
> make: *** Waiting for unfinished jobs
> 
> Signed-off-by: David Ahern 
> Cc: Adrian Hunter 
> Cc: Jiri Olsa 
> ---
>  tools/perf/tests/code-reading.c |   11 +--
>  1 file changed, 5 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
> index 8e0943b..4bde8be 100644
> --- a/tools/perf/tests/code-reading.c
> +++ b/tools/perf/tests/code-reading.c
> @@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
>  
>  static void do_sort_something(void)
>  {
> - size_t sz = 40960;
> - int buf[sz], i;
> + int buf[40960], i;
>  
> - for (i = 0; i < (int)sz; i++)
> - buf[i] = sz - i - 1;
> + for (i = 0; i < (int)sizeof(buf); i++)


Should that be ARRAY_SIZE not sizeof


> + buf[i] = sizeof(buf) - i - 1;
>  
> - qsort(buf, sz, sizeof(int), comp);
> + qsort(buf, sizeof(buf), sizeof(int), comp);
>  
> - for (i = 0; i < (int)sz; i++) {
> + for (i = 0; i < (int)sizeof(buf); i++) {
>   if (buf[i] != i) {
>   pr_debug("qsort failed\n");
>   break;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-07 Thread David Ahern
Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

Signed-off-by: David Ahern 
Cc: Adrian Hunter 
Cc: Jiri Olsa 
---
 tools/perf/tests/code-reading.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8e0943b..4bde8be 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
 
 static void do_sort_something(void)
 {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;
 
-   for (i = 0; i < (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i < (int)sizeof(buf); i++)
+   buf[i] = sizeof(buf) - i - 1;
 
-   qsort(buf, sz, sizeof(int), comp);
+   qsort(buf, sizeof(buf), sizeof(int), comp);
 
-   for (i = 0; i < (int)sz; i++) {
+   for (i = 0; i < (int)sizeof(buf); i++) {
if (buf[i] != i) {
pr_debug("qsort failed\n");
break;
-- 
1.7.10.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-07 Thread David Ahern
Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
with compiler version:
$ gcc --version
gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)

Failure message is:

tests/code-reading.c: In function ‘do_sort_something’:
tests/code-reading.c:305:13: error: stack protector not protecting local 
variables: variable length buffer [-Werror=stack-protector]
cc1: all warnings being treated as errors
make: *** [/tmp/junk/tests/code-reading.o] Error 1
make: *** Waiting for unfinished jobs

Signed-off-by: David Ahern dsah...@gmail.com
Cc: Adrian Hunter adrian.hun...@intel.com
Cc: Jiri Olsa jo...@redhat.com
---
 tools/perf/tests/code-reading.c |   11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
index 8e0943b..4bde8be 100644
--- a/tools/perf/tests/code-reading.c
+++ b/tools/perf/tests/code-reading.c
@@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
 
 static void do_sort_something(void)
 {
-   size_t sz = 40960;
-   int buf[sz], i;
+   int buf[40960], i;
 
-   for (i = 0; i  (int)sz; i++)
-   buf[i] = sz - i - 1;
+   for (i = 0; i  (int)sizeof(buf); i++)
+   buf[i] = sizeof(buf) - i - 1;
 
-   qsort(buf, sz, sizeof(int), comp);
+   qsort(buf, sizeof(buf), sizeof(int), comp);
 
-   for (i = 0; i  (int)sz; i++) {
+   for (i = 0; i  (int)sizeof(buf); i++) {
if (buf[i] != i) {
pr_debug(qsort failed\n);
break;
-- 
1.7.10.1

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] perf tests: Fix compile failure on do_sort_something

2013-08-07 Thread Adrian Hunter
On 08/08/13 00:59, David Ahern wrote:
 Commit b55ae0a9 added code-reading.c which fails to compile on Fedora 16
 with compiler version:
 $ gcc --version
 gcc (GCC) 4.6.3 20120306 (Red Hat 4.6.3-2)
 
 Failure message is:
 
 tests/code-reading.c: In function ‘do_sort_something’:
 tests/code-reading.c:305:13: error: stack protector not protecting local 
 variables: variable length buffer [-Werror=stack-protector]
 cc1: all warnings being treated as errors
 make: *** [/tmp/junk/tests/code-reading.o] Error 1
 make: *** Waiting for unfinished jobs
 
 Signed-off-by: David Ahern dsah...@gmail.com
 Cc: Adrian Hunter adrian.hun...@intel.com
 Cc: Jiri Olsa jo...@redhat.com
 ---
  tools/perf/tests/code-reading.c |   11 +--
  1 file changed, 5 insertions(+), 6 deletions(-)
 
 diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-reading.c
 index 8e0943b..4bde8be 100644
 --- a/tools/perf/tests/code-reading.c
 +++ b/tools/perf/tests/code-reading.c
 @@ -304,15 +304,14 @@ static int comp(const void *a, const void *b)
  
  static void do_sort_something(void)
  {
 - size_t sz = 40960;
 - int buf[sz], i;
 + int buf[40960], i;
  
 - for (i = 0; i  (int)sz; i++)
 - buf[i] = sz - i - 1;
 + for (i = 0; i  (int)sizeof(buf); i++)


Should that be ARRAY_SIZE not sizeof


 + buf[i] = sizeof(buf) - i - 1;
  
 - qsort(buf, sz, sizeof(int), comp);
 + qsort(buf, sizeof(buf), sizeof(int), comp);
  
 - for (i = 0; i  (int)sz; i++) {
 + for (i = 0; i  (int)sizeof(buf); i++) {
   if (buf[i] != i) {
   pr_debug(qsort failed\n);
   break;
 

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/