From 352c313fa71bbc8f58292ebe26a01ea1d8b3b4f3 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 12 Jul 2013 07:09:24 -0600 Subject: [PATCH] Fix typo/compilation error with USB device DMA memory allocation is enabled --- ChangeLog | 3 +++ include/nuttx/usb/usbdev.h | 14 +++++++------- include/signal.h | 31 ++++++++++++++++--------------- libc/misc/lib_crc16.c | 2 -- 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4bb840723..686b517cdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5126,3 +5126,6 @@ transfers (From Chia Cheng Tsao, 2013-7-8) * drivers/rwbuffer.c: SourceForge bug #17: Correct typos that can cause failures in some configurations (From Chia Cheng Tsao, 2013-7-8). + * include/nuttx/usb/usbdev.h: Fix some typos that cause compiler errors + when CONFIG_USBDEV_DMA and CONFIG_USBDEV_DMAMEMORY are selected (From + Chia Cheng Tsao, 2013-7-12). diff --git a/include/nuttx/usb/usbdev.h b/include/nuttx/usb/usbdev.h index 7d47055d74..6cf3d46f91 100644 --- a/include/nuttx/usb/usbdev.h +++ b/include/nuttx/usb/usbdev.h @@ -1,7 +1,7 @@ /************************************************************************************ * include/nuttx/usb/usbdev.h * - * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * NOTE: This interface was inspired by the Linux gadget interface by @@ -86,8 +86,8 @@ /* Allocate/free an I/O buffer. Should not be called from interrupt processing! */ #ifdef CONFIG_USBDEV_DMA -# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->alloc(ep,nb) -# define EP_FREEBUFFER(ep,buff) (ep)->ops->free(ep,buf) +# define EP_ALLOCBUFFER(ep,nb) (ep)->ops->allocbuffer(ep,nb) +# define EP_FREEBUFFER(ep,buf) (ep)->ops->freebuffer(ep,buf) #else # define EP_ALLOCBUFFER(ep,nb) malloc(nb) # define EP_FREEBUFFER(ep,buf) free(buf) @@ -340,7 +340,7 @@ extern "C" * ************************************************************************************/ -EXTERN int usbdev_register(FAR struct usbdevclass_driver_s *driver); +int usbdev_register(FAR struct usbdevclass_driver_s *driver); /************************************************************************************ * Name: usbdev_unregister @@ -352,7 +352,7 @@ EXTERN int usbdev_register(FAR struct usbdevclass_driver_s *driver); * ************************************************************************************/ -EXTERN int usbdev_unregister(FAR struct usbdevclass_driver_s *driver); +int usbdev_unregister(FAR struct usbdevclass_driver_s *driver); /**************************************************************************** * Name: usbdev_dma_alloc and usbdev_dma_free @@ -381,8 +381,8 @@ EXTERN int usbdev_unregister(FAR struct usbdevclass_driver_s *driver); ****************************************************************************/ #if defined(CONFIG_USBDEV_DMA) && defined(CONFIG_USBDEV_DMAMEMORY) -EXTERN FAR void *usbdev_dma_alloc(size_t size); -EXTERN void usbdev_dma_free(FAR void *memory); +FAR void *usbdev_dma_alloc(size_t size); +void usbdev_dma_free(FAR void *memory); #endif #undef EXTERN diff --git a/include/signal.h b/include/signal.h index a31e62ff2b..271328da71 100644 --- a/include/signal.h +++ b/include/signal.h @@ -246,23 +246,24 @@ extern "C" { #define EXTERN extern #endif -EXTERN int kill(pid_t, int); -EXTERN int sigemptyset(FAR sigset_t *set); -EXTERN int sigfillset(FAR sigset_t *set); -EXTERN int sigaddset(FAR sigset_t *set, int signo); -EXTERN int sigdelset(FAR sigset_t *set, int signo); -EXTERN int sigismember(FAR const sigset_t *set, int signo); -EXTERN int sigaction(int sig, FAR const struct sigaction *act, FAR struct sigaction *oact); -EXTERN int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); -EXTERN int sigpending(FAR sigset_t *set); -EXTERN int sigsuspend(FAR const sigset_t *sigmask); -EXTERN int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); -EXTERN int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value, - FAR const struct timespec *timeout); +int kill(pid_t, int); +int sigemptyset(FAR sigset_t *set); +int sigfillset(FAR sigset_t *set); +int sigaddset(FAR sigset_t *set, int signo); +int sigdelset(FAR sigset_t *set, int signo); +int sigismember(FAR const sigset_t *set, int signo); +int sigaction(int sig, FAR const struct sigaction *act, + FAR struct sigaction *oact); +int sigprocmask(int how, FAR const sigset_t *set, FAR sigset_t *oset); +int sigpending(FAR sigset_t *set); +int sigsuspend(FAR const sigset_t *sigmask); +int sigwaitinfo(FAR const sigset_t *set, FAR struct siginfo *value); +int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *value, + FAR const struct timespec *timeout); #ifdef CONFIG_CAN_PASS_STRUCTS -EXTERN int sigqueue(int pid, int signo, union sigval value); +int sigqueue(int pid, int signo, union sigval value); #else -EXTERN int sigqueue(int pid, int signo, FAR void *sival_ptr); +int sigqueue(int pid, int signo, FAR void *sival_ptr); #endif #undef EXTERN diff --git a/libc/misc/lib_crc16.c b/libc/misc/lib_crc16.c index 065c586ee3..76e8dac8a5 100644 --- a/libc/misc/lib_crc16.c +++ b/libc/misc/lib_crc16.c @@ -99,8 +99,6 @@ static uint16_t crc16_tab[256] = 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; -#define updcrc(cp, crc) ( crc16_tab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp) - /************************************************************************************************ * Public Functions ************************************************************************************************/