mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* can barebox avoid creating typedefs just for struct shortcuts?
@ 2009-12-21  9:22 Robert P. J. Day
  2009-12-21 10:04 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Robert P. J. Day @ 2009-12-21  9:22 UTC (permalink / raw)
  To: U-Boot Version 2 (barebox)


  i noticed the following:

$ grep -rw gd_t *
arch/arm/include/asm/global_data.h:typedef	struct	global_data gd_t;
arch/ppc/include/asm/global_data.h: * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t)
arch/ppc/include/asm/global_data.h:} gd_t;
arch/sandbox/include/asm/global_data.h:typedef	struct	global_data gd_t;
$

  it's obvious that the typedef "gd_t" is being created as a
time-saving shortcut.  that approach has been actively discouraged in
the main kernel tree for quite some time, as it just obfuscates the
code.  there are, of course, numerous typedefs being used to support
legitimately opaque types, but creating more of them just to save
keystrokes is now frowned upon.

  and since it looks like no one is actually using that one yet, does
anyone mind if i remove it?

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

* Re: can barebox avoid creating typedefs just for struct shortcuts?
  2009-12-21  9:22 can barebox avoid creating typedefs just for struct shortcuts? Robert P. J. Day
@ 2009-12-21 10:04 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2009-12-21 10:04 UTC (permalink / raw)
  To: Robert P. J. Day; +Cc: U-Boot Version 2 (barebox)

On Mon, Dec 21, 2009 at 04:22:43AM -0500, Robert P. J. Day wrote:
> 
>   i noticed the following:
> 
> $ grep -rw gd_t *
> arch/arm/include/asm/global_data.h:typedef	struct	global_data gd_t;
> arch/ppc/include/asm/global_data.h: * Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE > sizeof(gd_t)
> arch/ppc/include/asm/global_data.h:} gd_t;
> arch/sandbox/include/asm/global_data.h:typedef	struct	global_data gd_t;
> $
> 
>   it's obvious that the typedef "gd_t" is being created as a
> time-saving shortcut.  that approach has been actively discouraged in
> the main kernel tree for quite some time, as it just obfuscates the
> code.

Ack. I normally remove the typedefs when I find them.
In barebox we do not have global_data, so the whole file can be removed.


> there are, of course, numerous typedefs being used to support
> legitimately opaque types, but creating more of them just to save
> keystrokes is now frowned upon.
> 
>   and since it looks like no one is actually using that one yet, does
> anyone mind if i remove it?

Nope, go ahead.

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2009-12-21 10:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-12-21  9:22 can barebox avoid creating typedefs just for struct shortcuts? Robert P. J. Day
2009-12-21 10:04 ` Sascha Hauer

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