From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932533AbVHYVQT (ORCPT ); Thu, 25 Aug 2005 17:16:19 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751485AbVHYVQT (ORCPT ); Thu, 25 Aug 2005 17:16:19 -0400 Received: from mail23.sea5.speakeasy.net ([69.17.117.25]:25281 "EHLO mail23.sea5.speakeasy.net") by vger.kernel.org with ESMTP id S1751475AbVHYVQS (ORCPT ); Thu, 25 Aug 2005 17:16:18 -0400 Date: Thu, 25 Aug 2005 14:16:17 -0700 (PDT) From: Vadim Lobanov To: Christopher Friesen cc: linux-kernel@vger.kernel.org, tom.anderl@gmail.com Subject: Re: [OT] volatile keyword In-Reply-To: <430E30B2.1020700@nortel.com> Message-ID: References: <430E30B2.1020700@nortel.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Aug 2005, Christopher Friesen wrote: > Vadim Lobanov wrote: > > > I'm positive I'm doing something wrong here. In fact, I bet it's the > > volatile cast within the loop that's wrong; but I'm not sure how to do > > it correctly. Any help / pointers / discussion would be appreciated. > > You need to cast is as dereferencing a volatile pointer. > > Chris > I figured it was something along these lines. In that case, is the following code (from kernel/posix-timers.c) really doing the right thing? do expires = timr->it_timer.expires; while ((volatile long) (timr->it_timer.expires) != expires); Seems it's casting the value, not the pointer. -VadimL