Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Fri, Nov 26, 2010 at 12:34:35AM +1100, Michael Ellerman wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. So here's a first cut of a patch to add the new names. I've not touched of_platform because that is supposed to go away. That will lead to some odd looking code in the interim, but I think is the right approach. Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'm a little uneasy about using the same prefix as libfdt (fdt_foo()) for routines that have a different implementation and different names / semantics to the libfdt routines. -- David Gibson| I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson signature.asc Description: Digital signature ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Sun, Nov 28, 2010 at 10:55 PM, David Gibson da...@gibson.dropbear.id.au wrote: On Fri, Nov 26, 2010 at 12:34:35AM +1100, Michael Ellerman wrote: Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'm a little uneasy about using the same prefix as libfdt (fdt_foo()) for routines that have a different implementation and different names / semantics to the libfdt routines. I'd also be okay with either dtflat_ or flatdt_ for the prefix on these routines. g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. So here's a first cut of a patch to add the new names. I've not touched of_platform because that is supposed to go away. That will lead to some odd looking code in the interim, but I think is the right approach. Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'd be inclined to drop early_init from them too, because they're basically all about early init, but Grant said he'd prefer not to I think. I've also renamed the flat tree tag constants to match libfdt. I've left for_each_child_of_node(), because I read it as of, but maybe it's OF? cheers #ifndef __DT_H #define __DT_H /* include/linux/device.h */ #define dt_match_table of_match_table #define dt_node of_node /* include/linux/mod_devicetable.h */ #define dt_device_idof_device_id /* include/linux/of.h */ #define dt_node_to_nid of_node_to_nid #define dt_chosen of_chosen #define dt_node_is_root of_node_is_root #define dt_node_check_flag of_node_check_flag #define dt_node_set_flagof_node_set_flag #define dt_find_all_nodes of_find_all_nodes #define dt_node_get of_node_get #define dt_node_put of_node_put #define dt_read_number of_read_number #define dt_read_ulong of_read_ulong #define dt_find_node_by_nameof_find_node_by_name #define dt_find_node_by_typeof_find_node_by_type #define dt_find_compatible_node of_find_compatible_node #define dt_find_matching_node of_find_matching_node #define dt_find_node_by_pathof_find_node_by_path #define dt_find_node_by_phandle of_find_node_by_phandle #define dt_get_parent of_get_parent #define dt_get_next_parent of_get_next_parent #define dt_get_next_child of_get_next_child #define dt_find_node_with_property of_find_node_with_property #define dt_device_is_compatible of_device_is_compatible #define dt_device_is_available of_device_is_available #define dt_get_property of_get_property #define dt_n_addr_cells of_n_addr_cells #define dt_n_size_cells of_n_size_cells #define dt_match_node of_match_node #define dt_modalias_nodeof_modalias_node #define dt_parse_phandleof_parse_phandle #define dt_parse_phandles_with_args of_parse_phandles_with_args #define dt_machine_is_compatibleof_machine_is_compatible #define dt_attach_node of_attach_node #define dt_detach_node of_detach_node #define dt_find_propertyof_find_property /* include/linux/of_fdt.h */ #define fdt_find_string find_flat_dt_string #define fdt_scanof_scan_flat_dt #define fdt_get_propof_get_flat_dt_prop #define fdt_is_compatible of_flat_dt_is_compatible #define fdt_get_rootof_get_flat_dt_root #define fdt_early_init_scan_chosen early_init_dt_scan_chosen #define fdt_early_init_check_for_initrd early_init_dt_check_for_initrd #define fdt_early_init_scan_memory early_init_dt_scan_memory #define fdt_early_init_add_memory_arch early_init_dt_add_memory_arch #define fdt_early_init_alloc_memory_arch early_init_dt_alloc_memory_arch #define fdt_early_init_setup_initrd_arch early_init_dt_setup_initrd_arch #define fdt_early_init_scan_rootearly_init_dt_scan_root #define fdt_unflatten unflatten_device_tree #define fdt_early_init early_init_devtree #define FDT_MAGIC OF_DT_HEADER #define FDT_BEGIN_NODE OF_DT_BEGIN_NODE #define FDT_END_NODEOF_DT_END_NODE #define FDT_PROPOF_DT_PROP #define FDT_NOP OF_DT_NOP #define FDT_END OF_DT_END #define FDT_VERSION OF_DT_VERSION /* include/linux/of_address.h */ #define dt_translate_addressof_translate_address #define dt_address_to_resource of_address_to_resource #define dt_iomap
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, Nov 25, 2010 at 14:34, Michael Ellerman mich...@ellerman.id.au wrote: I've left for_each_child_of_node(), because I read it as of, but maybe it's OF? I always read it as for each child-OF-node, so I would rename it to dt_for_each_child_node. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. I assume you'll be also publishing the script that you use for generating the massive patch. I expect that there will be a few iterations of running the rename script to convert over all the stragglers. It should also be negotiated with Linus about when this patch should get applied. I do NOT want to cause massive merge pain during the merge window. Andrew/Linus: Before Michael proceeds too far with this rename, are you okay with a mass rename of the device tree functions from of_* to dt_*? Nobody likes the ambiguous 'of_' prefix (of? of what?), but to fix it means large cross-tree patches and potential merge conflicts. So here's a first cut of a patch to add the new names. I've not touched of_platform because that is supposed to go away. That will lead to some odd looking code in the interim, but I think is the right approach. I would split it up into separate dt*.h files, one for each of*.h file so that the #include lines can be changed in the C code at the same time. Each dt*.h file would include it's of*.h counterpart. Then after the code is renamed, and a release or two has passed to catch the majority of users, the old definitions can be moved into the dt*.h files. However, it may be better to move and rename the definitions immediately, and leave #define of_* dt_* macros in the old of*.h files which can be removed with a simple patch after all the users are converted. That would have a smaller impact in the cleanup stage. Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'd be inclined to drop early_init from them too, because they're basically all about early init, but Grant said he'd prefer not to I think. I've also renamed the flat tree tag constants to match libfdt. It is all about early init now in Linus' tree, but Stephen Neuendorffer has patches that use the fdt code at driver probe time for parsing device tree fragments that describe an FPGA add-in board. I've left for_each_child_of_node(), because I read it as of, but maybe it's OF? hahaha! I never considered that it might be OF, but now I probably won't be able to help but read it that way! I like Geert's suggestion of dt_for_each_child_node g. cheers #ifndef __DT_H #define __DT_H /* include/linux/device.h */ #define dt_match_table of_match_table #define dt_node of_node This could be very messy. I've nervous about using #define to rename structure members. You'll need to check that any structure members that use the same name as a global symbol are handled appropriately. /* include/linux/mod_devicetable.h */ #define dt_device_id of_device_id /* include/linux/of.h */ #define dt_node_to_nid of_node_to_nid #define dt_chosen of_chosen #define dt_node_is_root of_node_is_root #define dt_node_check_flag of_node_check_flag #define dt_node_set_flag of_node_set_flag #define dt_find_all_nodes of_find_all_nodes #define dt_node_get of_node_get #define dt_node_put of_node_put #define dt_read_number of_read_number #define dt_read_ulong of_read_ulong #define dt_find_node_by_name of_find_node_by_name #define dt_find_node_by_type of_find_node_by_type #define dt_find_compatible_node of_find_compatible_node #define dt_find_matching_node of_find_matching_node #define dt_find_node_by_path of_find_node_by_path #define dt_find_node_by_phandle of_find_node_by_phandle #define dt_get_parent of_get_parent #define dt_get_next_parent of_get_next_parent #define dt_get_next_child of_get_next_child #define dt_find_node_with_property of_find_node_with_property #define dt_device_is_compatible of_device_is_compatible #define dt_device_is_available of_device_is_available #define dt_get_property of_get_property #define dt_n_addr_cells of_n_addr_cells #define dt_n_size_cells of_n_size_cells #define
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, 2010-11-25 at 15:01 +0100, Geert Uytterhoeven wrote: I always read it as for each child-OF-node, so I would rename it to dt_for_each_child_node. Well, it was meant to be for_child_of_node not _OF_node :-) Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote: On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. I assume you'll be also publishing the script that you use for generating the massive patch. I expect that there will be a few iterations of running the rename script to convert over all the stragglers. Yep sure, I'll just make it less crap first. It should also be negotiated with Linus about when this patch should get applied. I do NOT want to cause massive merge pain during the merge window. Obviously. Andrew/Linus: Before Michael proceeds too far with this rename, are you okay with a mass rename of the device tree functions from of_* to dt_*? Nobody likes the ambiguous 'of_' prefix (of? of what?), but to fix it means large cross-tree patches and potential merge conflicts. It'd also be good to hear from DaveM, sparc is the platform with the strongest link to real OF AFAIK, so the of_() names make more sense there. So here's a first cut of a patch to add the new names. I've not touched of_platform because that is supposed to go away. That will lead to some odd looking code in the interim, but I think is the right approach. I would split it up into separate dt*.h files, one for each of*.h file so that the #include lines can be changed in the C code at the same time. Each dt*.h file would include it's of*.h counterpart. Then after the code is renamed, and a release or two has passed to catch the majority of users, the old definitions can be moved into the dt*.h files. Yep that sounds like a plan. I did it as a single header for starters so I could autogenerate the rename script easily. However, it may be better to move and rename the definitions immediately, and leave #define of_* dt_* macros in the old of*.h files which can be removed with a simple patch after all the users are converted. That would have a smaller impact in the cleanup stage. True, though a bigger impact to start with. I did that originally but decided it might be better to start with the minimal patch to add the new names. That way Linus might accept it this release, meaning we'd have the new names in place for code in -next. Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'd be inclined to drop early_init from them too, because they're basically all about early init, but Grant said he'd prefer not to I think. I've also renamed the flat tree tag constants to match libfdt. It is all about early init now in Linus' tree, but Stephen Neuendorffer has patches that use the fdt code at driver probe time for parsing device tree fragments that describe an FPGA add-in board. OK fair enough. I've left for_each_child_of_node(), because I read it as of, but maybe it's OF? hahaha! I never considered that it might be OF, but now I probably won't be able to help but read it that way! I like Geert's suggestion of dt_for_each_child_node OK, I like it the way it is, but if the consensus is to change it then we can. There's a bunch actually: for_each_node_by_name(dn, name) \ for_each_node_by_type(dn, type) \ for_each_compatible_node(dn, type, compatible) \ for_each_matching_node(dn, matches) \ for_each_child_of_node(parent, child) \ for_each_node_with_property(dn, prop_name) \ So either dt_for_each_blah(), or for_each_dt_node_blah() ? /* include/linux/device.h */ #define dt_match_table of_match_table #define dt_node of_node This could be very messy. I've nervous about using #define to rename structure members. You'll need to check that any structure members that use the same name as a global symbol are handled appropriately. I'm not sure what you mean about global symbols. I think it's fairly safe, in that direction, ie. defining the dt_* names. Neither of those strings appears anywhere in the tree at the moment (as a token). cheers signature.asc Description: This is a digitally signed message part ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On 11/25/2010 5:15 PM, Michael Ellerman wrote: On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote: On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. I assume you'll be also publishing the script that you use for generating the massive patch. I expect that there will be a few iterations of running the rename script to convert over all the stragglers. Yep sure, I'll just make it less crap first. It should also be negotiated with Linus about when this patch should get applied. I do NOT want to cause massive merge pain during the merge window. Obviously. Andrew/Linus: Before Michael proceeds too far with this rename, are you okay with a mass rename of the device tree functions from of_* to dt_*? Nobody likes the ambiguous 'of_' prefix (of? of what?), but to fix it means large cross-tree patches and potential merge conflicts. It'd also be good to hear from DaveM, sparc is the platform with the strongest link to real OF AFAIK, so the of_() names make more sense there. One Laptop Per Child ships real Open Firmware on its x86 Linux systems, of which approximately 2 million have been shipped or ordered. An ARM version, also with OFW, is in the works. From the standpoint of number of units in the field actually running Linux, I expect that compares favorably with SPARC. That said, I don't particularly like the abbreviation of either; I abbreviate Open Firmware as OFW. I don't mind using dt_ to apply to device tree things; I think it's clearer than of_. Ideally, it would be nice to acknowledge the historical connection in some way, but confusing nomenclature probably is not the way to go about it. So here's a first cut of a patch to add the new names. I've not touched of_platform because that is supposed to go away. That will lead to some odd looking code in the interim, but I think is the right approach. I would split it up into separate dt*.h files, one for each of*.h file so that the #include lines can be changed in the C code at the same time. Each dt*.h file would include it's of*.h counterpart. Then after the code is renamed, and a release or two has passed to catch the majority of users, the old definitions can be moved into the dt*.h files. Yep that sounds like a plan. I did it as a single header for starters so I could autogenerate the rename script easily. However, it may be better to move and rename the definitions immediately, and leave #define of_* dt_* macros in the old of*.h files which can be removed with a simple patch after all the users are converted. That would have a smaller impact in the cleanup stage. True, though a bigger impact to start with. I did that originally but decided it might be better to start with the minimal patch to add the new names. That way Linus might accept it this release, meaning we'd have the new names in place for code in -next. Most of these are straight renames, but some have changed more substantially. The routines for the flat tree have all become fdt_foo(). I'd be inclined to drop early_init from them too, because they're basically all about early init, but Grant said he'd prefer not to I think. I've also renamed the flat tree tag constants to match libfdt. It is all about early init now in Linus' tree, but Stephen Neuendorffer has patches that use the fdt code at driver probe time for parsing device tree fragments that describe an FPGA add-in board. OK fair enough. I've left for_each_child_of_node(), because I read it as of, but maybe it's OF? hahaha! I never considered that it might be OF, but now I probably won't be able to help but read it that way! I like Geert's suggestion of dt_for_each_child_node OK, I like it the way it is, but if the consensus is to change it then we can. There's a bunch actually: for_each_node_by_name(dn, name) \ for_each_node_by_type(dn, type) \ for_each_compatible_node(dn, type, compatible) \ for_each_matching_node(dn, matches) \ for_each_child_of_node(parent, child) \ for_each_node_with_property(dn, prop_name) \ So either dt_for_each_blah(), or for_each_dt_node_blah() ? /* include/linux/device.h */ #define dt_match_table of_match_table #define dt_node of_node This could be very messy. I've nervous about using #define to rename structure members.
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, 2010-11-25 at 18:42 -1000, Mitch Bradley wrote: On 11/25/2010 5:15 PM, Michael Ellerman wrote: On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote: On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. I assume you'll be also publishing the script that you use for generating the massive patch. I expect that there will be a few iterations of running the rename script to convert over all the stragglers. Yep sure, I'll just make it less crap first. It should also be negotiated with Linus about when this patch should get applied. I do NOT want to cause massive merge pain during the merge window. Obviously. Andrew/Linus: Before Michael proceeds too far with this rename, are you okay with a mass rename of the device tree functions from of_* to dt_*? Nobody likes the ambiguous 'of_' prefix (of? of what?), but to fix it means large cross-tree patches and potential merge conflicts. It'd also be good to hear from DaveM, sparc is the platform with the strongest link to real OF AFAIK, so the of_() names make more sense there. One Laptop Per Child ships real Open Firmware on its x86 Linux systems, of which approximately 2 million have been shipped or ordered. An ARM version, also with OFW, is in the works. OK. I don't see any code under arch/x86 or arch/arm that uses of_() routines though? Or is it under drivers or something? That said, I don't particularly like the abbreviation of either; I abbreviate Open Firmware as OFW. I don't mind using dt_ to apply to device tree things; I think it's clearer than of_. Ideally, it would be nice to acknowledge the historical connection in some way, but confusing nomenclature probably is not the way to go about it. Cool. I think there will still be a few things that have OF in the name, at least for a while, and I'm sure the doco will still mention OF, so I don't think the connection will be lost. cheers signature.asc Description: This is a digitally signed message part ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, Nov 25, 2010 at 10:50 PM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 18:42 -1000, Mitch Bradley wrote: On 11/25/2010 5:15 PM, Michael Ellerman wrote: On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote: On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman mich...@ellerman.id.au wrote: On Thu, 2010-11-25 at 01:03 +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. ... The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. ... So I'm hoping people with either say YES this is a great idea, or NO this is stupid. I'm still hoping, but so far it seems most people have got better things to do, and of those that do have an opinion the balance is slightly positive. I assume you'll be also publishing the script that you use for generating the massive patch. I expect that there will be a few iterations of running the rename script to convert over all the stragglers. Yep sure, I'll just make it less crap first. It should also be negotiated with Linus about when this patch should get applied. I do NOT want to cause massive merge pain during the merge window. Obviously. Andrew/Linus: Before Michael proceeds too far with this rename, are you okay with a mass rename of the device tree functions from of_* to dt_*? Nobody likes the ambiguous 'of_' prefix (of? of what?), but to fix it means large cross-tree patches and potential merge conflicts. It'd also be good to hear from DaveM, sparc is the platform with the strongest link to real OF AFAIK, so the of_() names make more sense there. One Laptop Per Child ships real Open Firmware on its x86 Linux systems, of which approximately 2 million have been shipped or ordered. An ARM version, also with OFW, is in the works. OK. I don't see any code under arch/x86 or arch/arm that uses of_() routines though? Or is it under drivers or something? That said, I don't particularly like the abbreviation of either; I abbreviate Open Firmware as OFW. I don't mind using dt_ to apply to device tree things; I think it's clearer than of_. Ideally, it would be nice to acknowledge the historical connection in some way, but confusing nomenclature probably is not the way to go about it. Yes, I like the ofw_ prefix too, and briefly considered renaming to that, but decide that dt_ was better due to the number of systems using the device tree without real openfirmware. However, the ofw_ prefix would make sense if any of the promtree code is renamed. Cool. I think there will still be a few things that have OF in the name, at least for a while, and I'm sure the doco will still mention OF, so I don't think the connection will be lost. Considering that pretty much all the documentation makes some reference back to the openfirmware origins, I'm pretty sure the ofw legacy is safe. :-) g. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
One Laptop Per Child ships real Open Firmware on its x86 Linux systems, of which approximately 2 million have been shipped or ordered. An ARM version, also with OFW, is in the works. OK. I don't see any code under arch/x86 or arch/arm that uses of_() routines though? Or is it under drivers or something? Andres Salomon has been working for some time to get some Open Firmware support for x86 upstream. As you can probably imagine, it has been slow going, but seems to be getting close. The OLPC ARM work is just beginning, so nothing has been submitted yet. The first hardware prototypes are still being debugged. Lennert Buytenhek is the key OS person who will be involved. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RFC: Mega rename of device tree routines from of_*() to dt_*()
Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. I was procrastinating at the time and said I'd have a look at it, so here I am. The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. Personally I'm a bit ambivalent about it, the OF name is a bit wrong so it would be nice to get rid of, but it's a lot of churn. So I'm hoping people with either say YES this is a great idea, or NO this is stupid. As step one I've just renamed as many routines as I could find to see what the resulting patch looks like, so we can quantify the churn. I also did device.of_node, which is used quite a bit. Thoughts? of - dt most places I could think of (done mechanically): Documentation/powerpc/booting-without-of.txt |2 +- arch/microblaze/include/asm/cpuinfo.h |2 +- arch/microblaze/include/asm/prom.h | 12 +- arch/microblaze/kernel/cpu/cpuinfo.c |2 +- arch/microblaze/kernel/head.S |2 +- arch/microblaze/kernel/heartbeat.c |6 +- arch/microblaze/kernel/intc.c |8 +- arch/microblaze/kernel/irq.c |6 +- arch/microblaze/kernel/prom.c | 38 ++-- arch/microblaze/kernel/prom_parse.c| 28 ++-- arch/microblaze/kernel/reset.c | 12 +- arch/microblaze/kernel/setup.c |6 +- arch/microblaze/kernel/timer.c | 10 +- arch/microblaze/pci/pci-common.c | 26 ++-- arch/microblaze/pci/pci_32.c | 34 ++-- arch/microblaze/pci/xilinx_pci.c | 14 +- arch/microblaze/platform/platform.c|6 +- arch/mips/kernel/prom.c| 32 ++-- arch/powerpc/boot/of.c |2 +- arch/powerpc/boot/ofconsole.c |2 +- arch/powerpc/boot/oflib.c |2 +- arch/powerpc/include/asm/cpm.h |2 +- arch/powerpc/include/asm/ibmebus.h |4 +- arch/powerpc/include/asm/irq.h |8 +- arch/powerpc/include/asm/kvm_para.h|6 +- arch/powerpc/include/asm/macio.h |6 +- arch/powerpc/include/asm/msi_bitmap.h |6 +- arch/powerpc/include/asm/parport.h |6 +- arch/powerpc/include/asm/pmac_feature.h|2 +- arch/powerpc/include/asm/prom.h| 16 +- arch/powerpc/kernel/btext.c| 28 ++-- arch/powerpc/kernel/cacheinfo.c| 20 +- arch/powerpc/kernel/dma-swiotlb.c |2 +- arch/powerpc/kernel/ibmebus.c | 38 ++-- arch/powerpc/kernel/irq.c | 22 +- arch/powerpc/kernel/isa-bridge.c | 14 +- arch/powerpc/kernel/kvm.c |6 +- arch/powerpc/kernel/legacy_serial.c| 104 +- arch/powerpc/kernel/lparcfg.c | 24 +- arch/powerpc/kernel/machine_kexec.c| 12 +- arch/powerpc/kernel/machine_kexec_64.c | 16 +- arch/powerpc/kernel/of_platform.c | 24 +- arch/powerpc/kernel/pci-common.c | 24 +- arch/powerpc/kernel/pci_32.c | 34 ++-- arch/powerpc/kernel/pci_64.c |6 +- arch/powerpc/kernel/pci_dn.c |6 +- arch/powerpc/kernel/pci_of_scan.c | 22 +- arch/powerpc/kernel/proc_powerpc.c |2 +- arch/powerpc/kernel/prom.c | 92 +- arch/powerpc/kernel/prom_parse.c | 28 ++-- arch/powerpc/kernel/rtas-proc.c|6 +- arch/powerpc/kernel/rtas.c | 34 ++-- arch/powerpc/kernel/rtas_pci.c | 22 +- arch/powerpc/kernel/setup-common.c | 58 +++--- arch/powerpc/kernel/setup_32.c |4 +- arch/powerpc/kernel/setup_64.c | 24 +- arch/powerpc/kernel/smp.c | 14 +- arch/powerpc/kernel/time.c |8 +- arch/powerpc/kernel/vio.c | 80 arch/powerpc/mm/hash_native_64.c |6 +- arch/powerpc/mm/hash_utils_64.c| 26 ++-- arch/powerpc/mm/numa.c | 62 +++--- arch/powerpc/platforms/40x/ep405.c | 16 +- arch/powerpc/platforms/40x/hcu4.c | 10 +- arch/powerpc/platforms/40x/ppc40x_simple.c | 10 +-
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Wed, Nov 24, 2010 at 8:03 AM, Michael Ellerman mich...@ellerman.id.au wrote: Personally I'm a bit ambivalent about it, the OF name is a bit wrong so it would be nice to get rid of, but it's a lot of churn. So I'm hoping people with either say YES this is a great idea, or NO this is stupid. Well, my vote is no. I wouldn't call it stupid, but I do think it's a bad idea. In general, I don't like renaming functions, because it causes complications with merges and porting code across kernel versions. It also forces me to re-remember things. And especially in this case, the churn is too great. You're affecting files across multiple subsystems and architectures. -- Timur Tabi Linux kernel developer at Freescale ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On 11/24/2010 06:03 AM, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. I was procrastinating at the time and said I'd have a look at it, so here I am. The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. Personally I'm a bit ambivalent about it, the OF name is a bit wrong so it would be nice to get rid of, but it's a lot of churn. So I'm hoping people with either say YES this is a great idea, or NO this is stupid. As step one I've just renamed as many routines as I could find to see what the resulting patch looks like, so we can quantify the churn. I also did device.of_node, which is used quite a bit. Thoughts? of - dt most places I could think of (done mechanically): [...] drivers/of/address.c | 114 ++-- drivers/of/base.c | 14 +- drivers/of/device.c| 36 ++-- drivers/of/fdt.c |4 +- drivers/of/gpio.c | 32 ++-- drivers/of/irq.c |4 +- drivers/of/of_i2c.c| 18 +- drivers/of/of_mdio.c | 16 +- drivers/of/of_spi.c| 12 +- drivers/of/pdt.c |4 +- drivers/of/platform.c | 212 ++-- Well, not that I care one way or the other, but for consistency you should change all these directory and file names as well. David Daney ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
On Thu, Nov 25, 2010 at 01:03:33AM +1100, Michael Ellerman wrote: Hi all, There were some murmurings on IRC last week about renaming the of_*() routines. I was procrastinating at the time and said I'd have a look at it, so here I am. The thinking is that on many platforms that use the of_() routines OpenFirmware is not involved at all, this is true even on many powerpc platforms. Also for folks who don't know the OpenFirmware connection it reads as of, as in a can of worms. Personally I'm a bit ambivalent about it, the OF name is a bit wrong so it would be nice to get rid of, but it's a lot of churn. So I'm hoping people with either say YES this is a great idea, or NO this is stupid. As step one I've just renamed as many routines as I could find to see what the resulting patch looks like, so we can quantify the churn. I also did device.of_node, which is used quite a bit. Thoughts? I'm looking at it the other way. There are inconsistencies in naming of symbols and files we definitely should clean up. Since we're doing that, let's take the opportunity to move from of* to dt*. With multiple architectures adding device tree support, this is about the last chance to do this without impacting too many people. -- David VL ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev