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

Tilman Schmidt <[email protected]>
Newsgroups gmane.linux.usb.devel,gmane.linux.kernel,gmane.linux.isdn.i4l.devel
Organization me - organized??
Message-ID <[email protected]>
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)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
signature.asc (application/pgp-signature, 253 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3rc1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHPNubMdB4Whm86/kRAg+jAJsGQwziVlJ4/qOuorGbWAf1JjULaQCfZ8Tc
v3qH/XYtx4CGE5zaGI+VNpw=
=J3wk
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.