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

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

 



On Tue, 13 Nov 2007 18:30:30 +0100 (CET)
Tilman Schmidt <[email protected]> wrote:

> From: Tilman Schmidt <[email protected]>
> 
> This patch adds basic suspend/resume support to the bas_gigaset ISDN
> driver for the Siemens Gigaset SX255 series of ISDN DECT bases.
> 
> Only the USB aspects are handled so far; the ISDN subsystem is not
> notified  in any way, for lack of information about how to do that.
> The driver will refuse to suspend if a connection is active.
> 
> ...
>
> +	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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[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