Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S266901AbUIOR2I (ORCPT ); Wed, 15 Sep 2004 13:28:08 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S266878AbUIORZm (ORCPT ); Wed, 15 Sep 2004 13:25:42 -0400 Received: from chaos.analogic.com ([204.178.40.224]:18562 "EHLO chaos.analogic.com") by vger.kernel.org with ESMTP id S267230AbUIORYA (ORCPT ); Wed, 15 Sep 2004 13:24:00 -0400 Date: Wed, 15 Sep 2004 13:23:50 -0400 (EDT) From: "Richard B. Johnson" X-X-Sender: root@chaos Reply-To: root@chaos.analogic.com To: Linus Torvalds cc: Kernel Mailing List Subject: Re: Being more anal about iospace accesses.. In-Reply-To: Message-ID: References: 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 Content-Length: 1404 Lines: 38 On Wed, 15 Sep 2004, Linus Torvalds wrote: > > This is a background mail mainly for driver writers and/or architecture > people. Or others that are just interested in really low-level hw access > details. Others - please feel free to ignore. > [SNIPPED mostly....] > For example, if you don't know (or, more importantly - don't care) what > kind of IO interface you use, you can now do something like > > void __iomem * map = pci_iomap(dev, bar, maxbytes); > ... > status = ioread32(map + DRIVER_STATUS_OFFSET); ^^^^^^^^^^^^^^^^ Doesn't this rely on the non-standard GNUism that you can perform pointer-arithmetic on a void-pointer? Which is illegal, immoral, and fattening. I'd much rather see char-pointers so it's valid to perform the offset math. That way, in the future, a new tool that follows (ANSI, IEEE, POSIX) rules doesn't barf. I suggest a new pointer type like (BASE *) or (BAR *) that hides the (unsigned char *) necessary to not barf, plus minimize side-effects. Cheers, Dick Johnson Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips). Note 96.31% of all statistics are fiction. - 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/