From 4aaee6fb3c1720b1fce84cb2220fdb0b97a127b9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 28 Sep 2013 16:50:07 -0600 Subject: [PATCH] Clean up some naming: fd vs. fildes vs. filedes and filep vs filp --- arch/arm/src/c5471/c5471_watchdog.c | 10 +- arch/arm/src/common/up_exit.c | 6 +- arch/arm/src/lpc2378/lpc23xx_io.c | 202 ++++++++++++++-------------- arch/avr/src/common/up_exit.c | 6 +- arch/hc/src/common/up_exit.c | 6 +- arch/mips/src/common/up_exit.c | 6 +- arch/rgmp/src/bridge.c | 20 +-- arch/sh/src/common/up_exit.c | 6 +- arch/sim/src/up_devconsole.c | 8 +- arch/x86/src/common/up_exit.c | 6 +- arch/z16/src/common/up_exit.c | 6 +- arch/z80/src/common/up_exit.c | 6 +- 12 files changed, 144 insertions(+), 144 deletions(-) diff --git a/arch/arm/src/c5471/c5471_watchdog.c b/arch/arm/src/c5471/c5471_watchdog.c index 83563def7f..f9cf52244c 100644 --- a/arch/arm/src/c5471/c5471_watchdog.c +++ b/arch/arm/src/c5471/c5471_watchdog.c @@ -1,7 +1,7 @@ /************************************************************************** - * c5471/c5471_watchdog.c + * arch/arm/src/c5471/c5471_watchdog.c * - * Copyright (C) 2007, 2009, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -100,7 +100,7 @@ static int wdt_open(struct file *filep); static int wdt_close(struct file *filep); static ssize_t wdt_read(struct file *filep, char *buffer, size_t buflen); static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen); -static int wdt_ioctl(FAR struct file *filp, int cmd, unsigned long arg); +static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg); /************************************************************************** * Private Data @@ -190,7 +190,7 @@ static int wdt_setusec(uint32_t usec) if (divisor >= 0x10000) { if (prescaler == MAX_PRESCALER) - { + { /* This is the max possible ~2.5 seconds. */ dbg("prescaler=0x%x too big!\n", prescaler); @@ -289,7 +289,7 @@ static ssize_t wdt_write(struct file *filep, const char *buffer, size_t buflen) * Name: wdt_ioctl **************************************************************************/ -static int wdt_ioctl(FAR struct file *filp, int cmd, unsigned long arg) +static int wdt_ioctl(FAR struct file *filep, int cmd, unsigned long arg) { dbg("ioctl Call: cmd=0x%x arg=0x%x", cmd, arg); diff --git a/arch/arm/src/common/up_exit.c b/arch/arm/src/common/up_exit.c index 95a71f832a..34dc3138ae 100644 --- a/arch/arm/src/common/up_exit.c +++ b/arch/arm/src/common/up_exit.c @@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/arm/src/lpc2378/lpc23xx_io.c b/arch/arm/src/lpc2378/lpc23xx_io.c index 6f0474f09a..ff9ed418d8 100644 --- a/arch/arm/src/lpc2378/lpc23xx_io.c +++ b/arch/arm/src/lpc2378/lpc23xx_io.c @@ -1,101 +1,101 @@ -/*********************************************************************** - * arch/arm/src/arm/lpc2378/lpc23xx_head.S - * - * Copyright (C) 2010 Rommel Marcelo. All rights reserved. - * Author: Rommel Marcelo - * - * This file is part of the NuttX RTOS: - * - * Copyright (C) 2010 Gregory Nutt. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * 3. Neither the name NuttX nor the names of its contributors may be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS - * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED - * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN - * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - ***********************************************************************/ - -/*********************************************************************** - * Included files - ***********************************************************************/ - -#include "up_arch.h" -#include -#include "lpc23xx_scb.h" -#include "lpc23xx_pinsel.h" -#include "lpc23xx_uart.h" -#include "lpc23xx_gpio.h" - -/*********************************************************************** - * Definitions - ***********************************************************************/ - -/*********************************************************************** -* Name: IO_Init() -* -* Descriptions: Initialize the target board before running the main() -* -************************************************************************/ -void IO_Init( void ) -{ - uint32_t regval; - - /* Reset all GPIO pins to default */ - - pinsel_putreg(0, PINSEL0_OFFSET); - pinsel_putreg(0, PINSEL1_OFFSET); - pinsel_putreg(0, PINSEL2_OFFSET); - pinsel_putreg(0, PINSEL3_OFFSET); - pinsel_putreg(0, PINSEL4_OFFSET); - pinsel_putreg(0, PINSEL5_OFFSET); - pinsel_putreg(0, PINSEL6_OFFSET); - pinsel_putreg(0, PINSEL7_OFFSET); - pinsel_putreg(0, PINSEL8_OFFSET); - pinsel_putreg(0, PINSEL9_OFFSET); - pinsel_putreg(0, PINSEL10_OFFSET); - -/* - regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC | ); - scb_getreg(regval, SCB_PCONP_OFFSET ); -*/ - - /* Turn off all peripheral power */ - - scb_putreg(0, SCB_PCONP_OFFSET ); - - /* Turn on UART0/2 / Timer0 */ - /* regval = PCUART0 | PCUART2 | PCTIM0 | PCRTC ; */ - - regval = PCUART0 | PCUART2 | PCTIM0 ; - scb_putreg(regval , SCB_PCONP_OFFSET ); - - /* Status LED P1.19 */ - - dir_putreg8((1 << 3), FIO1DIR2_OFFSET); - - /* other io setup here */ - - return; -} +/*********************************************************************** + * arch/arm/src/arm/lpc2378/lpc23xx_head.S + * + * Copyright (C) 2010 Rommel Marcelo. All rights reserved. + * Author: Rommel Marcelo + * + * This file is part of the NuttX RTOS: + * + * Copyright (C) 2010 Gregory Nutt. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name NuttX nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ***********************************************************************/ + +/*********************************************************************** + * Included files + ***********************************************************************/ + +#include "up_arch.h" +#include +#include "lpc23xx_scb.h" +#include "lpc23xx_pinsel.h" +#include "lpc23xx_uart.h" +#include "lpc23xx_gpio.h" + +/*********************************************************************** + * Definitions + ***********************************************************************/ + +/*********************************************************************** +* Name: IO_Init() +* +* Descriptions: Initialize the target board before running the main() +* +************************************************************************/ +void IO_Init( void ) +{ + uint32_t regval; + + /* Reset all GPIO pins to default */ + + pinsel_putreg(0, PINSEL0_OFFSET); + pinsel_putreg(0, PINSEL1_OFFSET); + pinsel_putreg(0, PINSEL2_OFFSET); + pinsel_putreg(0, PINSEL3_OFFSET); + pinsel_putreg(0, PINSEL4_OFFSET); + pinsel_putreg(0, PINSEL5_OFFSET); + pinsel_putreg(0, PINSEL6_OFFSET); + pinsel_putreg(0, PINSEL7_OFFSET); + pinsel_putreg(0, PINSEL8_OFFSET); + pinsel_putreg(0, PINSEL9_OFFSET); + pinsel_putreg(0, PINSEL10_OFFSET); + +/* + regval = scb_getreg(SCB_PCONP_OFFSET) & ~(PCSDC | PCUART1 | PCI2C0 | PCSSP1 | PCEMC | ); + scb_getreg(regval, SCB_PCONP_OFFSET ); +*/ + + /* Turn off all peripheral power */ + + scb_putreg(0, SCB_PCONP_OFFSET ); + + /* Turn on UART0/2 / Timer0 */ + /* regval = PCUART0 | PCUART2 | PCTIM0 | PCRTC ; */ + + regval = PCUART0 | PCUART2 | PCTIM0 ; + scb_putreg(regval , SCB_PCONP_OFFSET ); + + /* Status LED P1.19 */ + + dir_putreg8((1 << 3), FIO1DIR2_OFFSET); + + /* other io setup here */ + + return; +} diff --git a/arch/avr/src/common/up_exit.c b/arch/avr/src/common/up_exit.c index 93ec7c487b..d2a4f85a98 100644 --- a/arch/avr/src/common/up_exit.c +++ b/arch/avr/src/common/up_exit.c @@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/hc/src/common/up_exit.c b/arch/hc/src/common/up_exit.c index c71bbafd13..e015cf1d52 100644 --- a/arch/hc/src/common/up_exit.c +++ b/arch/hc/src/common/up_exit.c @@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/mips/src/common/up_exit.c b/arch/mips/src/common/up_exit.c index 974bdc6131..41fe57a6d9 100644 --- a/arch/mips/src/common/up_exit.c +++ b/arch/mips/src/common/up_exit.c @@ -106,14 +106,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/rgmp/src/bridge.c b/arch/rgmp/src/bridge.c index 2d09448316..640e73788d 100644 --- a/arch/rgmp/src/bridge.c +++ b/arch/rgmp/src/bridge.c @@ -49,16 +49,17 @@ #include #include -struct bridge { +struct bridge +{ struct rgmp_bridge *b; sem_t rd_lock; sem_t wr_lock; }; -static ssize_t up_bridge_read(struct file *filp, char *buffer, size_t len) +static ssize_t up_bridge_read(struct file *filep, char *buffer, size_t len) { ssize_t ret; - struct bridge *b = filp->f_inode->i_private; + struct bridge *b = filep->f_inode->i_private; sem_wait(&b->rd_lock); ret = rgmp_bridge_read(b->b, buffer, len, 0); @@ -66,10 +67,10 @@ static ssize_t up_bridge_read(struct file *filp, char *buffer, size_t len) return ret; } -static ssize_t up_bridge_write(struct file *filp, const char *buffer, size_t len) +static ssize_t up_bridge_write(struct file *filep, const char *buffer, size_t len) { ssize_t ret; - struct bridge *b = filp->f_inode->i_private; + struct bridge *b = filep->f_inode->i_private; sem_wait(&b->wr_lock); ret = rgmp_bridge_write(b->b, (char *)buffer, len, 0); @@ -77,17 +78,18 @@ static ssize_t up_bridge_write(struct file *filp, const char *buffer, size_t len return ret; } -static int up_bridge_open(struct file *filp) +static int up_bridge_open(struct file *filep) { return 0; } -static int up_bridge_close(struct file *filp) +static int up_bridge_close(struct file *filep) { return 0; } -static const struct file_operations up_bridge_fops = { +static const struct file_operations up_bridge_fops = +{ .read = up_bridge_read, .write = up_bridge_write, .open = up_bridge_open, @@ -127,5 +129,3 @@ err1: err0: return -1; } - - diff --git a/arch/sh/src/common/up_exit.c b/arch/sh/src/common/up_exit.c index e454d1b643..d7de0154cd 100644 --- a/arch/sh/src/common/up_exit.c +++ b/arch/sh/src/common/up_exit.c @@ -105,14 +105,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/sim/src/up_devconsole.c b/arch/sim/src/up_devconsole.c index bd2be0f10f..07c4267191 100644 --- a/arch/sim/src/up_devconsole.c +++ b/arch/sim/src/up_devconsole.c @@ -1,7 +1,7 @@ /**************************************************************************** - * up_devconsole.c + * arch/sim/src/up_devconsole.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -78,12 +78,12 @@ static const struct file_operations devconsole_fops = * Private Functions ****************************************************************************/ -static ssize_t devconsole_read(struct file *filp, char *buffer, size_t len) +static ssize_t devconsole_read(struct file *filep, char *buffer, size_t len) { return up_hostread(buffer, len); } -static ssize_t devconsole_write(struct file *filp, const char *buffer, size_t len) +static ssize_t devconsole_write(struct file *filep, const char *buffer, size_t len) { return up_hostwrite(buffer, len); } diff --git a/arch/x86/src/common/up_exit.c b/arch/x86/src/common/up_exit.c index 9b0c0cbe10..424a89f4f1 100644 --- a/arch/x86/src/common/up_exit.c +++ b/arch/x86/src/common/up_exit.c @@ -104,14 +104,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 sdbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - sdbg(" fd=%d\n", filep->fs_filedes); + sdbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/z16/src/common/up_exit.c b/arch/z16/src/common/up_exit.c index e4c6dcf9c8..6f118fe249 100644 --- a/arch/z16/src/common/up_exit.c +++ b/arch/z16/src/common/up_exit.c @@ -106,14 +106,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 lldbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - lldbg(" fd=%d\n", filep->fs_filedes); + lldbg(" fd=%d\n", filep->fs_fd); #endif } } diff --git a/arch/z80/src/common/up_exit.c b/arch/z80/src/common/up_exit.c index aa578f29e5..d38e4fb030 100644 --- a/arch/z80/src/common/up_exit.c +++ b/arch/z80/src/common/up_exit.c @@ -107,14 +107,14 @@ static void _up_dumponexit(FAR struct tcb_s *tcb, FAR void *arg) for (i = 0; i < CONFIG_NFILE_STREAMS; i++) { struct file_struct *filep = &streamlist->sl_streams[i]; - if (filep->fs_filedes >= 0) + if (filep->fs_fd >= 0) { #if CONFIG_STDIO_BUFFER_SIZE > 0 lldbg(" fd=%d nbytes=%d\n", - filep->fs_filedes, + filep->fs_fd, filep->fs_bufpos - filep->fs_bufstart); #else - lldbg(" fd=%d\n", filep->fs_filedes); + lldbg(" fd=%d\n", filep->fs_fd); #endif } }