From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 12 Apr 2016 14:02:43 -0600 Subject: [U-Boot] [PATCH 06/44] sandbox: Add string and 16-bit I/O functions In-Reply-To: <1460256336-30436-7-git-send-email-sjg@chromium.org> References: <1460256336-30436-1-git-send-email-sjg@chromium.org> <1460256336-30436-7-git-send-email-sjg@chromium.org> Message-ID: <570D5463.3010208@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/09/2016 08:44 PM, Simon Glass wrote: > Add outsw() and insw() functions for sandbox, as these are needed by the IDE > code. The functions will not do anything useful if called, but allow the > code to be compiled. > diff --git a/arch/sandbox/include/asm/io.h b/arch/sandbox/include/asm/io.h > +static inline void _insw(volatile u16 *port, void *buf, int ns) > +{ > + u16 *data = (u16 *) buf; > + while (ns--) > + *data++ = *port; > +} > + > +static inline void _outsw(volatile u16 *port, const void *buf, int ns) > +{ > + u16 *data = (u16 *) buf; > + while (ns--) { > + *port = *data++; > + } > +} Why make those have anything other than an empty body if they don't need to do anything? The other functions in this file (e.g. out16/in16 added in this patch) are just no-ops. If those functions are called, they'll cause memory corruption or a crash. > +/* For systemace.c */ > +#define out16(addr, val) > +#define in16(addr) 0