Skip to contentSkip to conversation

stdio: constify "name" arg in public api

PATCH New Mike Frysinger 2 participants 2 messages Oct 20, 2010 – Nov 28, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 stdio: constify "name" arg in public api

---
 common/console.c    |    4 ++--
 common/stdio.c      |    4 ++--
 include/common.h    |    2 +-
 include/iomux.h     |    2 +-
 include/stdio_dev.h |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)
common/console.c +2 -2
index 7e01886..8c650e0 100644
@@ -479,7 +479,7 @@ inline void dbg(const char *fmt, ...)
 
 /** U-Boot INIT FUNCTIONS *************************************************/
 
-struct stdio_dev *search_device(int flags, char *name)
+struct stdio_dev *search_device(int flags, const char *name)
 {
 	struct stdio_dev *dev;
 
@@ -491,7 +491,7 @@ struct stdio_dev *search_device(int flags, char *name)
 	return NULL;
 }
 
-int console_assign(int file, char *devname)
+int console_assign(int file, const char *devname)
 {
 	int flag;
 	struct stdio_dev *dev;
common/stdio.c +2 -2
index 2501369..462df24 100644
@@ -105,7 +105,7 @@ struct list_head* stdio_get_list(void)
 	return &(devs.list);
 }
 
-struct stdio_dev* stdio_get_by_name(char* name)
+struct stdio_dev* stdio_get_by_name(const char *name)
 {
 	struct list_head *pos;
 	struct stdio_dev *dev;
@@ -155,7 +155,7 @@ int stdio_register (struct stdio_dev * dev)
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
 #ifdef	CONFIG_SYS_STDIO_DEREGISTER
-int stdio_deregister(char *devname)
+int stdio_deregister(const char *devname)
 {
 	int l;
 	struct list_head *pos;
include/common.h +1 -1
index 0686a17..9acd086 100644
@@ -654,7 +654,7 @@ char *	strmhz(char *buf, long hz);
 /* common/console.c */
 int	console_init_f(void);	/* Before relocation; uses the serial  stuff	*/
 int	console_init_r(void);	/* After  relocation; uses the console stuff	*/
-int	console_assign (int file, char *devname);	/* Assign the console	*/
+int	console_assign(int file, const char *devname);	/* Assign the console	*/
 int	ctrlc (void);
 int	had_ctrlc (void);	/* have we had a Control-C since last clear? */
 void	clear_ctrlc (void);	/* clear the Control-C condition */
include/iomux.h +1 -1
index e38a81e..fcf0f93 100644
@@ -43,6 +43,6 @@ extern int cd_count[MAX_FILES];
 
 int iomux_doenv(const int, const char *);
 void iomux_printdevs(const int);
-struct stdio_dev *search_device(int, char *);
+struct stdio_dev *search_device(int, const char *);
 
 #endif /* _IO_MUX_H */
include/stdio_dev.h +2 -2
index 83da4cd..82ad463 100644
@@ -93,10 +93,10 @@ int	stdio_register (struct stdio_dev * dev);
 int	stdio_init (void);
 void	stdio_print_current_devices(void);
 #ifdef CONFIG_SYS_STDIO_DEREGISTER
-int	stdio_deregister(char *devname);
+int	stdio_deregister(const char *devname);
 #endif
 struct list_head* stdio_get_list(void);
-struct stdio_dev* stdio_get_by_name(char* name);
+struct stdio_dev* stdio_get_by_name(const char* name);
 struct stdio_dev* stdio_clone(struct stdio_dev *dev);
 
 #ifdef CONFIG_ARM_DCC_MULTI
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH 1/1 stdio: constify "name" arg in public api

Dear Mike Frysinger,

Quoted 8 lines · In message <[email protected]> you wrote:
---
 common/console.c    |    4 ++--
 common/stdio.c      |    4 ++--
 include/common.h    |    2 +-
 include/iomux.h     |    2 +-
 include/stdio_dev.h |    4 ++--
 5 files changed, 8 insertions(+), 8 deletions(-)

Applied to "next" branch, thanks.

Best regards,

Wolfgang Denk

Signature · 7 lines
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
"No one talks peace unless he's ready to back it up with war."
"He talks of peace if it is the only way to live."
	-- Colonel Green and Surak of Vulcan, "The Savage Curtain",
	   stardate 5906.5.