rem: dprintf("delete_port: invalid port_id %d\n", id);
add: dprintf("delete_port: invalid port_id %ld\n", id);
context: delete_port(port_id id){	int slot;	int state;	sem_id	r_sem, w_sem;	int capacity;	int i;	char *old_name;	struct port_msg *q;	if(ports_active == false)		return B_BAD_PORT_ID;	if(id < 0)		return B_BAD_PORT_ID;	slot = id % MAX_PORTS;	state = disable_interrupts();	GRAB_PORT_LOCK(ports[slot]);	if(ports[slot].id != id) {		RELEASE_PORT_LOCK(ports[slot]);		restore_interrupts(state);		dprintf("delete_port: invalid port_id %d\n", id);		return B_BAD_PORT_ID;	}	/* mark port as invalid */	ports[slot].id	 = -1;	old_name 		 = ports[slot].name;	q				 = ports[slot].msg_queue;	r_sem			 = ports[slot].read_sem;	w_sem			 = ports[slot].write_sem;	capacity		 = ports[slot].capacity;	ports[slot].name = NULL;	RELEASE_PORT_LOCK(ports[slot]);	restore_interrupts(state);	// delete the cbuf's that are left in the queue (if any)	for (i=0; i<capacity; i++) {		if (q[i].data_cbuf != NULL)	 		cbuf_free_chain(q[i].data_cbuf);	}	kfree(q);	kfree(old_name);	// release the threads that were blocking on this port by deleting the sem	// read_port() will see the B_BAD_SEM_ID acq_sem() return value, and act accordingly	delete_sem(r_sem);	delete_sem(w_sem);	return B_NO_ERROR;}