Alexey Kardashevskiy, le Fri 17 Sep 2010 20:01:46 +1000, a écrit :
> >- Once the read is done, values need to be swapped on little-endian
> >   machines.  You could use ntohl for that.
> 
> The hwlow code is compiled on powerpc and reads device-tree on a powerpc 
> machine. If endianess does not match in this case, we have got a big 
> problem, this should not happen.

I know. But it's better to just do the right thing already, i.e. using
ntohl(), even if it indeed is a nop on powerpc.

> >static inline uint32_t *
> >of_get_int_arr(const char *p, const char *p1, int root_fd);
> >
> >Returns the array of integers.  Yes, this makes a lot of
> >allocation/deallocation, but that should be neglectible compared to the
> >system calls and will save us nasty length-bugs later.
> >   
> 
> How many integers were read by this function?

As many as available.

> What allocator was used for the returned value? Sure I can presume it
> was malloc, but still it is not a good style :)

Malloc, yes, why would that not be a good style?

> Regarding the latest patch about numa nodes numbers - do I understand 
> correctly that hwloc_cpuset_t is just a bit array which can be used 
> everywhere where we need a bit array, not just for CPUs? :-)

Yes, it should have been called "set" actually.

I'll have a closer look at your patch later.

Samuel

Reply via email to