Re: [PATCH 6/7] aic94xx: use bitops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  	spin_lock_irqsave(lock, flags);
> -	if (*pending & (1 << event)) {
> +	if (test_bit(event, pending)) {
>  		spin_unlock_irqrestore(lock, flags);
>  		return;
>  	}
> -	*pending |= (1 << event);
> +	__set_bit(event, pending);
>  	spin_unlock_irqrestore(lock, flags);
>  	scsi_queue_work(shost, work);
>  }
>  
> -static inline void sas_begin_event(int event, spinlock_t *lock, u32 *pending)
> +static inline void sas_begin_event(int event, spinlock_t *lock, 
> +				   unsigned long *pending)
>  {
>  	unsigned long flags;
>  
>  	spin_lock_irqsave(lock, flags);
> -	*pending &= ~(1 << event);
> +	__clear_bit(event, pending);
>  	spin_unlock_irqrestore(lock, flags);
>  }

What else does the spinlock protect?  By using test_and_set_bit/clear_bit
you could get rid of them unless it's needed elsewhere.
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux