common/misc: sparse fixes
command.c:44:38: error: bad constant expression dlmalloc.c:1468:2: warning: Using plain integer as NULL pointer dlmalloc.c:1468:5: warning: Using plain integer as NULL pointer dlmalloc.c:2176:12: warning: Using plain integer as NULL pointer dlmalloc.c:2179:31: warning: Using plain integer as NULL pointer dlmalloc.c:2382:14: warning: Using plain integer as NULL pointer dlmalloc.c:2436:14: warning: Using plain integer as NULL pointer dlmalloc.c:2582:31: warning: Using plain integer as NULL pointer dlmalloc.c:2585:17: warning: Using plain integer as NULL pointer dlmalloc.c:2646:14: warning: Using plain integer as NULL pointer dlmalloc.c:2659:19: warning: Using plain integer as NULL pointer dlmalloc.c:2692:19: warning: Using plain integer as NULL pointer dlmalloc.c:2707:19: warning: Using plain integer as NULL pointer dlmalloc.c:2708:14: warning: Using plain integer as NULL pointer dlmalloc.c:2786:31: warning: Using plain integer as NULL pointer dlmalloc.c:2801:12: warning: Using plain integer as NULL pointer dlmalloc.c:2801:22: warning: Using plain integer as NULL pointer dlmalloc.c:2926:27: warning: Using plain integer as NULL pointer dlmalloc.c:2928:14: warning: Using plain integer as NULL pointer dlmalloc.c:2929:12: warning: Using plain integer as NULL pointer dlmalloc.c:3075:14: warning: Using plain integer as NULL pointer hush.c:292:14: warning: symbol 'last_return_code' was not declared. Should it be static? hush.c:293:5: warning: symbol 'nesting_level' was not declared. Should it be static? hush.c:2175:20: warning: Using plain integer as NULL pointer hush.c:2175:34: warning: Using plain integer as NULL pointer hush.c:2210:41: warning: Using plain integer as NULL pointer hush.c:2216:45: warning: Using plain integer as NULL pointer hush.c:2249:25: warning: Using plain integer as NULL pointer hush.c:2332:13: warning: symbol 'new_pipe' was not declared. Should it be static? hush.c:2390:5: warning: symbol 'reserved_word' was not declared. Should it be static? hush.c:2927:5: warning: symbol 'parse_stream' was not declared. Should it be static? hush.c:3127:6: warning: symbol 'mapset' was not declared. Should it be static? hush.c:3133:6: warning: symbol 'update_ifs_map' was not declared. Should it be static? hush.c:3161:5: warning: symbol 'parse_stream_outer' was not declared. Should it be static? hush.c:3295:34: warning: Using plain integer as NULL pointer hush.c:3631:5: warning: symbol 'do_showvar' was not declared. Should it be static image.c:1282:29: warning: Using plain integer as NULL pointer image.c:1315:41: warning: Using plain integer as NULL pointer image.c:1330:25: warning: Using plain integer as NULL pointer image.c:1706:25: warning: Using plain integer as NULL pointer main.c:510:10: warning: symbol 'hist_num' was not declared. Should it be static? main.c:512:5: warning: symbol 'hist_list' was not declared. Should it be static? main.c:513:6: warning: symbol 'hist_lines' was not declared. Should it be static? usb_storage.c:195:6: warning: symbol 'usb_show_progress' was not declared. Should it be static? usb_storage.c:440:48: warning: Using plain integer as NULL pointer usb_storage.c:503:5: warning: symbol 'usb_stor_BBB_comdat' was not declared. Should it be static? usb_storage.c:551:5: warning: symbol 'usb_stor_CB_comdat' was not declared. Should it be static? usb_storage.c:629:55: warning: Using plain integer as NULL pointer usb_storage.c:620:5: warning: symbol 'usb_stor_CBI_get_status' was not declared. Should it be static? usb_storage.c:675:43: warning: Using plain integer as NULL pointer usb_storage.c:668:5: warning: symbol 'usb_stor_BBB_clear_endpt_stall' was not declared. Should it be static? usb_storage.c:679:5: warning: symbol 'usb_stor_BBB_transport' was not declared. Should it be static? usb_storage.c:801:5: warning: symbol 'usb_stor_CB_transport' was not declared. Sh xyzModem.c:104:1: warning: symbol 'CYGACC_COMM_IF_GETC_TIMEOUT' was not declared. Should it be static? xyzModem.c:122:1: warning: symbol 'CYGACC_COMM_IF_PUTC' was not declared. Should it be static? xyzModem.c:169:1: warning: symbol 'parse_num' was not declared. Should it be stat note: hush.c's nesting_level deleted because not used. Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
This commit is contained in:
		
							parent
							
								
									088f1b1991
								
							
						
					
					
						commit
						199adb601f
					
				|  | @ -40,8 +40,15 @@ int _do_help (cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t * cmdtp, int | ||||||
| 	int i; | 	int i; | ||||||
| 	int rcode = 0; | 	int rcode = 0; | ||||||
| 
 | 
 | ||||||
|  | 	if (cmd_items > CONFIG_SYS_MAXARGS) { | ||||||
|  | 		printf("%s: cmd_items %d exceeds hardcoded limit %d." | ||||||
|  | 		       " Recompile with higher CONFIG_SYS_MAXARGS?\n", | ||||||
|  | 		       __func__, cmd_items, CONFIG_SYS_MAXARGS); | ||||||
|  | 		return -1; | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	if (argc == 1) {	/*show list of commands */ | 	if (argc == 1) {	/*show list of commands */ | ||||||
| 		cmd_tbl_t *cmd_array[cmd_items]; | 		cmd_tbl_t *cmd_array[CONFIG_SYS_MAXARGS]; | ||||||
| 		int i, j, swaps; | 		int i, j, swaps; | ||||||
| 
 | 
 | ||||||
| 		/* Make array of commands from .uboot_cmd section */ | 		/* Make array of commands from .uboot_cmd section */ | ||||||
|  |  | ||||||
|  | @ -1465,7 +1465,7 @@ typedef struct malloc_chunk* mbinptr; | ||||||
| #define IAV(i)  bin_at(i), bin_at(i) | #define IAV(i)  bin_at(i), bin_at(i) | ||||||
| 
 | 
 | ||||||
| static mbinptr av_[NAV * 2 + 2] = { | static mbinptr av_[NAV * 2 + 2] = { | ||||||
|  0, 0, |  NULL, NULL, | ||||||
|  IAV(0),   IAV(1),   IAV(2),   IAV(3),   IAV(4),   IAV(5),   IAV(6),   IAV(7), |  IAV(0),   IAV(1),   IAV(2),   IAV(3),   IAV(4),   IAV(5),   IAV(6),   IAV(7), | ||||||
|  IAV(8),   IAV(9),   IAV(10),  IAV(11),  IAV(12),  IAV(13),  IAV(14),  IAV(15), |  IAV(8),   IAV(9),   IAV(10),  IAV(11),  IAV(12),  IAV(13),  IAV(14),  IAV(15), | ||||||
|  IAV(16),  IAV(17),  IAV(18),  IAV(19),  IAV(20),  IAV(21),  IAV(22),  IAV(23), |  IAV(16),  IAV(17),  IAV(18),  IAV(19),  IAV(20),  IAV(21),  IAV(22),  IAV(23), | ||||||
|  | @ -2173,10 +2173,10 @@ Void_t* mALLOc(bytes) size_t bytes; | ||||||
|   /* check if mem_malloc_init() was run */ |   /* check if mem_malloc_init() was run */ | ||||||
|   if ((mem_malloc_start == 0) && (mem_malloc_end == 0)) { |   if ((mem_malloc_start == 0) && (mem_malloc_end == 0)) { | ||||||
|     /* not initialized yet */ |     /* not initialized yet */ | ||||||
|     return 0; |     return NULL; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   if ((long)bytes < 0) return 0; |   if ((long)bytes < 0) return NULL; | ||||||
| 
 | 
 | ||||||
|   nb = request2size(bytes);  /* padded request size; */ |   nb = request2size(bytes);  /* padded request size; */ | ||||||
| 
 | 
 | ||||||
|  | @ -2379,7 +2379,7 @@ Void_t* mALLOc(bytes) size_t bytes; | ||||||
|     /* Try to extend */ |     /* Try to extend */ | ||||||
|     malloc_extend_top(nb); |     malloc_extend_top(nb); | ||||||
|     if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE) |     if ( (remainder_size = chunksize(top) - nb) < (long)MINSIZE) | ||||||
|       return 0; /* propagate failure */ |       return NULL; /* propagate failure */ | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   victim = top; |   victim = top; | ||||||
|  | @ -2433,7 +2433,7 @@ void fREe(mem) Void_t* mem; | ||||||
|   mchunkptr fwd;       /* misc temp for linking */ |   mchunkptr fwd;       /* misc temp for linking */ | ||||||
|   int       islr;      /* track whether merging with last_remainder */ |   int       islr;      /* track whether merging with last_remainder */ | ||||||
| 
 | 
 | ||||||
|   if (mem == 0)                              /* free(0) has no effect */ |   if (mem == NULL)                              /* free(0) has no effect */ | ||||||
|     return; |     return; | ||||||
| 
 | 
 | ||||||
|   p = mem2chunk(mem); |   p = mem2chunk(mem); | ||||||
|  | @ -2579,10 +2579,10 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes; | ||||||
|   if (bytes == 0) { fREe(oldmem); return 0; } |   if (bytes == 0) { fREe(oldmem); return 0; } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
|   if ((long)bytes < 0) return 0; |   if ((long)bytes < 0) return NULL; | ||||||
| 
 | 
 | ||||||
|   /* realloc of null is supposed to be same as malloc */ |   /* realloc of null is supposed to be same as malloc */ | ||||||
|   if (oldmem == 0) return mALLOc(bytes); |   if (oldmem == NULL) return mALLOc(bytes); | ||||||
| 
 | 
 | ||||||
|   newp    = oldp    = mem2chunk(oldmem); |   newp    = oldp    = mem2chunk(oldmem); | ||||||
|   newsize = oldsize = chunksize(oldp); |   newsize = oldsize = chunksize(oldp); | ||||||
|  | @ -2643,7 +2643,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes; | ||||||
|     } |     } | ||||||
|     else |     else | ||||||
|     { |     { | ||||||
|       next = 0; |       next = NULL; | ||||||
|       nextsize = 0; |       nextsize = 0; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | @ -2656,7 +2656,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes; | ||||||
| 
 | 
 | ||||||
|       /* try forward + backward first to save a later consolidation */ |       /* try forward + backward first to save a later consolidation */ | ||||||
| 
 | 
 | ||||||
|       if (next != 0) |       if (next != NULL) | ||||||
|       { |       { | ||||||
| 	/* into top */ | 	/* into top */ | ||||||
| 	if (next == top) | 	if (next == top) | ||||||
|  | @ -2689,7 +2689,7 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes; | ||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       /* backward only */ |       /* backward only */ | ||||||
|       if (prev != 0 && (long)(prevsize + newsize) >= (long)nb) |       if (prev != NULL && (long)(prevsize + newsize) >= (long)nb) | ||||||
|       { |       { | ||||||
| 	unlink(prev, bck, fwd); | 	unlink(prev, bck, fwd); | ||||||
| 	newp = prev; | 	newp = prev; | ||||||
|  | @ -2704,8 +2704,8 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes; | ||||||
| 
 | 
 | ||||||
|     newmem = mALLOc (bytes); |     newmem = mALLOc (bytes); | ||||||
| 
 | 
 | ||||||
|     if (newmem == 0)  /* propagate failure */ |     if (newmem == NULL)  /* propagate failure */ | ||||||
|       return 0; |       return NULL; | ||||||
| 
 | 
 | ||||||
|     /* Avoid copy if newp is next chunk after oldp. */ |     /* Avoid copy if newp is next chunk after oldp. */ | ||||||
|     /* (This can only happen when new chunk is sbrk'ed.) */ |     /* (This can only happen when new chunk is sbrk'ed.) */ | ||||||
|  | @ -2783,7 +2783,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes; | ||||||
|   mchunkptr remainder;        /* spare room at end to split off */ |   mchunkptr remainder;        /* spare room at end to split off */ | ||||||
|   long      remainder_size;   /* its size */ |   long      remainder_size;   /* its size */ | ||||||
| 
 | 
 | ||||||
|   if ((long)bytes < 0) return 0; |   if ((long)bytes < 0) return NULL; | ||||||
| 
 | 
 | ||||||
|   /* If need less alignment than we give anyway, just relay to malloc */ |   /* If need less alignment than we give anyway, just relay to malloc */ | ||||||
| 
 | 
 | ||||||
|  | @ -2798,7 +2798,7 @@ Void_t* mEMALIGn(alignment, bytes) size_t alignment; size_t bytes; | ||||||
|   nb = request2size(bytes); |   nb = request2size(bytes); | ||||||
|   m  = (char*)(mALLOc(nb + alignment + MINSIZE)); |   m  = (char*)(mALLOc(nb + alignment + MINSIZE)); | ||||||
| 
 | 
 | ||||||
|   if (m == 0) return 0; /* propagate failure */ |   if (m == NULL) return NULL; /* propagate failure */ | ||||||
| 
 | 
 | ||||||
|   p = mem2chunk(m); |   p = mem2chunk(m); | ||||||
| 
 | 
 | ||||||
|  | @ -2923,10 +2923,10 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size; | ||||||
| #endif | #endif | ||||||
|   Void_t* mem = mALLOc (sz); |   Void_t* mem = mALLOc (sz); | ||||||
| 
 | 
 | ||||||
|   if ((long)n < 0) return 0; |   if ((long)n < 0) return NULL; | ||||||
| 
 | 
 | ||||||
|   if (mem == 0) |   if (mem == NULL) | ||||||
|     return 0; |     return NULL; | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
|     p = mem2chunk(mem); |     p = mem2chunk(mem); | ||||||
|  | @ -3072,7 +3072,7 @@ size_t malloc_usable_size(mem) Void_t* mem; | ||||||
| #endif | #endif | ||||||
| { | { | ||||||
|   mchunkptr p; |   mchunkptr p; | ||||||
|   if (mem == 0) |   if (mem == NULL) | ||||||
|     return 0; |     return 0; | ||||||
|   else |   else | ||||||
|   { |   { | ||||||
|  |  | ||||||
|  | @ -289,8 +289,7 @@ struct variables { | ||||||
| char **global_argv; | char **global_argv; | ||||||
| unsigned int global_argc; | unsigned int global_argc; | ||||||
| #endif | #endif | ||||||
| unsigned int last_return_code; | static unsigned int last_return_code; | ||||||
| int nesting_level; |  | ||||||
| #ifndef __U_BOOT__ | #ifndef __U_BOOT__ | ||||||
| extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ | extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ | ||||||
| #endif | #endif | ||||||
|  | @ -2172,7 +2171,7 @@ int set_local_var(const char *s, int flg_export) | ||||||
| 	 * NAME=VALUE format.  So the first order of business is to | 	 * NAME=VALUE format.  So the first order of business is to | ||||||
| 	 * split 's' on the '=' into 'name' and 'value' */ | 	 * split 's' on the '=' into 'name' and 'value' */ | ||||||
| 	value = strchr(name, '='); | 	value = strchr(name, '='); | ||||||
| 	if (value==0 && ++value==0) { | 	if (value == NULL && ++value == NULL) { | ||||||
| 		free(name); | 		free(name); | ||||||
| 		return -1; | 		return -1; | ||||||
| 	} | 	} | ||||||
|  | @ -2207,13 +2206,13 @@ int set_local_var(const char *s, int flg_export) | ||||||
| 			result = -1; | 			result = -1; | ||||||
| 		} else { | 		} else { | ||||||
| 			cur->name = strdup(name); | 			cur->name = strdup(name); | ||||||
| 			if(cur->name == 0) { | 			if (cur->name == NULL) { | ||||||
| 				free(cur); | 				free(cur); | ||||||
| 				result = -1; | 				result = -1; | ||||||
| 			} else { | 			} else { | ||||||
| 				struct variables *bottom = top_vars; | 				struct variables *bottom = top_vars; | ||||||
| 				cur->value = strdup(value); | 				cur->value = strdup(value); | ||||||
| 				cur->next = 0; | 				cur->next = NULL; | ||||||
| 				cur->flg_export = flg_export; | 				cur->flg_export = flg_export; | ||||||
| 				cur->flg_read_only = 0; | 				cur->flg_read_only = 0; | ||||||
| 				while(bottom->next) bottom=bottom->next; | 				while(bottom->next) bottom=bottom->next; | ||||||
|  | @ -2246,7 +2245,7 @@ void unset_local_var(const char *name) | ||||||
| 			if(strcmp(cur->name, name)==0) | 			if(strcmp(cur->name, name)==0) | ||||||
| 				break; | 				break; | ||||||
| 		} | 		} | ||||||
| 		if(cur!=0) { | 		if (cur != NULL) { | ||||||
| 			struct variables *next = top_vars; | 			struct variables *next = top_vars; | ||||||
| 			if(cur->flg_read_only) { | 			if(cur->flg_read_only) { | ||||||
| 				error_msg("%s: readonly variable", name); | 				error_msg("%s: readonly variable", name); | ||||||
|  | @ -2329,7 +2328,8 @@ static int setup_redirect(struct p_context *ctx, int fd, redir_type style, | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| struct pipe *new_pipe(void) { | static struct pipe *new_pipe(void) | ||||||
|  | { | ||||||
| 	struct pipe *pi; | 	struct pipe *pi; | ||||||
| 	pi = xmalloc(sizeof(struct pipe)); | 	pi = xmalloc(sizeof(struct pipe)); | ||||||
| 	pi->num_progs = 0; | 	pi->num_progs = 0; | ||||||
|  | @ -2387,7 +2387,7 @@ static struct reserved_combo reserved_list[] = { | ||||||
| }; | }; | ||||||
| #define NRES (sizeof(reserved_list)/sizeof(struct reserved_combo)) | #define NRES (sizeof(reserved_list)/sizeof(struct reserved_combo)) | ||||||
| 
 | 
 | ||||||
| int reserved_word(o_string *dest, struct p_context *ctx) | static int reserved_word(o_string *dest, struct p_context *ctx) | ||||||
| { | { | ||||||
| 	struct reserved_combo *r; | 	struct reserved_combo *r; | ||||||
| 	for (r=reserved_list; | 	for (r=reserved_list; | ||||||
|  | @ -2924,7 +2924,7 @@ int parse_string(o_string *dest, struct p_context *ctx, const char *src) | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| /* return code is 0 for normal exit, 1 for syntax error */ | /* return code is 0 for normal exit, 1 for syntax error */ | ||||||
| int parse_stream(o_string *dest, struct p_context *ctx, | static int parse_stream(o_string *dest, struct p_context *ctx, | ||||||
| 			struct in_str *input, int end_trigger) | 			struct in_str *input, int end_trigger) | ||||||
| { | { | ||||||
| 	unsigned int ch, m; | 	unsigned int ch, m; | ||||||
|  | @ -3124,13 +3124,13 @@ int parse_stream(o_string *dest, struct p_context *ctx, | ||||||
| 	return 0; | 	return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void mapset(const unsigned char *set, int code) | static void mapset(const unsigned char *set, int code) | ||||||
| { | { | ||||||
| 	const unsigned char *s; | 	const unsigned char *s; | ||||||
| 	for (s=set; *s; s++) map[*s] = code; | 	for (s=set; *s; s++) map[*s] = code; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void update_ifs_map(void) | static void update_ifs_map(void) | ||||||
| { | { | ||||||
| 	/* char *ifs and char map[256] are both globals. */ | 	/* char *ifs and char map[256] are both globals. */ | ||||||
| 	ifs = (uchar *)getenv("IFS"); | 	ifs = (uchar *)getenv("IFS"); | ||||||
|  | @ -3158,7 +3158,7 @@ void update_ifs_map(void) | ||||||
| 
 | 
 | ||||||
| /* most recursion does not come through here, the exeception is
 | /* most recursion does not come through here, the exeception is
 | ||||||
|  * from builtin_source() */ |  * from builtin_source() */ | ||||||
| int parse_stream_outer(struct in_str *inp, int flag) | static int parse_stream_outer(struct in_str *inp, int flag) | ||||||
| { | { | ||||||
| 
 | 
 | ||||||
| 	struct p_context ctx; | 	struct p_context ctx; | ||||||
|  | @ -3292,7 +3292,7 @@ int u_boot_hush_start(void) | ||||||
| 		top_vars = malloc(sizeof(struct variables)); | 		top_vars = malloc(sizeof(struct variables)); | ||||||
| 		top_vars->name = "HUSH_VERSION"; | 		top_vars->name = "HUSH_VERSION"; | ||||||
| 		top_vars->value = "0.01"; | 		top_vars->value = "0.01"; | ||||||
| 		top_vars->next = 0; | 		top_vars->next = NULL; | ||||||
| 		top_vars->flg_export = 0; | 		top_vars->flg_export = 0; | ||||||
| 		top_vars->flg_read_only = 1; | 		top_vars->flg_read_only = 1; | ||||||
| #ifdef CONFIG_NEEDS_MANUAL_RELOC | #ifdef CONFIG_NEEDS_MANUAL_RELOC | ||||||
|  | @ -3628,7 +3628,8 @@ static char * make_string(char ** inp) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #ifdef __U_BOOT__ | #ifdef __U_BOOT__ | ||||||
| int do_showvar (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) | static int do_showvar(cmd_tbl_t *cmdtp, int flag, int argc, | ||||||
|  | 		      char * const argv[]) | ||||||
| { | { | ||||||
| 	int i, k; | 	int i, k; | ||||||
| 	int rcode = 0; | 	int rcode = 0; | ||||||
|  |  | ||||||
|  | @ -1279,7 +1279,7 @@ void boot_fdt_add_mem_rsv_regions(struct lmb *lmb, void *fdt_blob) | ||||||
| int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) | int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) | ||||||
| { | { | ||||||
| 	void	*fdt_blob = *of_flat_tree; | 	void	*fdt_blob = *of_flat_tree; | ||||||
| 	void	*of_start = 0; | 	void	*of_start = NULL; | ||||||
| 	char	*fdt_high; | 	char	*fdt_high; | ||||||
| 	ulong	of_len = 0; | 	ulong	of_len = 0; | ||||||
| 	int	err; | 	int	err; | ||||||
|  | @ -1312,7 +1312,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) | ||||||
| 			of_start = | 			of_start = | ||||||
| 			    (void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000, | 			    (void *)(ulong) lmb_alloc_base(lmb, of_len, 0x1000, | ||||||
| 							   (ulong)desired_addr); | 							   (ulong)desired_addr); | ||||||
| 			if (of_start == 0) { | 			if (of_start == NULL) { | ||||||
| 				puts("Failed using fdt_high value for Device Tree"); | 				puts("Failed using fdt_high value for Device Tree"); | ||||||
| 				goto error; | 				goto error; | ||||||
| 			} | 			} | ||||||
|  | @ -1327,7 +1327,7 @@ int boot_relocate_fdt(struct lmb *lmb, char **of_flat_tree, ulong *of_size) | ||||||
| 						   + getenv_bootm_low()); | 						   + getenv_bootm_low()); | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	if (of_start == 0) { | 	if (of_start == NULL) { | ||||||
| 		puts("device tree - allocation error\n"); | 		puts("device tree - allocation error\n"); | ||||||
| 		goto error; | 		goto error; | ||||||
| 	} | 	} | ||||||
|  | @ -1703,7 +1703,7 @@ int boot_get_fdt(int flag, int argc, char * const argv[], | ||||||
| 	return 0; | 	return 0; | ||||||
| 
 | 
 | ||||||
| error: | error: | ||||||
| 	*of_flat_tree = 0; | 	*of_flat_tree = NULL; | ||||||
| 	*of_size = 0; | 	*of_size = 0; | ||||||
| 	return 1; | 	return 1; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -505,13 +505,13 @@ void reset_cmd_timeout(void) | ||||||
| #define HIST_MAX		20 | #define HIST_MAX		20 | ||||||
| #define HIST_SIZE		CONFIG_SYS_CBSIZE | #define HIST_SIZE		CONFIG_SYS_CBSIZE | ||||||
| 
 | 
 | ||||||
| static int hist_max = 0; | static int hist_max; | ||||||
| static int hist_add_idx = 0; | static int hist_add_idx; | ||||||
| static int hist_cur = -1; | static int hist_cur = -1; | ||||||
| unsigned hist_num = 0; | static unsigned hist_num; | ||||||
| 
 | 
 | ||||||
| char* hist_list[HIST_MAX]; | static char *hist_list[HIST_MAX]; | ||||||
| char hist_lines[HIST_MAX][HIST_SIZE + 1];	 /* Save room for NULL */ | static char hist_lines[HIST_MAX][HIST_SIZE + 1];	/* Save room for NULL */ | ||||||
| 
 | 
 | ||||||
| #define add_idx_minus_one() ((hist_add_idx == 0) ? hist_max : hist_add_idx-1) | #define add_idx_minus_one() ((hist_add_idx == 0) ? hist_max : hist_add_idx-1) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -192,7 +192,7 @@ block_dev_desc_t *usb_stor_get_dev(int index) | ||||||
| } | } | ||||||
| #endif | #endif | ||||||
| 
 | 
 | ||||||
| void usb_show_progress(void) | static void usb_show_progress(void) | ||||||
| { | { | ||||||
| 	debug("."); | 	debug("."); | ||||||
| } | } | ||||||
|  | @ -437,7 +437,7 @@ static int usb_stor_BBB_reset(struct us_data *us) | ||||||
| 	result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), | 	result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), | ||||||
| 				 US_BBB_RESET, | 				 US_BBB_RESET, | ||||||
| 				 USB_TYPE_CLASS | USB_RECIP_INTERFACE, | 				 USB_TYPE_CLASS | USB_RECIP_INTERFACE, | ||||||
| 				 0, us->ifnum, 0, 0, USB_CNTL_TIMEOUT * 5); | 				 0, us->ifnum, NULL, 0, USB_CNTL_TIMEOUT * 5); | ||||||
| 
 | 
 | ||||||
| 	if ((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) { | 	if ((result < 0) && (us->pusb_dev->status & USB_ST_STALLED)) { | ||||||
| 		USB_STOR_PRINTF("RESET:stall\n"); | 		USB_STOR_PRINTF("RESET:stall\n"); | ||||||
|  | @ -500,7 +500,7 @@ static int usb_stor_CB_reset(struct us_data *us) | ||||||
|  * Set up the command for a BBB device. Note that the actual SCSI |  * Set up the command for a BBB device. Note that the actual SCSI | ||||||
|  * command is copied into cbw.CBWCDB. |  * command is copied into cbw.CBWCDB. | ||||||
|  */ |  */ | ||||||
| int usb_stor_BBB_comdat(ccb *srb, struct us_data *us) | static int usb_stor_BBB_comdat(ccb *srb, struct us_data *us) | ||||||
| { | { | ||||||
| 	int result; | 	int result; | ||||||
| 	int actlen; | 	int actlen; | ||||||
|  | @ -548,7 +548,7 @@ int usb_stor_BBB_comdat(ccb *srb, struct us_data *us) | ||||||
| /* FIXME: we also need a CBI_command which sets up the completion
 | /* FIXME: we also need a CBI_command which sets up the completion
 | ||||||
|  * interrupt, and waits for it |  * interrupt, and waits for it | ||||||
|  */ |  */ | ||||||
| int usb_stor_CB_comdat(ccb *srb, struct us_data *us) | static int usb_stor_CB_comdat(ccb *srb, struct us_data *us) | ||||||
| { | { | ||||||
| 	int result = 0; | 	int result = 0; | ||||||
| 	int dir_in, retry; | 	int dir_in, retry; | ||||||
|  | @ -617,7 +617,7 @@ int usb_stor_CB_comdat(ccb *srb, struct us_data *us) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| int usb_stor_CBI_get_status(ccb *srb, struct us_data *us) | static int usb_stor_CBI_get_status(ccb *srb, struct us_data *us) | ||||||
| { | { | ||||||
| 	int timeout; | 	int timeout; | ||||||
| 
 | 
 | ||||||
|  | @ -626,7 +626,7 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us) | ||||||
| 			(void *) &us->ip_data, us->irqmaxp, us->irqinterval); | 			(void *) &us->ip_data, us->irqmaxp, us->irqinterval); | ||||||
| 	timeout = 1000; | 	timeout = 1000; | ||||||
| 	while (timeout--) { | 	while (timeout--) { | ||||||
| 		if ((volatile int *) us->ip_wanted == 0) | 		if ((volatile int *) us->ip_wanted == NULL) | ||||||
| 			break; | 			break; | ||||||
| 		mdelay(10); | 		mdelay(10); | ||||||
| 	} | 	} | ||||||
|  | @ -665,18 +665,18 @@ int usb_stor_CBI_get_status(ccb *srb, struct us_data *us) | ||||||
| #define USB_TRANSPORT_NOT_READY_RETRY 10 | #define USB_TRANSPORT_NOT_READY_RETRY 10 | ||||||
| 
 | 
 | ||||||
| /* clear a stall on an endpoint - special for BBB devices */ | /* clear a stall on an endpoint - special for BBB devices */ | ||||||
| int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt) | static int usb_stor_BBB_clear_endpt_stall(struct us_data *us, __u8 endpt) | ||||||
| { | { | ||||||
| 	int result; | 	int result; | ||||||
| 
 | 
 | ||||||
| 	/* ENDPOINT_HALT = 0, so set value to 0 */ | 	/* ENDPOINT_HALT = 0, so set value to 0 */ | ||||||
| 	result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), | 	result = usb_control_msg(us->pusb_dev, usb_sndctrlpipe(us->pusb_dev, 0), | ||||||
| 				USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, | 				USB_REQ_CLEAR_FEATURE, USB_RECIP_ENDPOINT, | ||||||
| 				0, endpt, 0, 0, USB_CNTL_TIMEOUT * 5); | 				0, endpt, NULL, 0, USB_CNTL_TIMEOUT * 5); | ||||||
| 	return result; | 	return result; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int usb_stor_BBB_transport(ccb *srb, struct us_data *us) | static int usb_stor_BBB_transport(ccb *srb, struct us_data *us) | ||||||
| { | { | ||||||
| 	int result, retry; | 	int result, retry; | ||||||
| 	int dir_in; | 	int dir_in; | ||||||
|  | @ -798,7 +798,7 @@ again: | ||||||
| 	return result; | 	return result; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| int usb_stor_CB_transport(ccb *srb, struct us_data *us) | static int usb_stor_CB_transport(ccb *srb, struct us_data *us) | ||||||
| { | { | ||||||
| 	int result, status; | 	int result, status; | ||||||
| 	ccb *psrb; | 	ccb *psrb; | ||||||
|  |  | ||||||
|  | @ -100,7 +100,7 @@ static struct | ||||||
| 
 | 
 | ||||||
| #ifndef REDBOOT			/*SB */ | #ifndef REDBOOT			/*SB */ | ||||||
| typedef int cyg_int32; | typedef int cyg_int32; | ||||||
| int | static int | ||||||
| CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c) | CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c) | ||||||
| { | { | ||||||
| #define DELAY 20 | #define DELAY 20 | ||||||
|  | @ -118,7 +118,7 @@ CYGACC_COMM_IF_GETC_TIMEOUT (char chan, char *c) | ||||||
|   return 0; |   return 0; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void | static void | ||||||
| CYGACC_COMM_IF_PUTC (char x, char y) | CYGACC_COMM_IF_PUTC (char x, char y) | ||||||
| { | { | ||||||
|   putc (y); |   putc (y); | ||||||
|  | @ -165,7 +165,7 @@ _tolower (char c) | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| /* Parse (scan) a number */ | /* Parse (scan) a number */ | ||||||
| bool | static bool | ||||||
| parse_num (char *s, unsigned long *val, char **es, char *delim) | parse_num (char *s, unsigned long *val, char **es, char *delim) | ||||||
| { | { | ||||||
|   bool first = true; |   bool first = true; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue