From patchwork Mon Sep 26 18:48:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 116465 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2AD4AB6F7C for ; Tue, 27 Sep 2011 04:48:29 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA0F9284F1; Mon, 26 Sep 2011 20:48:27 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id u+XISGCcZ+2T; Mon, 26 Sep 2011 20:48:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 350D0284CD; Mon, 26 Sep 2011 20:48:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4618D284CD for ; Mon, 26 Sep 2011 20:48:24 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T871lZghN2t9 for ; Mon, 26 Sep 2011 20:48:23 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-bw0-f44.google.com (mail-bw0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 8A440284CA for ; Mon, 26 Sep 2011 20:48:21 +0200 (CEST) Received: by bkaq10 with SMTP id q10so5666552bka.3 for ; Mon, 26 Sep 2011 11:48:21 -0700 (PDT) Received: by 10.204.136.198 with SMTP id s6mr1251922bkt.131.1317062901532; Mon, 26 Sep 2011 11:48:21 -0700 (PDT) Received: from mashiro.ms.mff.cuni.cz (eduroam32.ms.mff.cuni.cz. [195.113.21.32]) by mx.google.com with ESMTPS id m18sm21821253bkt.12.2011.09.26.11.48.20 (version=SSLv3 cipher=OTHER); Mon, 26 Sep 2011 11:48:21 -0700 (PDT) From: Marek Vasut To: u-boot@lists.denx.de Date: Mon, 26 Sep 2011 20:48:15 +0200 Message-Id: <1317062895-3847-1-git-send-email-marek.vasut@gmail.com> X-Mailer: git-send-email 1.7.5.4 Subject: [U-Boot] [PATCH] ARM: Convert {in,out}s[bwl] to inline functions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The size of uboot binary grows by a few bytes, but the gain (better type checking) is worth it. Signed-off-by: Marek Vasut Cc: Wolfgang Denk Cc: Nick Thompson Cc: Simon Glass Reviewed-by: Nick Thompson --- arch/arm/include/asm/io.h | 34 ++++++++++++++++++++++++++++------ 1 files changed, 28 insertions(+), 6 deletions(-) diff --git a/arch/arm/include/asm/io.h b/arch/arm/include/asm/io.h index 61f4987..d22325d 100644 --- a/arch/arm/include/asm/io.h +++ b/arch/arm/include/asm/io.h @@ -255,13 +255,35 @@ extern inline void __raw_readsl(unsigned int addr, void *data, int longlen) #define inw(p) ({ unsigned int __v = le16_to_cpu(__raw_readw(__io(p))); __v; }) #define inl(p) ({ unsigned int __v = le32_to_cpu(__raw_readl(__io(p))); __v; }) -#define outsb(p,d,l) __raw_writesb(__io(p),d,l) -#define outsw(p,d,l) __raw_writesw(__io(p),d,l) -#define outsl(p,d,l) __raw_writesl(__io(p),d,l) +extern inline void outsb(unsigned int addr, const void *data, int bytelen) +{ + __raw_writesb(addr, data, bytelen); +} + +extern inline void outsw(unsigned int addr, const void *data, int wordlen) +{ + __raw_writesw(addr, data, wordlen); +} + +extern inline void outsl(unsigned int addr, const void *data, int longlen) +{ + __raw_writesl(addr, data, longlen); +} -#define insb(p,d,l) __raw_readsb(__io(p),d,l) -#define insw(p,d,l) __raw_readsw(__io(p),d,l) -#define insl(p,d,l) __raw_readsl(__io(p),d,l) +extern inline void insb(unsigned int addr, void *data, int bytelen) +{ + __raw_readsb(addr, data, bytelen); +} + +extern inline void insw(unsigned int addr, void *data, int wordlen) +{ + __raw_readsw(addr, data, wordlen); +} + +extern inline void insl(unsigned int addr, void *data, int longlen) +{ + __raw_readsl(addr, data, longlen); +} #endif #define outb_p(val,port) outb((val),(port))