[U-Boot] [RFC PATCH] console/device: rework function naming

Wolfgang Denk wd at denx.de
Sun May 3 20:41:10 CEST 2009


Dear Jean-Christophe PLAGNIOL-VILLARD,

In message <1241371349-2140-1-git-send-email-plagnioj at jcrosoft.com> you wrote:
> actually the console API use the following naming convention
> 
> ---Extract---
> typedef struct device_t;
> 
> int    device_register (device_t * dev);
> int    devices_init (void);
> int    device_deregister(char *devname);
> struct list_head* device_get_list(void);
> device_t* device_get_by_name(char* name);
> device_t* device_clone(device_t *dev);
> ---
> 
> which is not console dependent and is confusing
> instead of using device_XX
> 
> we now switch to console_XX and console_device_t

Please be careful. "console" is a name (or prefex) that is already
taken, and there are other (globally visible) identifiers, so con-
fusion might become a problem - see for example overwrite_console(),
console_changed(), console_buffer[], get_console_port(),
console_init_f(), env-var console_nr, consoles[], next_cons_choice(),
console_assign(), console, console_init(), console_dev,
default_serial_console, cur_console, console_chan, ... etc. etc.

Also, we have common/console.c with lots of console_* names.

Actually there is even a direct name  conflict  -  console_init()  is
already  in  use  (in board/netphone/phone_console.c), and your patch
fails to resolve this conflict.

All together: NAK.


Maybe "stdio" would be a better choice than "console" here?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Democracy is mob rule, but with income taxes.


More information about the U-Boot mailing list