Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946134AbXBBVkP (ORCPT ); Fri, 2 Feb 2007 16:40:15 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1946133AbXBBVkO (ORCPT ); Fri, 2 Feb 2007 16:40:14 -0500 Received: from srv5.dvmed.net ([207.36.208.214]:52295 "EHLO mail.dvmed.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946134AbXBBVkN (ORCPT ); Fri, 2 Feb 2007 16:40:13 -0500 Message-ID: <45C3AFB7.80207@garzik.org> Date: Fri, 02 Feb 2007 16:40:07 -0500 From: Jeff Garzik User-Agent: Thunderbird 1.5.0.9 (X11/20061219) MIME-Version: 1.0 To: "Michael K. Edwards" CC: "H. Peter Anvin" , Linux Kernel List Subject: Re: Should io(read|write)(8|16|32)_rep take (const|) volatile u(8|16|32) __iomem *addr? References: <45C2D47A.9080001@garzik.org> <45C2DA8D.4050007@zytor.com> <45C31B86.6070009@garzik.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -4.3 (----) X-Spam-Report: SpamAssassin version 3.1.7 on srv5.dvmed.net summary: Content analysis details: (-4.3 points, 5.0 required) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 897 Lines: 23 Michael K. Edwards wrote: > Doubtless this is on purpose, but it's not clear to me why that should > be true for these particular functions/macros. I shouldn't have to > cast away the volatile on a pointer to hardware registers in order to > pass it into writel(), should I? And it shouldn't be forbidden for > the caller to declare the pointer volatile so that the compiler > catches attempts to pass it into non-volatile interfaces, should it? Therein lies your bug: you should not be annotating your __iomem pointers with volatile. That's why volatile is found in the implementation and not the prototypes of the accessor functions. Jeff - 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/