public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
       [not found] <1290607413.12457.44.camel@concordia>
@ 2010-11-25 13:34 ` Michael Ellerman
  2010-11-25 14:01   ` Geert Uytterhoeven
                     ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-25 13:34 UTC (permalink / raw)
  To: LKML
  Cc: linux-mips, microblaze-uclinux, devicetree-discuss,
	linuxppc-dev list, sparclinux, linux-arch

[-- Attachment #1: Type: text/plain, Size: 6771 bytes --]

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_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 dt_match_node			of_match_node
#define dt_modalias_node		of_modalias_node
#define dt_parse_phandle		of_parse_phandle
#define dt_parse_phandles_with_args	of_parse_phandles_with_args
#define dt_machine_is_compatible	of_machine_is_compatible
#define dt_attach_node			of_attach_node
#define dt_detach_node			of_detach_node
#define dt_find_property		of_find_property

/* include/linux/of_fdt.h */
#define fdt_find_string			find_flat_dt_string
#define fdt_scan			of_scan_flat_dt
#define fdt_get_prop			of_get_flat_dt_prop
#define fdt_is_compatible		of_flat_dt_is_compatible
#define fdt_get_root			of_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_root	early_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_NODE			OF_DT_END_NODE
#define FDT_PROP			OF_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_address		of_translate_address
#define dt_address_to_resource		of_address_to_resource
#define dt_iomap			of_iomap
#define dt_get_address			of_get_address
#define dt_get_pci_address		of_get_pci_address
#define dt_pci_address_to_resource	of_pci_address_to_resource

/* include/linux/of_device.h */
#define dt_match_device			of_match_device
#define dt_device_make_bus_id		of_device_make_bus_id
#define dt_driver_match_device		of_driver_match_device
#define dt_dev_get			of_dev_get
#define dt_dev_put			of_dev_put
#define dt_device_add			of_device_add
#define dt_device_register		of_device_register
#define dt_device_unregister		of_device_unregister
#define dt_device_get_modalias		of_device_get_modalias
#define dt_device_uevent		of_device_uevent
#define dt_device_node_put		of_device_node_put

/* include/linux/of_irq.h */
#define dt_irq				of_irq
#define dt_irq_parse_and_map		irq_of_parse_and_map
#define dt_irq_workarounds		of_irq_workarounds
#define dt_irq_dflt_pic			of_irq_dflt_pic
#define dt_irq_map_oldworld		of_irq_map_oldworld
#define dt_irq_map_raw			of_irq_map_raw
#define dt_irq_map_one			of_irq_map_one
#define dt_irq_create_mapping		irq_create_of_mapping
#define dt_irq_to_resource		of_irq_to_resource
#define dt_irq_count			of_irq_count
#define dt_irq_to_resource_table	of_irq_to_resource_table
#define DT_IRQ_MAX_SPEC			OF_MAX_IRQ_SPEC
#define DT_IRQ_QUIRK_OLDWORLD_MAC	OF_IMAP_OLDWORLD_MAC
#define DT_IRQ_QUIRK_NO_PHANDLE		OF_IMAP_NO_PHANDLE

/* include/linux/of_mdio.h */
#define dt_mdiobus_register		of_mdiobus_register
#define dt_phy_find_device		of_phy_find_device
#define dt_phy_connect			of_phy_connect
#define dt_phy_connect_fixed_link	of_phy_connect_fixed_link

/* include/linux/of_spi.h */
#define dt_register_spi_devices		of_register_spi_devices

/* include/linux/of_gpio.h */
#define dt_gpio_flags			of_gpio_flags
#define DT_GPIO_ACTIVE_LOW		OF_GPIO_ACTIVE_LOW
#define dt_mm_gpio_chip			of_mm_gpio_chip
#define to_dt_mm_gpio_chip		to_of_mm_gpio_chip
#define dt_get_gpio_flags		of_get_gpio_flags
#define dt_gpio_count			of_gpio_count
#define dt_mm_gpiochip_add		of_mm_gpiochip_add
#define dt_gpiochip_add			of_gpiochip_add
#define dt_gpiochip_remove		of_gpiochip_remove
#define dt_node_to_gpiochip		of_node_to_gpiochip
#define dt_get_gpio			of_get_gpio

/* include/linux/dt_i2c.h */
#define dt_i2c_register_devices		of_i2c_register_devices
#define dt_find_i2c_device_by_node	of_find_i2c_device_by_node

#endif /* __DT_H */




[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-25 13:34 ` RFC: Mega rename of device tree routines from of_*() to dt_*() Michael Ellerman
@ 2010-11-25 14:01   ` Geert Uytterhoeven
  2010-11-25 20:52     ` Benjamin Herrenschmidt
  2010-11-25 16:17   ` Grant Likely
  2010-11-29  5:55   ` David Gibson
  2 siblings, 1 reply; 17+ messages in thread
From: Geert Uytterhoeven @ 2010-11-25 14:01 UTC (permalink / raw)
  To: michael
  Cc: LKML, linux-mips, microblaze-uclinux, devicetree-discuss,
	linuxppc-dev list, sparclinux, linux-arch

On Thu, Nov 25, 2010 at 14:34, Michael Ellerman <michael@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 -- geert@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

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-25 13:34 ` RFC: Mega rename of device tree routines from of_*() to dt_*() Michael Ellerman
  2010-11-25 14:01   ` Geert Uytterhoeven
@ 2010-11-25 16:17   ` Grant Likely
  2010-11-26  3:15     ` Michael Ellerman
  2010-11-29  5:55   ` David Gibson
  2 siblings, 1 reply; 17+ messages in thread
From: Grant Likely @ 2010-11-25 16:17 UTC (permalink / raw)
  To: michael
  Cc: LKML, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, linuxppc-dev list, sparclinux,
	Stephen Neuendorffer, Andrew Morton, Linus Torvalds

On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
<michael@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 dt_match_node                   of_match_node
> #define dt_modalias_node                of_modalias_node
> #define dt_parse_phandle                of_parse_phandle
> #define dt_parse_phandles_with_args     of_parse_phandles_with_args
> #define dt_machine_is_compatible        of_machine_is_compatible
> #define dt_attach_node                  of_attach_node
> #define dt_detach_node                  of_detach_node
> #define dt_find_property                of_find_property
>
> /* include/linux/of_fdt.h */
> #define fdt_find_string                 find_flat_dt_string
> #define fdt_scan                        of_scan_flat_dt
> #define fdt_get_prop                    of_get_flat_dt_prop
> #define fdt_is_compatible               of_flat_dt_is_compatible
> #define fdt_get_root                    of_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_root        early_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_NODE                    OF_DT_END_NODE
> #define FDT_PROP                        OF_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_address            of_translate_address
> #define dt_address_to_resource          of_address_to_resource
> #define dt_iomap                        of_iomap
> #define dt_get_address                  of_get_address
> #define dt_get_pci_address              of_get_pci_address
> #define dt_pci_address_to_resource      of_pci_address_to_resource
>
> /* include/linux/of_device.h */
> #define dt_match_device                 of_match_device
> #define dt_device_make_bus_id           of_device_make_bus_id
> #define dt_driver_match_device          of_driver_match_device
> #define dt_dev_get                      of_dev_get
> #define dt_dev_put                      of_dev_put
> #define dt_device_add                   of_device_add
> #define dt_device_register              of_device_register
> #define dt_device_unregister            of_device_unregister
> #define dt_device_get_modalias          of_device_get_modalias
> #define dt_device_uevent                of_device_uevent
> #define dt_device_node_put              of_device_node_put
>
> /* include/linux/of_irq.h */
> #define dt_irq                          of_irq
> #define dt_irq_parse_and_map            irq_of_parse_and_map
> #define dt_irq_workarounds              of_irq_workarounds
> #define dt_irq_dflt_pic                 of_irq_dflt_pic
> #define dt_irq_map_oldworld             of_irq_map_oldworld
> #define dt_irq_map_raw                  of_irq_map_raw
> #define dt_irq_map_one                  of_irq_map_one
> #define dt_irq_create_mapping           irq_create_of_mapping
> #define dt_irq_to_resource              of_irq_to_resource
> #define dt_irq_count                    of_irq_count
> #define dt_irq_to_resource_table        of_irq_to_resource_table
> #define DT_IRQ_MAX_SPEC                 OF_MAX_IRQ_SPEC
> #define DT_IRQ_QUIRK_OLDWORLD_MAC       OF_IMAP_OLDWORLD_MAC
> #define DT_IRQ_QUIRK_NO_PHANDLE         OF_IMAP_NO_PHANDLE
>
> /* include/linux/of_mdio.h */
> #define dt_mdiobus_register             of_mdiobus_register
> #define dt_phy_find_device              of_phy_find_device
> #define dt_phy_connect                  of_phy_connect
> #define dt_phy_connect_fixed_link       of_phy_connect_fixed_link
>
> /* include/linux/of_spi.h */
> #define dt_register_spi_devices         of_register_spi_devices
>
> /* include/linux/of_gpio.h */
> #define dt_gpio_flags                   of_gpio_flags
> #define DT_GPIO_ACTIVE_LOW              OF_GPIO_ACTIVE_LOW
> #define dt_mm_gpio_chip                 of_mm_gpio_chip
> #define to_dt_mm_gpio_chip              to_of_mm_gpio_chip
> #define dt_get_gpio_flags               of_get_gpio_flags
> #define dt_gpio_count                   of_gpio_count
> #define dt_mm_gpiochip_add              of_mm_gpiochip_add
> #define dt_gpiochip_add                 of_gpiochip_add
> #define dt_gpiochip_remove              of_gpiochip_remove
> #define dt_node_to_gpiochip             of_node_to_gpiochip
> #define dt_get_gpio                     of_get_gpio
>
> /* include/linux/dt_i2c.h */
> #define dt_i2c_register_devices         of_i2c_register_devices
> #define dt_find_i2c_device_by_node      of_find_i2c_device_by_node
>
> #endif /* __DT_H */
>
>
>
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss
>
>



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-25 14:01   ` Geert Uytterhoeven
@ 2010-11-25 20:52     ` Benjamin Herrenschmidt
  0 siblings, 0 replies; 17+ messages in thread
From: Benjamin Herrenschmidt @ 2010-11-25 20:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: michael, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, sparclinux

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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-25 16:17   ` Grant Likely
@ 2010-11-26  3:15     ` Michael Ellerman
  2010-11-26  3:15       ` Michael Ellerman
  2010-11-26  4:42       ` Mitch Bradley
  0 siblings, 2 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-26  3:15 UTC (permalink / raw)
  To: Grant Likely
  Cc: LKML, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, linuxppc-dev list, sparclinux,
	Stephen Neuendorffer, Andrew Morton, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 4928 bytes --]

On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
> <michael@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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  3:15     ` Michael Ellerman
@ 2010-11-26  3:15       ` Michael Ellerman
  2010-11-26  4:42       ` Mitch Bradley
  1 sibling, 0 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-26  3:15 UTC (permalink / raw)
  To: Grant Likely
  Cc: LKML, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, linuxppc-dev list, sparclinux,
	Stephen Neuendorffer, Andrew Morton, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 4928 bytes --]

On Thu, 2010-11-25 at 09:17 -0700, Grant Likely wrote:
> On Thu, Nov 25, 2010 at 6:34 AM, Michael Ellerman
> <michael@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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  3:15     ` Michael Ellerman
  2010-11-26  3:15       ` Michael Ellerman
@ 2010-11-26  4:42       ` Mitch Bradley
  2010-11-26  4:42         ` Mitch Bradley
       [not found]         ` <4CEF3AB1.9060200-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
  1 sibling, 2 replies; 17+ messages in thread
From: Mitch Bradley @ 2010-11-26  4:42 UTC (permalink / raw)
  To: michael-Gsx/Oe8HsFggBc27wqDAHg
  Cc: linux-arch, linux-mips, microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, LKML,
	linuxppc-dev list, sparclinux-u79uwXL29TY76Z2rM5mHXA,
	Andrew Morton, Linus Torvalds

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
>> <michael-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>  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.  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
>
>
>
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  4:42       ` Mitch Bradley
@ 2010-11-26  4:42         ` Mitch Bradley
       [not found]         ` <4CEF3AB1.9060200-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Mitch Bradley @ 2010-11-26  4:42 UTC (permalink / raw)
  To: michael
  Cc: Grant Likely, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, sparclinux,
	Andrew Morton, Linus Torvalds

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
>> <michael@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.  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
>
>
>
>
> _______________________________________________
> devicetree-discuss mailing list
> devicetree-discuss@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
       [not found]         ` <4CEF3AB1.9060200-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
@ 2010-11-26  5:50           ` Michael Ellerman
  2010-11-26  5:50             ` Michael Ellerman
                               ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-26  5:50 UTC (permalink / raw)
  To: Mitch Bradley
  Cc: linux-arch, linux-mips, microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, LKML,
	linuxppc-dev list, sparclinux-u79uwXL29TY76Z2rM5mHXA,
	Andrew Morton, Linus Torvalds


[-- Attachment #1.1: Type: text/plain, Size: 2925 bytes --]

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
> >> <michael-Gsx/Oe8HsFggBc27wqDAHg@public.gmane.org>  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


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 192 bytes --]

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  5:50           ` Michael Ellerman
@ 2010-11-26  5:50             ` Michael Ellerman
  2010-11-26  7:15             ` Grant Likely
  2010-11-26  7:36             ` Mitch Bradley
  2 siblings, 0 replies; 17+ messages in thread
From: Michael Ellerman @ 2010-11-26  5:50 UTC (permalink / raw)
  To: Mitch Bradley
  Cc: Grant Likely, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, sparclinux,
	Andrew Morton, Linus Torvalds

[-- Attachment #1: Type: text/plain, Size: 2900 bytes --]

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
> >> <michael@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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  5:50           ` Michael Ellerman
  2010-11-26  5:50             ` Michael Ellerman
@ 2010-11-26  7:15             ` Grant Likely
  2010-11-26  7:36             ` Mitch Bradley
  2 siblings, 0 replies; 17+ messages in thread
From: Grant Likely @ 2010-11-26  7:15 UTC (permalink / raw)
  To: michael
  Cc: Mitch Bradley, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, sparclinux,
	Andrew Morton, Linus Torvalds

On Thu, Nov 25, 2010 at 10:50 PM, Michael Ellerman
<michael@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
>> >> <michael@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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  5:50           ` Michael Ellerman
  2010-11-26  5:50             ` Michael Ellerman
  2010-11-26  7:15             ` Grant Likely
@ 2010-11-26  7:36             ` Mitch Bradley
  2010-11-26  7:36               ` Mitch Bradley
  2 siblings, 1 reply; 17+ messages in thread
From: Mitch Bradley @ 2010-11-26  7:36 UTC (permalink / raw)
  To: michael-Gsx/Oe8HsFggBc27wqDAHg
  Cc: linux-arch, linux-mips, microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, LKML,
	linuxppc-dev list, sparclinux-u79uwXL29TY76Z2rM5mHXA,
	Andrew Morton, Andrea Scian, Linus Torvalds


>> 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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-26  7:36             ` Mitch Bradley
@ 2010-11-26  7:36               ` Mitch Bradley
  0 siblings, 0 replies; 17+ messages in thread
From: Mitch Bradley @ 2010-11-26  7:36 UTC (permalink / raw)
  To: michael
  Cc: Grant Likely, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, LKML, linuxppc-dev list, sparclinux,
	Andrew Morton, Linus Torvalds, Andrea Scian


>> 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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-25 13:34 ` RFC: Mega rename of device tree routines from of_*() to dt_*() Michael Ellerman
  2010-11-25 14:01   ` Geert Uytterhoeven
  2010-11-25 16:17   ` Grant Likely
@ 2010-11-29  5:55   ` David Gibson
  2010-11-29  5:55     ` David Gibson
  2010-11-29  6:07     ` Grant Likely
  2 siblings, 2 replies; 17+ messages in thread
From: David Gibson @ 2010-11-29  5:55 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: LKML, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, linuxppc-dev list, sparclinux

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-29  5:55   ` David Gibson
@ 2010-11-29  5:55     ` David Gibson
  2010-11-29  6:07     ` Grant Likely
  1 sibling, 0 replies; 17+ messages in thread
From: David Gibson @ 2010-11-29  5:55 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: LKML, linux-arch, linux-mips, microblaze-uclinux,
	devicetree-discuss, linuxppc-dev list, sparclinux

[-- Attachment #1: Type: text/plain, Size: 1532 bytes --]

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

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-29  5:55   ` David Gibson
  2010-11-29  5:55     ` David Gibson
@ 2010-11-29  6:07     ` Grant Likely
  2010-11-29  6:07       ` Grant Likely
  1 sibling, 1 reply; 17+ messages in thread
From: Grant Likely @ 2010-11-29  6:07 UTC (permalink / raw)
  To: Michael Ellerman, LKML, linux-arch, linux-mips,
	microblaze-uclinux@

On Sun, Nov 28, 2010 at 10:55 PM, David Gibson
<david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> 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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: RFC: Mega rename of device tree routines from of_*() to dt_*()
  2010-11-29  6:07     ` Grant Likely
@ 2010-11-29  6:07       ` Grant Likely
  0 siblings, 0 replies; 17+ messages in thread
From: Grant Likely @ 2010-11-29  6:07 UTC (permalink / raw)
  To: Michael Ellerman, LKML, linux-arch, linux-mips,
	microblaze-uclinux, devicetree-discuss, linuxppc-dev list,
	sparclinux

On Sun, Nov 28, 2010 at 10:55 PM, David Gibson
<david@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.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-11-29  6:07 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1290607413.12457.44.camel@concordia>
2010-11-25 13:34 ` RFC: Mega rename of device tree routines from of_*() to dt_*() Michael Ellerman
2010-11-25 14:01   ` Geert Uytterhoeven
2010-11-25 20:52     ` Benjamin Herrenschmidt
2010-11-25 16:17   ` Grant Likely
2010-11-26  3:15     ` Michael Ellerman
2010-11-26  3:15       ` Michael Ellerman
2010-11-26  4:42       ` Mitch Bradley
2010-11-26  4:42         ` Mitch Bradley
     [not found]         ` <4CEF3AB1.9060200-D5eQfiDGL7eakBO8gow8eQ@public.gmane.org>
2010-11-26  5:50           ` Michael Ellerman
2010-11-26  5:50             ` Michael Ellerman
2010-11-26  7:15             ` Grant Likely
2010-11-26  7:36             ` Mitch Bradley
2010-11-26  7:36               ` Mitch Bradley
2010-11-29  5:55   ` David Gibson
2010-11-29  5:55     ` David Gibson
2010-11-29  6:07     ` Grant Likely
2010-11-29  6:07       ` Grant Likely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox