/* Release the semaphore. Unlike mutexes, up() may be called from any context and even by tasks which have never called down().  */
void up(struct semaphore *sem)
/* Release the semaphore. Unlike mutexes, up() may be called from any context and even by tasks which have never called down().  */
void up(struct semaphore *sem)
{
	unsigned long flags;
	spin_lock_irqsave(&sem->lock, flags);
	if (likely(list_empty(&sem->wait_list)))
		sem->count++;
	else
		__up(sem);
	spin_unlock_irqrestore(&sem->lock, flags);
}