Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964916AbVLFCEd (ORCPT ); Mon, 5 Dec 2005 21:04:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964919AbVLFCEd (ORCPT ); Mon, 5 Dec 2005 21:04:33 -0500 Received: from ns.ustc.edu.cn ([202.38.64.1]:15845 "EHLO mx1.ustc.edu.cn") by vger.kernel.org with ESMTP id S964916AbVLFCEc (ORCPT ); Mon, 5 Dec 2005 21:04:32 -0500 Date: Tue, 6 Dec 2005 10:23:19 +0800 From: Wu Fengguang To: Christoph Lameter Cc: Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/16] radixtree: sync with mainline Message-ID: <20051206022319.GA3746@mail.ustc.edu.cn> Mail-Followup-To: Wu Fengguang , Christoph Lameter , Andrew Morton , linux-kernel@vger.kernel.org References: <20051203071444.260068000@localhost.localdomain> <20051203071625.331743000@localhost.localdomain> <20051204155750.3972c3df.akpm@osdl.org> <20051205104446.GA6104@mail.ustc.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1517 Lines: 52 On Mon, Dec 05, 2005 at 09:24:18AM -0800, Christoph Lameter wrote: > On Mon, 5 Dec 2005, Wu Fengguang wrote: > > > return slot; > > > > It should be > > > > return &slot; > > That wont work. slot is a local variable. Drop this patch please. Thanks. Sorry for the careless mistake. But your patch do fit well in my patch :) void *radix_tree_lookup_node(struct radix_tree_root *root, unsigned long index, unsigned int level) { unsigned int height, shift; struct radix_tree_node *slot; height = root->height; if (index > radix_tree_maxindex(height)) return NULL; shift = (height-1) * RADIX_TREE_MAP_SHIFT; slot = root->rnode; while (height > level) { if (slot == NULL) return NULL; slot = slot->slots[(index >> shift) & RADIX_TREE_MAP_MASK]; shift -= RADIX_TREE_MAP_SHIFT; height--; } return slot; } void **radix_tree_lookup_slot(struct radix_tree_root *root, unsigned long index) { struct radix_tree_node *node; node = radix_tree_lookup_node(root, index, 1); return node->slots + (index & RADIX_TREE_MAP_MASK); } - 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/