Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993052AbXEBMGf (ORCPT ); Wed, 2 May 2007 08:06:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2993060AbXEBMGf (ORCPT ); Wed, 2 May 2007 08:06:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:46791 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993052AbXEBMGd (ORCPT ); Wed, 2 May 2007 08:06:33 -0400 To: Dave Jones Cc: Linus Torvalds , Josh Triplett , linux-sparse@vger.kernel.org, linux-kernel@vger.kernel.org, Al Viro Subject: Re: sparse -Wptr-subtraction-blows: still needed? References: <4637AC3D.6000008@freedesktop.org> <20070502024242.GC6935@redhat.com> From: Andi Kleen Date: 02 May 2007 15:03:59 +0200 In-Reply-To: <20070502024242.GC6935@redhat.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 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: 712 Lines: 12 Dave Jones writes: > > #define __page_to_pfn(page) ((unsigned long)((page) - mem_map) + \ > ARCH_PFN_OFFSET) > > looks like the other two variants of __page_to_pfn also use similar arithmatic. No way around this. The only way to turn a page into a pfn is to do a constant division. Should be fairly cheap here though. -Andi (who thinks the sparse warning is dumb; better to look at oprofiles of hot paths) - 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/