Skip to contentSkip to conversation

ltp: fix an incorrect macro checking

PATCH In review [email protected] 3 participants 5 messages Nov 19, 2016 – Apr 19, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ltp: fix an incorrect macro checking

From: Jackie Huang <[email protected]>

The previous patch added a check but incorrectly
change the elif to if, then it always return 0
for cpuid if the machine is not __i386__

getcpu01 1 TFAIL : getcpu01.c:140: getcpu() returned wrong value expected cpuid:7, returned value cpuid: 0

After this fix:
getcpu01 1 TPASS : getcpu() returned proper cpuid:7, node id:0

---
 .../0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch  | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +2 -5
index d123074..41f2623 100644
@@ -88,22 +88,19 @@ index c927512..921b107 100644
  
  void cleanup(void);
  void setup(void);
-@@ -164,9 +172,14 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
+@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned *node_id,
  {
  #if defined(__i386__)
  	return syscall(318, cpu_id, node_id, cache_struct);
 -#elif __GLIBC_PREREQ(2,6)
-+#if defined(__GLIBC__)
++#elif defined(__GLIBC__)
 +#if __GLIBC_PREREQ(2,6)
 +	*cpu_id = sched_getcpu();
 +#endif
 +#else
  	*cpu_id = sched_getcpu();
  #endif
-+#endif
  	return 0;
- }
- 
 @@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)
  	cpu_set_t *set;
  	size_t size;
Signature · 1 line
2.8.3
#1 lore raw
Quoted 11 lines · On Fri, Nov 18, 2016 at 6:11 PM, <[email protected]> wrote:

From: Jackie Huang <[email protected]>

The previous patch added a check but incorrectly
change the elif to if, then it always return 0
for cpuid if the machine is not __i386__

getcpu01 1 TFAIL : getcpu01.c:140: getcpu() returned wrong value expected cpuid:7, returned value cpuid: 0

After this fix:
getcpu01 1 TPASS : getcpu() returned proper cpuid:7, node id:0

This is ok.

#2 lore raw
In reply to [email protected]

Ping.

It's not merged yet, and I don't see any rejection on it.

Thanks,
Jackie

Quoted 68 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of [email protected]
Sent: Saturday, November 19, 2016 10:11
To: [email protected]
Subject: [OE-core] [PATCH] ltp: fix an incorrect macro checking

From: Jackie Huang <[email protected]>

The previous patch added a check but incorrectly
change the elif to if, then it always return 0
for cpuid if the machine is not __i386__

getcpu01 1 TFAIL : getcpu01.c:140: getcpu() returned wrong value expected
cpuid:7, returned value cpuid: 0

After this fix:
getcpu01 1 TPASS : getcpu() returned proper cpuid:7, node id:0

---
 .../0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch  | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
(quoted diff) +0 -0

defined-before-using-it.patch b/meta/recipes-extended/ltp/ltp/0008-Check-if- __GLIBC_PREREQ-is-defined-before-using-it.patch
index d123074..41f2623 100644
--- a/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is- defined-before-using-it.patch
+++ b/meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is- defined-before-using-it.patch

meta/recipes-extended/ltp/ltp/0008-Check-if-__GLIBC_PREREQ-is-defined-before-using-it.patch +2 -5
@@ -88,22 +88,19 @@ index c927512..921b107 100644
 
  void cleanup(void);
  void setup(void);
-@@ -164,9 +172,14 @@ static inline int getcpu(unsigned *cpu_id, unsigned
 *node_id,
+@@ -164,7 +172,11 @@ static inline int getcpu(unsigned *cpu_id, unsigned
 *node_id,
  {
  #if defined(__i386__)
  	return syscall(318, cpu_id, node_id, cache_struct);
 -#elif __GLIBC_PREREQ(2,6)
-+#if defined(__GLIBC__)
++#elif defined(__GLIBC__)
 +#if __GLIBC_PREREQ(2,6)
 +	*cpu_id = sched_getcpu();
 +#endif
 +#else
  	*cpu_id = sched_getcpu();
  #endif
-+#endif
  	return 0;
- }
-
 @@ -191,15 +204,20 @@ unsigned int set_cpu_affinity(void)

cpu_set_t *set;
size_t size;
--
2.8.3

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#3 lore raw
Quoted 2 lines · Jie (Jackie)

It's not merged yet, and I don't see any rejection on it.

Slipped through the net, we're very close to M4 so this may not make it into 2.3 but if not it can be backported.

Ross

#4 lore raw

Got it, thanks!

Thanks,
Jackie

From: Burton, Ross [mailto:[email protected]]
Sent: Tuesday, April 18, 2017 18:03
To: Huang, Jie (Jackie)
Cc: [email protected]
Subject: Re: [OE-core] [PATCH] ltp: fix an incorrect macro checking

On 18 April 2017 at 10:12, Huang, Jie (Jackie) <[email protected]<mailto:[email protected]>> wrote:
It's not merged yet, and I don't see any rejection on it.

Slipped through the net, we're very close to M4 so this may not make it into 2.3 but if not it can be backported.

Ross