rem: if (io->func == handler && io->data == data) break;
add: if (io->func == handler && io->data == data) { remque(io); kfree(io); rv = 0; break; }
context: long remove_interrupt_handler(long vector, interrupt_handler handler,                               void* data) { 	struct io_handler *io = NULL; 	/* lock the structures down so it is not modified while we search */	int state = int_disable_interrupts(); 	acquire_spinlock(&io_vectors[vector].vector_lock); 	/* loop through the available handlers and try to find a match.	 * We go forward through the list but this means we start with the 	 * most recently added handlers.	 */	io = io_vectors[vector].handler_list.next; 	for (io = io_vectors[vector].handler_list.next;	     io != &io_vectors[vector].handler_list;	     io = io->next) { 		/* we have to match both function and data */ 		if (io->func == handler && io->data == data) 			break; 	} 	if (io) {		remque(io);		kfree(io); 	}		// release our lock as we're done with the vector 	release_spinlock(&io_vectors[vector].vector_lock); 	int_restore_interrupts(state); 	return (io != NULL) ? 0 : EINVAL; } 