From patchwork Thu Jan 1 22:40:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Ravnborg X-Patchwork-Id: 16242 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 4757FDDEDA for ; Fri, 2 Jan 2009 09:38:55 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752599AbZAAWix (ORCPT ); Thu, 1 Jan 2009 17:38:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753389AbZAAWix (ORCPT ); Thu, 1 Jan 2009 17:38:53 -0500 Received: from pfepa.post.tele.dk ([195.41.46.235]:42452 "EHLO pfepa.post.tele.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752599AbZAAWiw (ORCPT ); Thu, 1 Jan 2009 17:38:52 -0500 Received: from ravnborg.org (x1-6-00-1e-2a-84-ae-3e.k225.webspeed.dk [80.163.61.94]) by pfepa.post.tele.dk (Postfix) with ESMTP id 8CFDFA50020; Thu, 1 Jan 2009 23:38:49 +0100 (CET) Received: by ravnborg.org (Postfix, from userid 500) id 34A83580D3; Thu, 1 Jan 2009 23:40:31 +0100 (CET) From: Sam Ravnborg To: David Miller , sparclinux Cc: Sam Ravnborg Subject: [PATCH 2/4] sparc: fix warnings in userspace header byteorder.h Date: Thu, 1 Jan 2009 23:40:28 +0100 Message-Id: <1230849630-22482-2-git-send-email-sam@ravnborg.org> X-Mailer: git-send-email 1.6.0.2.GIT In-Reply-To: <20090101223600.GA19647@uranus.ravnborg.org> References: <20090101223600.GA19647@uranus.ravnborg.org> Sender: sparclinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: sparclinux@vger.kernel.org Fix following warnings in byteorder.h: byteorder.h:4: include of is preferred over byteorder.h:9: leaks CONFIG_SPARC32 to userspace where it is not valid byteorder.h:13: leaks CONFIG_SPARC64 to userspace where it is not valid byteorder.h:14: found __[us]{8,16,32,64} type without #include byteorder.h:47: leaks CONFIG_SPARC64 to userspace where it is not valid - changed to use include as suggested - use preprocessor defined symbols to distingush between 32 and 64 bit Signed-off-by: Sam Ravnborg --- arch/sparc/include/asm/byteorder.h | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-) diff --git a/arch/sparc/include/asm/byteorder.h b/arch/sparc/include/asm/byteorder.h index 5a70f13..738414b 100644 --- a/arch/sparc/include/asm/byteorder.h +++ b/arch/sparc/include/asm/byteorder.h @@ -1,16 +1,12 @@ #ifndef _SPARC_BYTEORDER_H #define _SPARC_BYTEORDER_H -#include +#include #include #define __BIG_ENDIAN -#ifdef CONFIG_SPARC32 -#define __SWAB_64_THRU_32__ -#endif - -#ifdef CONFIG_SPARC64 +#if defined(__sparc__) && defined(__arch64__) static inline __u16 __arch_swab16p(const __u16 *addr) { __u16 ret; @@ -44,7 +40,9 @@ static inline __u64 __arch_swab64p(const __u64 *addr) } #define __arch_swab64p __arch_swab64p -#endif /* CONFIG_SPARC64 */ +#else +#define __SWAB_64_THRU_32__ +#endif /* defined(__sparc__) && defined(__arch64__) */ #include