diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/cmd_i2c.c | 1 | ||||
| -rw-r--r-- | common/cmd_itest.c | 2 | ||||
| -rw-r--r-- | common/cmd_mem.c | 29 | ||||
| -rw-r--r-- | common/cmd_pci.c | 2 | ||||
| -rw-r--r-- | common/cmd_portio.c | 2 | ||||
| -rw-r--r-- | common/command.c | 24 | 
6 files changed, 24 insertions, 36 deletions
| diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c index 91bf25b6b..ef3928e43 100644 --- a/common/cmd_i2c.c +++ b/common/cmd_i2c.c @@ -127,7 +127,6 @@ static uchar i2c_no_probes[] = CFG_I2C_NOPROBES;  static int  mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char *argv[]); -extern int cmd_get_data_size(char* arg, int default_size);  /*   * Syntax: diff --git a/common/cmd_itest.c b/common/cmd_itest.c index ce988723c..9e77fa913 100644 --- a/common/cmd_itest.c +++ b/common/cmd_itest.c @@ -64,8 +64,6 @@ op_tbl_t op_table [] = {  #define op_tbl_size (sizeof(op_table)/sizeof(op_table[0])) -extern int cmd_get_data_size(char* arg, int default_size); -  static long evalexp(char *s, int w)  {  	long l, *p; diff --git a/common/cmd_mem.c b/common/cmd_mem.c index d0a6ca830..672218b9c 100644 --- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -37,35 +37,6 @@  #endif  #include <watchdog.h> -#if defined(CONFIG_CMD_MEMORY)		\ -    || defined(CONFIG_CMD_I2C)		\ -    || defined(CONFIG_CMD_ITEST)	\ -    || defined(CONFIG_CMD_PCI)		\ -    || defined(CONFIG_CMD_PORTIO) - -int cmd_get_data_size(char* arg, int default_size) -{ -	/* Check for a size specification .b, .w or .l. -	 */ -	int len = strlen(arg); -	if (len > 2 && arg[len-2] == '.') { -		switch(arg[len-1]) { -		case 'b': -			return 1; -		case 'w': -			return 2; -		case 'l': -			return 4; -		case 's': -			return -2; -		default: -			return -1; -		} -	} -	return default_size; -} -#endif -  #if defined(CONFIG_CMD_MEMORY)  #ifdef	CMD_MEM_DEBUG diff --git a/common/cmd_pci.c b/common/cmd_pci.c index 89687015b..b2aa833ab 100644 --- a/common/cmd_pci.c +++ b/common/cmd_pci.c @@ -35,8 +35,6 @@  #include <asm/io.h>  #include <pci.h> -extern int cmd_get_data_size(char* arg, int default_size); -  unsigned char	ShortPCIListing = 1;  /* diff --git a/common/cmd_portio.c b/common/cmd_portio.c index a06cac016..c88fcd5e4 100644 --- a/common/cmd_portio.c +++ b/common/cmd_portio.c @@ -30,8 +30,6 @@  #include <common.h>  #include <command.h> -extern int cmd_get_data_size (char *arg, int default_size); -  /* Display values from last command.   * Memory modify remembered values are different from display memory.   */ diff --git a/common/command.c b/common/command.c index 861796d9a..aca57b26b 100644 --- a/common/command.c +++ b/common/command.c @@ -654,3 +654,27 @@ int cmd_auto_complete(const char *const prompt, char *buf, int *np, int *colp)  }  #endif + +#ifdef CMD_DATA_SIZE +int cmd_get_data_size(char* arg, int default_size) +{ +	/* Check for a size specification .b, .w or .l. +	 */ +	int len = strlen(arg); +	if (len > 2 && arg[len-2] == '.') { +		switch(arg[len-1]) { +		case 'b': +			return 1; +		case 'w': +			return 2; +		case 'l': +			return 4; +		case 's': +			return -2; +		default: +			return -1; +		} +	} +	return default_size; +} +#endif |