Re: [PATCH 2/3] sparc: make driver/of/pdt no longer sparc-specific

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Grant Likely
Date: Sunday, August 8, 2010 - 10:12 pm

Hi Andres, thanks for the patch.  Comments below.

g.

On Sun, Aug 8, 2010 at 9:11 PM, Andres Salomon <dilinger@queued.net> wrote:

Group this with the select OF from earlier in the config SPARC option.


Rather than having both prom_common_{firstprop,nextprop}(), there only
needs to be one hook; prom_common_nextprop().  Make it use the
firstprop behaviour when it is passed a NULL in the prev pointer.
This will simplify the users of this code further down.


If you have to explicitly cast these function pointers, then you're
doing it wrong.  :-)  Listen to and fix the compiler complaint here.


Maybe I'm being nitpicky here, but I would pass the ops structure into
of_pdt_build_devicetree() directly.  I don't like the implied state of
setting the ops pointer separate from parsing the tree.


pr_info()


I can tell from the context here you're working from an older tree.
Please rebase onto Linus' current top-of-tree.  :-)  A bunch of OF
related patches have been merged for 2.6.36 that will conflict with
this patch.


You should still retain a one-line description of what this file is for.


Why a full copy of the structure instead of a pointer?


Use a static inline.  C code is preferred over preprocessor code.
Also preserver the namespace and use the of_pdt_ prefix (that goes for
all the new functions here in this file).


It would be nice to rationalize the differences between how sparc and
powerpc use the ->name/->path_component_name fields; but I haven't
investigated what the differences are.


For empty statics like this; I'm fine with this more concise form:

+static inline void inc_unique_id(void *p) { }
+static inline void irq_trans_init(struct device_node *dp) { }

(again, add the of_pdt_ prefix)


As mentioned earlier, this is better with a single .nextprop() hook
that behaves differently when a NULL prev pointer is passed.


As mentioned above, why is the structure copied instead of just
storing the pointer.




-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 2/3] sparc: make driver/of/pdt no longer sparc- ..., Grant Likely, (Sun Aug 8, 10:12 pm)