Remove function prefix from err()
This commit is contained in:
		
							parent
							
								
									9cb752e102
								
							
						
					
					
						commit
						5a03fd49e9
					
				| @ -59,14 +59,13 @@ bay_register(struct bay *bay, struct chan *chan) | ||||
| { | ||||
| 	struct bay_chan *bchan = find_bay_chan(bay, chan->name); | ||||
| 	if (bchan != NULL) { | ||||
| 		err("bay_register: channel %s already registered\n", | ||||
| 				chan->name); | ||||
| 		err("channel %s already registered", chan->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	bchan = calloc(1, sizeof(struct bay_chan)); | ||||
| 	if (bchan == NULL) { | ||||
| 		err("bay_register: calloc failed\n"); | ||||
| 		err("calloc failed:"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| @ -87,14 +86,12 @@ bay_remove(struct bay *bay, struct chan *chan) | ||||
| { | ||||
| 	struct bay_chan *bchan = find_bay_chan(bay, chan->name); | ||||
| 	if (bchan == NULL) { | ||||
| 		err("bay_remove: channel %s not registered\n", | ||||
| 				chan->name); | ||||
| 		err("channel %s not registered", chan->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	if (bchan->is_dirty) { | ||||
| 		err("bay_remove: cannot remote bay channel %s in dirty state\n", | ||||
| 				chan->name); | ||||
| 		err("cannot remote bay channel %s in dirty state", chan->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| @ -195,7 +192,7 @@ propagate_chan(struct bay_chan *bchan, enum bay_cb_type type) | ||||
| 	DL_FOREACH(bchan->cb[type], cur) { | ||||
| 		dbg("calling cb %p", cur->func); | ||||
| 		if (cur->func(bchan->chan, cur->arg) != 0) { | ||||
| 			err("propagate_chan: callback failed\n"); | ||||
| 			err("callback failed"); | ||||
| 			return -1; | ||||
| 		} | ||||
| 	} | ||||
| @ -211,7 +208,7 @@ bay_propagate(struct bay *bay) | ||||
| 	DL_FOREACH(bay->dirty, cur) { | ||||
| 		/* May add more dirty channels */ | ||||
| 		if (propagate_chan(cur, BAY_CB_DIRTY) != 0) { | ||||
| 			err("bay_propagate: propagate_chan failed\n"); | ||||
| 			err("propagate_chan failed"); | ||||
| 			return -1; | ||||
| 		} | ||||
| 	} | ||||
| @ -224,7 +221,7 @@ bay_propagate(struct bay *bay) | ||||
| 	DL_FOREACH(bay->dirty, cur) { | ||||
| 		/* Cannot add more dirty channels */ | ||||
| 		if (propagate_chan(cur, BAY_CB_EMIT) != 0) { | ||||
| 			err("bay_propagate: propagate_chan failed\n"); | ||||
| 			err("propagate_chan failed"); | ||||
| 			return -1; | ||||
| 		} | ||||
| 	} | ||||
| @ -237,7 +234,7 @@ bay_propagate(struct bay *bay) | ||||
| 	bay->state = BAY_FLUSHING; | ||||
| 	DL_FOREACH(bay->dirty, cur) { | ||||
| 		if (chan_flush(cur->chan) != 0) { | ||||
| 			err("bay_propagate: chan_flush failed\n"); | ||||
| 			err("chan_flush failed"); | ||||
| 			return -1; | ||||
| 		} | ||||
| 		cur->is_dirty = 0; | ||||
|  | ||||
| @ -119,13 +119,13 @@ int | ||||
| clkoff_load(struct clkoff *table, FILE *file) | ||||
| { | ||||
| 	if (cparse(table, file) != 0) { | ||||
| 		err("clkoff_load: failed parsing clock table\n"); | ||||
| 		err("failed parsing clock table"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	/* Create index array */ | ||||
| 	if (cindex(table) != 0) { | ||||
| 		err("clkoff_load: failed indexing table\n"); | ||||
| 		err("failed indexing table"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
| @ -62,7 +62,7 @@ cb_select(struct chan *sel_chan, void *ptr) | ||||
| 
 | ||||
| 	struct value sel_value; | ||||
| 	if (chan_read(sel_chan, &sel_value) != 0) { | ||||
| 		err("cb_select: chan_read(select) failed\n"); | ||||
| 		err("chan_read(select) failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| @ -96,12 +96,12 @@ cb_select(struct chan *sel_chan, void *ptr) | ||||
| 	/* Set to null by default */ | ||||
| 	struct value out_value = value_null(); | ||||
| 	if (input != NULL && chan_read(input->chan, &out_value) != 0) { | ||||
| 		err("cb_select: chan_read() failed\n"); | ||||
| 		err("chan_read() failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	if (chan_set(mux->output, out_value) != 0) { | ||||
| 		err("cb_select: chan_set() failed\n"); | ||||
| 		err("chan_set() failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| @ -143,24 +143,22 @@ mux_init(struct mux *mux, | ||||
| 		int64_t ninputs) | ||||
| { | ||||
| 	if (chan_get_type(output) != CHAN_SINGLE) { | ||||
| 		err("mux_init: output channel must be of type single\n"); | ||||
| 		err("output channel must be of type single"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	if (select == output) { | ||||
| 		err("mux_init: cannot use same channel as select and output\n"); | ||||
| 		err("cannot use same channel as select and output"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	/* Ensure both channels are registered */ | ||||
| 	if (bay_find(bay, select->name) == NULL) { | ||||
| 		err("mux_init: select channel %s not registered in bay\n", | ||||
| 				select->name); | ||||
| 		err("select channel %s not registered in bay", select->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	if (bay_find(bay, output->name) == NULL) { | ||||
| 		err("mux_init: output channel %s not registered in bay\n", | ||||
| 				output->name); | ||||
| 		err("output channel %s not registered in bay", output->name); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| @ -213,12 +211,12 @@ int | ||||
| mux_set_input(struct mux *mux, int64_t index, struct chan *chan) | ||||
| { | ||||
| 	if (chan == mux->output) { | ||||
| 		err("mux_init: cannot use same input channel as output\n"); | ||||
| 		err("cannot use same input channel as output"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
| 	if (chan == mux->select) { | ||||
| 		err("mux_init: cannot use same input channel as select\n"); | ||||
| 		err("cannot use same input channel as select"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
| @ -461,7 +461,7 @@ system_init(struct system *sys, struct emu_args *args, struct trace *trace) | ||||
| 
 | ||||
| 	/* Set the offsets of the looms and streams */ | ||||
| 	if (init_offsets(sys, trace) != 0) { | ||||
| 		err("system_init: init_offsets() failed\n"); | ||||
| 		err("init_offsets() failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
| @ -277,7 +277,7 @@ thread_set_state(struct thread *th, enum thread_state state) | ||||
| 
 | ||||
| 	struct chan *st = &th->chan[TH_CHAN_STATE]; | ||||
| 	if (chan_set(st, value_int64(th->state)) != 0) { | ||||
| 		err("thread_set_cpu: chan_set() failed"); | ||||
| 		err("chan_set() failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
| @ -38,7 +38,7 @@ load_stream(struct trace *trace, const char *path) | ||||
| 	while (relpath[0] == '/') relpath++; | ||||
| 
 | ||||
| 	if (stream_load(stream, trace->tracedir, relpath) != 0) { | ||||
| 		err("load_stream: emu_steam_load failed\n"); | ||||
| 		err("emu_steam_load failed"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user