Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753549AbWLRI4h (ORCPT ); Mon, 18 Dec 2006 03:56:37 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753550AbWLRI4h (ORCPT ); Mon, 18 Dec 2006 03:56:37 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:38942 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753547AbWLRI4g (ORCPT ); Mon, 18 Dec 2006 03:56:36 -0500 Subject: Re: [PATCH 1/2] WorkStruct: Add assign_bits() to give an atomic-bitops safe assignment From: David Woodhouse To: Linus Torvalds , Evgeniy Polyakov Cc: Nick Piggin , Russell King , David Howells , Andrew Morton , "David S. Miller" , matthew@wil.cx, Linux Kernel Mailing List , linux-arch@vger.kernel.org In-Reply-To: References: <20061212201112.29817.22041.stgit@warthog.cambridge.redhat.com> <20061212225443.GA25902@flint.arm.linux.org.uk> <457F606B.70805@yahoo.com.au> Content-Type: text/plain Date: Mon, 18 Dec 2006 08:56:24 +0000 Message-Id: <1166432184.25827.8.camel@pmac.infradead.org> Mime-Version: 1.0 X-Mailer: Evolution 2.8.2.1 (2.8.2.1-2.fc6.dwmw2.1) Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1288 Lines: 35 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 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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/