Skip to contentSkip to conversation

string_to_VLAN: constify "var" arg

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 string_to_VLAN: constify "var" arg

---
 include/net.h |    2 +-
 net/net.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
include/net.h +1 -1
index dd673f0..5e3495b 100644
@@ -520,7 +520,7 @@ extern IPaddr_t string_to_ip(char *s);
 extern void	VLAN_to_string (ushort x, char *s);
 
 /* Convert a string to a vlan id */
-extern ushort string_to_VLAN(char *s);
+extern ushort string_to_VLAN(const char *s);
 
 /* read a VLAN id from an environment variable */
 extern ushort getenv_VLAN(char *);
net/net.c +1 -1
index 7576419..a609632 100644
@@ -1913,7 +1913,7 @@ void VLAN_to_string(ushort x, char *s)
 		sprintf(s, "%d", x & VLAN_IDMASK);
 }
 
-ushort string_to_VLAN(char *s)
+ushort string_to_VLAN(const char *s)
 {
 	ushort id;
 
Signature · 1 line
1.7.3.1
#1 lore raw

PATCH 1/1 string_to_VLAN: constify "var" arg

Dear Mike Frysinger,

Quoted 5 lines · In message <[email protected]> you wrote:
---
 include/net.h |    2 +-
 net/net.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Applied to "next" branch, thanks.

Best regards,

Wolfgang Denk

Signature · 8 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
If a person (a) is poorly, (b) receives treatment  intended  to  make
him  better, and (c) gets better, then no power of reasoning known to
medical science can convince him  that  it  may  not  have  been  the
treatment that restored his health.
- Sir Peter Medawar, The Art of the Soluble