public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Linus Torvalds <torvalds@osdl.org>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
	Russell King <rmk+lkml@arm.linux.org.uk>,
	David Howells <dhowells@redhat.com>,
	Andrew Morton <akpm@osdl.org>,
	"David S. Miller" <davem@davemloft.net>,
	matthew@wil.cx,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arch@vger.kernel.org
Subject: Re: [PATCH 1/2] WorkStruct: Add assign_bits() to give an atomic-bitops safe assignment
Date: Mon, 18 Dec 2006 08:56:24 +0000	[thread overview]
Message-ID: <1166432184.25827.8.camel@pmac.infradead.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0612151437130.3849@woody.osdl.org>

On Fri, 2006-12-15 at 14:45 -0800, Linus Torvalds wrote:
> This uses "atomic_long_t" for the workstruct "data" field, which shares 
> the per-cpu pointer and the workstruct flag bits in one field.

This fixes drivers/connector/connector.c to cope...

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
index 5e7cd45..27f377b 100644
--- a/drivers/connector/connector.c
+++ b/drivers/connector/connector.c
@@ -135,9 +135,8 @@ static int cn_call_callback(struct cn_msg *msg, void (*destruct_data)(void *), v
 	spin_lock_bh(&dev->cbdev->queue_lock);
 	list_for_each_entry(__cbq, &dev->cbdev->queue_list, callback_entry) {
 		if (cn_cb_equal(&__cbq->id.id, &msg->id)) {
-			if (likely(!test_bit(WORK_STRUCT_PENDING,
-					     &__cbq->work.work.management) &&
-					__cbq->data.ddata == NULL)) {
+			if (likely(!work_pending(&__cbq->work.work) &&
+			    __cbq->data.ddata == NULL)) {
 				__cbq->data.callback_priv = msg;
 
 				__cbq->data.ddata = data;

 

-- 
dwmw2


  reply	other threads:[~2006-12-18  8:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 20:11 [PATCH 1/2] WorkStruct: Add assign_bits() to give an atomic-bitops safe assignment David Howells
2006-12-12 20:11 ` [PATCH 2/2] WorkStruct: Use bitops-safe direct assignment David Howells
2006-12-12 22:54 ` [PATCH 1/2] WorkStruct: Add assign_bits() to give an atomic-bitops safe assignment Russell King
2006-12-12 23:03   ` Paul Mackerras
2006-12-12 23:17   ` David Howells
2006-12-13  1:36   ` Linus Torvalds
2006-12-13  2:07     ` Nick Piggin
2006-12-13  2:30       ` Linus Torvalds
2006-12-15 22:45       ` Linus Torvalds
2006-12-18  8:56         ` David Woodhouse [this message]
2006-12-18  9:05           ` Evgeniy Polyakov
2006-12-18  9:10           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1166432184.25827.8.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew@wil.cx \
    --cc=nickpiggin@yahoo.com.au \
    --cc=rmk+lkml@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox