Re: [PATCH 3/4] bas_gigaset: suspend support (v2)

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

 



Am 15.11.2007 23:50 schrieb Andrew Morton:
>> ...
>>
>> +	if (atomic_read(&cs->hw.bas->basstate) & BS_SUSPEND) {
> 
> that's pretty peculiar.  We'd only expect to see atomics being used in
> conjunction with atomic_add/sub/inc/etc.  Here the driver is using an
> atomic_t as a state variable.  And here's the magic bit:
> 
> 	spin_lock_irqsave(&ucs->lock, flags);
> 	state = atomic_read(&ucs->basstate);
> 	atomic_set(&ucs->basstate, (state & ~clear) | set);
> 	spin_unlock_irqrestore(&ucs->lock, flags);
> 
> I'm suspecting that a plain old `int' would be more appropriate here.

You're right. That's a prehistoric leftover. That variable was
originally accessed using atomic_set_mask() and atomic_clear_mask()
which are unfortunately x86 platform specific.

I'll prepare a cleanup patch.

Thanks,
Tilman

-- 
Tilman Schmidt                          E-Mail: [email protected]
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)

Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux