[RFC] OF: make of_property_for_each_u32() use parameters if OF is not enabled

Sebastian Andrzej Siewior bigeasy at linutronix.de
Mon Jun 17 16:59:34 EST 2013


On 06/15/2013 04:00 PM, Grant Likely wrote:
>> --- a/include/linux/of.h
>> +++ b/include/linux/of.h
>> @@ -507,8 +507,8 @@ static inline int of_machine_is_compatible(const char *compat)
>>  
>>  #define of_match_ptr(_ptr)	NULL
>>  #define of_match_node(_matches, _node)	NULL
>> -#define of_property_for_each_u32(np, propname, prop, p, u) \
>> -	while (0)
>> +#define of_property_for_each_u32(np, propname, prop, p, u)	\
> 
> Unrelated whitespace change
> 
>> +	for (prop = NULL, p = NULL; 0; prop++, p++)
> 
> The prop++ and p++ bits should be dropped. It would probably be better

The ++ ensure that gcc does spit a "set but not used warning".

> to move the of_property_for_each_* macros outside the #ifdef/#else block
> and have an empty definition of of_prop_next_string/of_prop_next_u32.

so let me look at that.

> 
> g.
> 

Sebastian


More information about the devicetree-discuss mailing list