From patchwork Thu Nov 5 07:47:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grant Likely X-Patchwork-Id: 37746 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id DFDC81008F2 for ; Thu, 5 Nov 2009 18:47:22 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755073AbZKEHrQ (ORCPT ); Thu, 5 Nov 2009 02:47:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755090AbZKEHrQ (ORCPT ); Thu, 5 Nov 2009 02:47:16 -0500 Received: from mail-pz0-f188.google.com ([209.85.222.188]:42572 "EHLO mail-pz0-f188.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755093AbZKEHrQ (ORCPT ); Thu, 5 Nov 2009 02:47:16 -0500 Received: by mail-pz0-f188.google.com with SMTP id 26so5286486pzk.4 for ; Wed, 04 Nov 2009 23:47:21 -0800 (PST) Received: by 10.114.44.8 with SMTP id r8mr4356278war.80.1257407241716; Wed, 04 Nov 2009 23:47:21 -0800 (PST) Received: from angua (S01060002b3d79728.cg.shawcable.net [68.146.87.181]) by mx.google.com with ESMTPS id 20sm1063781pzk.5.2009.11.04.23.47.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 04 Nov 2009 23:47:20 -0800 (PST) Received: from [127.0.1.1] (unknown [IPv6:::1]) by angua (Postfix) with ESMTP id 53A1911ED0; Thu, 5 Nov 2009 00:47:19 -0700 (MST) From: Grant Likely Subject: [PATCH 10/11] of: remove special case definition of of_read_ulong() To: linuxppc-dev@lists.ozlabs.org, devicetree-discuss@lists.ozlabs.org, benh@kernel.crashing.org, sfr@canb.auug.org.au, davem@davemloft.net, sparclinux@vger.kernel.org, monstr@monstr.eu, microblaze-uclinux@itee.uq.edu.au Date: Thu, 05 Nov 2009 00:47:19 -0700 Message-ID: <20091105074710.10460.31527.stgit@angua> In-Reply-To: <20091105073728.10460.6061.stgit@angua> References: <20091105073728.10460.6061.stgit@angua> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org Special case of of_read_ulong() was defined for PPC32 to toss away all but the last 32 bits when a large number value was read, and the 'normal' version for ppc64 just #defined of_read_ulong to of_read_number which causes compiler warnings on MicroBlaze and other 32 bit architectures because it returns a u64 instead of a ulong. This patch fixes the problem by defining a common implementation of of_read_ulong() that works everywhere. Signed-off-by: Grant Likely --- include/linux/of.h | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/include/linux/of.h b/include/linux/of.h index bec2157..d4c014a 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -113,14 +113,11 @@ static inline u64 of_read_number(const u32 *cell, int size) } /* Like of_read_number, but we want an unsigned long result */ -#ifdef CONFIG_PPC32 static inline unsigned long of_read_ulong(const u32 *cell, int size) { - return cell[size-1]; + /* toss away upper bits if unsigned long is smaller than u64 */ + return of_read_number(cell, size); } -#else -#define of_read_ulong(cell, size) of_read_number(cell, size) -#endif #include