global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
parent
231ad202ee
commit
cbf31bca5c
25 changed files with 188 additions and 124 deletions
|
|
@ -50,6 +50,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration */
|
||||
|
||||
#undef HAVE_KERNEL_HEAP
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@
|
|||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration */
|
||||
|
||||
#undef HAVE_KERNEL_HEAP
|
||||
|
|
|
|||
|
|
@ -455,7 +455,9 @@ static struct usbhost_cdcacm_s g_prealloc[CONFIG_USBHOST_CDCACM_NPREALLOC];
|
|||
static FAR struct usbhost_freestate_s *g_freelist;
|
||||
#endif
|
||||
|
||||
/* This is a bitmap that is used to allocate device minor numbers /dev/ttyACM[n]. */
|
||||
/* This is a bitmap that is used to allocate device
|
||||
* minor numbers /dev/ttyACM[n].
|
||||
*/
|
||||
|
||||
static uint32_t g_devinuse;
|
||||
|
||||
|
|
@ -1109,7 +1111,9 @@ static void usbhost_rxdata_work(FAR void *arg)
|
|||
while (priv->rxena && !priv->disconnected)
|
||||
#endif
|
||||
{
|
||||
/* Stop now if there is no room for another character in the RX buffer. */
|
||||
/* Stop now if there is no room for another
|
||||
* character in the RX buffer.
|
||||
*/
|
||||
|
||||
if (nexthead == rxbuf->tail)
|
||||
{
|
||||
|
|
@ -1938,11 +1942,15 @@ usbhost_create(FAR struct usbhost_hubport_s *hport,
|
|||
priv->usbclass.connect = usbhost_connect;
|
||||
priv->usbclass.disconnected = usbhost_disconnected;
|
||||
|
||||
/* The initial reference count is 1... One reference is held by the driver */
|
||||
/* The initial reference count is 1...
|
||||
* One reference is held by the driver
|
||||
*/
|
||||
|
||||
priv->crefs = 1;
|
||||
|
||||
/* Initialize semaphores (this works okay in the interrupt context) */
|
||||
/* Initialize semaphores
|
||||
* (this works okay in the interrupt context)
|
||||
*/
|
||||
|
||||
nxsem_init(&priv->exclsem, 0, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -416,7 +416,9 @@ static const uint8_t encoding[USBHID_NUMENCODINGS] =
|
|||
KEYCODE_F11, KEYCODE_F12,
|
||||
KEYCODE_PRTSCRN, KEYCODE_SCROLLLOCK,
|
||||
|
||||
/* 0x48-0x4f: Pause,Insert,Home,PageUp,DeleteForward,End,PageDown,RightArrow */
|
||||
/* 0x48-0x4f: Pause,Insert,Home,PageUp,
|
||||
* DeleteForward,End,PageDown,RightArrow
|
||||
*/
|
||||
|
||||
KEYCODE_PAUSE, KEYCODE_INSERT,
|
||||
KEYCODE_HOME, KEYCODE_PAGEUP,
|
||||
|
|
@ -469,7 +471,9 @@ static const uint8_t encoding[USBHID_NUMENCODINGS] =
|
|||
KEYCODE_COPY, KEYCODE_PASTE,
|
||||
KEYCODE_FIND, KEYCODE_MUTE,
|
||||
|
||||
/* 0x80-0x87: VolUp,VolDown,LCapsLock,lNumLock,LScrollLock,,,=,International1 */
|
||||
/* 0x80-0x87: VolUp,VolDown,LCapsLock,lNumLock,LScrollLock,,,
|
||||
* =,International1
|
||||
*/
|
||||
|
||||
KEYCODE_VOLUP, KEYCODE_VOLDOWN,
|
||||
KEYCODE_LCAPSLOCK, KEYCODE_LNUMLOCK,
|
||||
|
|
@ -1481,7 +1485,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||
uinfo("Interface descriptor\n");
|
||||
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
||||
|
||||
/* Did we already find what we needed from a preceding interface? */
|
||||
/* Did we already find what we needed
|
||||
* from a preceding interface?
|
||||
*/
|
||||
|
||||
if ((found & USBHOST_RQDFOUND) == USBHOST_RQDFOUND)
|
||||
{
|
||||
|
|
@ -1605,7 +1611,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||
|
||||
if (found == USBHOST_ALLFOUND)
|
||||
{
|
||||
/* Yes.. then break out of the loop and use the preceding interface */
|
||||
/* Yes.. then break out of the loop
|
||||
* and use the preceding interface
|
||||
*/
|
||||
|
||||
done = true;
|
||||
}
|
||||
|
|
@ -1681,7 +1689,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||
char devname[DEV_NAMELEN];
|
||||
int ret;
|
||||
|
||||
/* Set aside a transfer buffer for exclusive use by the keyboard class driver */
|
||||
/* Set aside a transfer buffer for exclusive
|
||||
* use by the keyboard class driver
|
||||
*/
|
||||
|
||||
ret = usbhost_tdalloc(priv);
|
||||
if (ret < 0)
|
||||
|
|
@ -1731,7 +1741,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||
(FAR char * const *)NULL);
|
||||
if (priv->pollpid < 0)
|
||||
{
|
||||
/* Failed to started the poll thread... probably due to memory resources */
|
||||
/* Failed to started the poll thread...
|
||||
* probably due to memory resources
|
||||
*/
|
||||
|
||||
usbhost_givesem(&g_exclsem);
|
||||
ret = (int)priv->pollpid;
|
||||
|
|
|
|||
|
|
@ -237,7 +237,9 @@ struct usbhost_state_s
|
|||
|
||||
struct usbhost_class_s usbclass;
|
||||
|
||||
/* This is an instance of the USB host driver bound to this class instance */
|
||||
/* This is an instance of the USB host driver
|
||||
* bound to this class instance
|
||||
*/
|
||||
|
||||
struct usbhost_driver_s *drvr;
|
||||
|
||||
|
|
@ -1173,7 +1175,9 @@ static int usbhost_mouse_poll(int argc, char *argv[])
|
|||
|
||||
priv->sample.valid = true;
|
||||
|
||||
/* Indicate the availability of new sample data for this ID */
|
||||
/* Indicate the availability of new sample data
|
||||
* for this ID
|
||||
*/
|
||||
|
||||
priv->sample.id = priv->id;
|
||||
#else
|
||||
|
|
@ -1498,7 +1502,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||
uinfo("Interface descriptor\n");
|
||||
DEBUGASSERT(remaining >= USB_SIZEOF_IFDESC);
|
||||
|
||||
/* Did we already find what we needed from a preceding interface? */
|
||||
/* Did we already find what we needed from
|
||||
* a preceding interface?
|
||||
*/
|
||||
|
||||
if ((found & USBHOST_ALLFOUND) == USBHOST_ALLFOUND)
|
||||
{
|
||||
|
|
@ -1588,7 +1594,9 @@ static inline int usbhost_cfgdesc(FAR struct usbhost_state_s *priv,
|
|||
|
||||
if (found == USBHOST_ALLFOUND)
|
||||
{
|
||||
/* Yes.. then break out of the loop and use the preceding interface */
|
||||
/* Yes.. then break out of the loop
|
||||
* and use the preceding interface
|
||||
*/
|
||||
|
||||
done = true;
|
||||
}
|
||||
|
|
@ -1646,7 +1654,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||
char devname[DEV_NAMELEN];
|
||||
int ret;
|
||||
|
||||
/* Set aside a transfer buffer for exclusive use by the mouse class driver */
|
||||
/* Set aside a transfer buffer for exclusive
|
||||
* use by the mouse class driver
|
||||
*/
|
||||
|
||||
ret = usbhost_tdalloc(priv);
|
||||
if (ret < 0)
|
||||
|
|
@ -1696,7 +1706,9 @@ static inline int usbhost_devinit(FAR struct usbhost_state_s *priv)
|
|||
(FAR char * const *)NULL);
|
||||
if (priv->pollpid < 0)
|
||||
{
|
||||
/* Failed to started the poll thread... probably due to memory resources */
|
||||
/* Failed to started the poll thread...
|
||||
* probably due to memory resources
|
||||
*/
|
||||
|
||||
usbhost_givesem(&g_exclsem);
|
||||
ret = priv->pollpid;
|
||||
|
|
|
|||
|
|
@ -1241,7 +1241,9 @@ static inline int usbhost_initvolume(FAR struct usbhost_state_s *priv)
|
|||
|
||||
DEBUGASSERT(priv != NULL);
|
||||
|
||||
/* Set aside a transfer buffer for exclusive use by the mass storage driver */
|
||||
/* Set aside a transfer buffer for exclusive
|
||||
* use by the mass storage driver
|
||||
*/
|
||||
|
||||
ret = usbhost_talloc(priv);
|
||||
if (ret < 0)
|
||||
|
|
@ -1729,7 +1731,9 @@ static FAR struct usbhost_class_s *
|
|||
|
||||
priv->crefs = 1;
|
||||
|
||||
/* Initialize semaphores (this works okay in the interrupt context) */
|
||||
/* Initialize semaphores
|
||||
* (this works okay in the interrupt context)
|
||||
*/
|
||||
|
||||
nxsem_init(&priv->exclsem, 0, 1);
|
||||
|
||||
|
|
|
|||
|
|
@ -150,8 +150,8 @@ extern "C"
|
|||
#endif
|
||||
|
||||
#else
|
||||
/* Otherwise, the kernel-space allocators are declared in include/nuttx/mm/mm.h
|
||||
* and we can call them directly.
|
||||
/* Otherwise, the kernel-space allocators are declared in
|
||||
* include/nuttx/mm/mm.h and we can call them directly.
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
|
@ -168,6 +168,7 @@ extern "C"
|
|||
* unprivileged code.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Functions defined in group/group_malloc.c ********************************/
|
||||
|
||||
FAR void *group_malloc(FAR struct task_group_s *group, size_t nbytes);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/****************************************************************************
|
||||
* include/nuttx/mm/mm.h
|
||||
*
|
||||
* Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007-2009, 2013-2014, 2017 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -52,6 +53,7 @@
|
|||
****************************************************************************/
|
||||
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* If the MCU has a small (16-bit) address capability, then we will use
|
||||
* a smaller chunk header that contains 16-bit size/offset information.
|
||||
* We will also use the smaller header on MCUs with wider addresses if
|
||||
|
|
@ -111,6 +113,7 @@
|
|||
#endif
|
||||
|
||||
/* Chunk Header Definitions *************************************************/
|
||||
|
||||
/* These definitions define the characteristics of allocator
|
||||
*
|
||||
* MM_MIN_SHIFT is used to define MM_MIN_CHUNK.
|
||||
|
|
@ -185,10 +188,10 @@
|
|||
/* Determines the size of the chunk size/offset type */
|
||||
|
||||
#ifdef CONFIG_MM_SMALL
|
||||
typedef uint16_t mmsize_t;
|
||||
typedef uint16_t mmsize_t;
|
||||
# define MMSIZE_MAX UINT16_MAX
|
||||
#else
|
||||
typedef uint32_t mmsize_t;
|
||||
typedef uint32_t mmsize_t;
|
||||
# define MMSIZE_MAX UINT32_MAX
|
||||
#endif
|
||||
|
||||
|
|
@ -366,12 +369,12 @@ void mm_takesemaphore(FAR struct mm_heap_s *heap);
|
|||
int mm_trysemaphore(FAR struct mm_heap_s *heap);
|
||||
void mm_givesemaphore(FAR struct mm_heap_s *heap);
|
||||
|
||||
/* Functions contained in umm_sem.c ****************************************/
|
||||
/* Functions contained in umm_sem.c *****************************************/
|
||||
|
||||
int umm_trysemaphore(void);
|
||||
void umm_givesemaphore(void);
|
||||
|
||||
/* Functions contained in kmm_sem.c ****************************************/
|
||||
/* Functions contained in kmm_sem.c *****************************************/
|
||||
|
||||
#ifdef CONFIG_MM_KERNEL_HEAP
|
||||
int kmm_trysemaphore(void);
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@
|
|||
* (which runs at the lowest of priority and may not be appropriate
|
||||
* if memory reclamation is of high priority). If CONFIG_SCHED_HPWORK
|
||||
* is enabled, then the following options can also be used:
|
||||
* CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority queue's
|
||||
* thread pool. Default: 1
|
||||
* CONFIG_SCHED_HPNTHREADS - The number of thread in the high-priority
|
||||
* queue's thread pool. Default: 1
|
||||
* CONFIG_SCHED_HPWORKPRIORITY - The execution priority of the high-
|
||||
* priority worker thread. Default: 224
|
||||
* CONFIG_SCHED_HPWORKSTACKSIZE - The stack size allocated for the worker
|
||||
|
|
@ -379,8 +379,8 @@ int work_queue(int qid, FAR struct work_s *work, worker_t worker,
|
|||
*
|
||||
* Description:
|
||||
* Cancel previously queued work. This removes work from the work queue.
|
||||
* After work has been cancelled, it may be re-queue by calling work_queue()
|
||||
* again.
|
||||
* After work has been cancelled, it may be re-queue by calling
|
||||
* work_queue() again.
|
||||
*
|
||||
* Input Parameters:
|
||||
* qid - The work queue ID
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/****************************************************************************
|
||||
* libs/libc/misc/lib_stream.c
|
||||
*
|
||||
* Copyright (C) 2007, 2011, 2013-2014, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2007, 2011, 2013-2014, 2017 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
|
@ -89,7 +90,7 @@ void lib_stream_initialize(FAR struct task_group_s *group)
|
|||
/* Initialize each FILE structure */
|
||||
|
||||
for (i = 0; i < CONFIG_NFILE_STREAMS; i++)
|
||||
{
|
||||
{
|
||||
FAR struct file_struct *stream = &list->sl_streams[i];
|
||||
|
||||
/* Clear the IOB */
|
||||
|
|
|
|||
|
|
@ -151,7 +151,8 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem)
|
|||
* index past the tail chunk because it is always allocated.
|
||||
*/
|
||||
|
||||
andbeyond = (FAR struct mm_allocnode_s *)((FAR char *)next + next->size);
|
||||
andbeyond = (FAR struct mm_allocnode_s *)
|
||||
((FAR char *)next + next->size);
|
||||
|
||||
/* Remove the next node. There must be a predecessor,
|
||||
* but there may not be a successor node.
|
||||
|
|
@ -167,7 +168,8 @@ void mm_free(FAR struct mm_heap_s *heap, FAR void *mem)
|
|||
/* Then merge the two chunks */
|
||||
|
||||
node->size += next->size;
|
||||
andbeyond->preceding = node->size | (andbeyond->preceding & MM_ALLOC_BIT);
|
||||
andbeyond->preceding = node->size |
|
||||
(andbeyond->preceding & MM_ALLOC_BIT);
|
||||
next = (FAR struct mm_freenode_s *)andbeyond;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -203,7 +203,8 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||
{
|
||||
/* Get a pointer to the next node in physical memory */
|
||||
|
||||
next = (FAR struct mm_freenode_s *)(((FAR char *)node) + node->size);
|
||||
next = (FAR struct mm_freenode_s *)
|
||||
(((FAR char *)node) + node->size);
|
||||
|
||||
/* Create the remainder node */
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,10 @@
|
|||
# include <nuttx/irq.h>
|
||||
#endif
|
||||
|
||||
#ifdef MONITOR_MM_SEMAPHORE
|
||||
# include <debug.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
|
@ -86,7 +90,6 @@
|
|||
/* Define MONITOR_MM_SEMAPHORE to enable semaphore state monitoring */
|
||||
|
||||
#ifdef MONITOR_MM_SEMAPHORE
|
||||
# include <debug.h>
|
||||
# define msemerr _err
|
||||
# define msemwarn _warn
|
||||
# define mseminfo _info
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ void bluetooth_container_initialize(void)
|
|||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A reference to the allocated container structure. All user fields in this
|
||||
* structure have been zeroed. On a failure to allocate, NULL is
|
||||
* returned.
|
||||
* A reference to the allocated container structure.
|
||||
* All user fields in this structure have been zeroed.
|
||||
* On a failure to allocate, NULL is returned.
|
||||
*
|
||||
* Assumptions:
|
||||
* The caller has locked the network.
|
||||
|
|
|
|||
|
|
@ -130,9 +130,9 @@ void ieee802154_container_initialize(void)
|
|||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A reference to the allocated container structure. All user fields in this
|
||||
* structure have been zeroed. On a failure to allocate, NULL is
|
||||
* returned.
|
||||
* A reference to the allocated container structure.
|
||||
* All user fields in this structure have been zeroed.
|
||||
* On a failure to allocate, NULL is returned.
|
||||
*
|
||||
* Assumptions:
|
||||
* The caller has locked the network.
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
* net/igmp/igmp_group.c
|
||||
* IGMP group data structure management logic
|
||||
*
|
||||
* Copyright (C) 2010, 2013-2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013-2014, 2016, 2018 Gregory Nutt.
|
||||
* All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* The NuttX implementation of IGMP was inspired by the IGMP add-on for the
|
||||
|
|
@ -20,21 +21,21 @@
|
|||
* 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 of CITEL Technologies Ltd nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of CITEL Technologies Ltd 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 CITEL TECHNOLOGIES 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 CITEL TECHNOLOGIES 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.
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
@ -224,7 +225,8 @@ FAR struct igmp_group_s *igmp_grpallocfind(FAR struct net_driver_s *dev,
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void igmp_grpfree(FAR struct net_driver_s *dev, FAR struct igmp_group_s *group)
|
||||
void igmp_grpfree(FAR struct net_driver_s *dev,
|
||||
FAR struct igmp_group_s *group)
|
||||
{
|
||||
grpinfo("Free: %p flags: %02x\n", group, group->flags);
|
||||
|
||||
|
|
|
|||
|
|
@ -14,21 +14,21 @@
|
|||
* 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 of CITEL Technologies Ltd nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
* 3. Neither the name of CITEL Technologies Ltd 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 CITEL TECHNOLOGIES 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 CITEL TECHNOLOGIES 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.
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@
|
|||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* The g_free_reass is a list of reassembly buffer structures that are available for
|
||||
* general use. The number of messages in this list is a system configuration
|
||||
* item. Protected only by the network lock.
|
||||
/* The g_free_reass is a list of reassembly buffer structures that are
|
||||
* available for general use. The number of messages in this list is a
|
||||
* system configuration item. Protected only by the network lock.
|
||||
*/
|
||||
|
||||
static FAR struct sixlowpan_reassbuf_s *g_free_reass;
|
||||
|
|
@ -75,7 +75,8 @@ static FAR struct sixlowpan_reassbuf_s *g_active_reass;
|
|||
|
||||
/* Pool of pre-allocated reassembly buffer structures */
|
||||
|
||||
static struct sixlowpan_reassbuf_s g_metadata_pool[CONFIG_NET_6LOWPAN_NREASSBUF];
|
||||
static struct sixlowpan_reassbuf_s
|
||||
g_metadata_pool[CONFIG_NET_6LOWPAN_NREASSBUF];
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
|
|
@ -98,7 +99,7 @@ static struct sixlowpan_reassbuf_s g_metadata_pool[CONFIG_NET_6LOWPAN_NREASSBUF]
|
|||
****************************************************************************/
|
||||
|
||||
static bool sixlowpan_compare_fragsrc(FAR struct sixlowpan_reassbuf_s *reass,
|
||||
FAR const struct netdev_varaddr_s *fragsrc)
|
||||
FAR const struct netdev_varaddr_s *fragsrc)
|
||||
{
|
||||
/* The addresses cannot match if they are not the same size */
|
||||
|
||||
|
|
@ -245,8 +246,8 @@ void sixlowpan_reass_initialize(void)
|
|||
FAR struct sixlowpan_reassbuf_s *reass;
|
||||
int i;
|
||||
|
||||
/* Initialize g_free_reass, the list of reassembly buffer structures that are
|
||||
* available for allocation.
|
||||
/* Initialize g_free_reass, the list of reassembly buffer structures that
|
||||
* are available for allocation.
|
||||
*/
|
||||
|
||||
g_free_reass = NULL;
|
||||
|
|
@ -314,8 +315,8 @@ FAR struct sixlowpan_reassbuf_s *
|
|||
#ifdef CONFIG_NET_6LOWPAN_REASS_STATIC
|
||||
reass = NULL;
|
||||
#else
|
||||
/* If we cannot get a reassembly buffer instance from the free list, then we
|
||||
* will have to allocate one from the kernel memory pool.
|
||||
/* If we cannot get a reassembly buffer instance from the free list,
|
||||
* then we will have to allocate one from the kernel memory pool.
|
||||
*/
|
||||
|
||||
reass = (FAR struct sixlowpan_reassbuf_s *)
|
||||
|
|
@ -428,8 +429,8 @@ void sixlowpan_reass_free(FAR struct sixlowpan_reassbuf_s *reass)
|
|||
|
||||
sixlowpan_remove_active(reass);
|
||||
|
||||
/* If this is a pre-allocated reassembly buffer structure, then just put it back
|
||||
* in the free list.
|
||||
/* If this is a pre-allocated reassembly buffer structure, then just put it
|
||||
* back in the free list.
|
||||
*/
|
||||
|
||||
if (reass->rb_pool == REASS_POOL_PREALLOCATED)
|
||||
|
|
|
|||
|
|
@ -311,7 +311,8 @@ static inline void group_release(FAR struct task_group_s *group)
|
|||
****************************************************************************/
|
||||
|
||||
#ifdef HAVE_GROUP_MEMBERS
|
||||
static inline void group_removemember(FAR struct task_group_s *group, pid_t pid)
|
||||
static inline void group_removemember(FAR struct task_group_s *group,
|
||||
pid_t pid)
|
||||
{
|
||||
irqstate_t flags;
|
||||
int i;
|
||||
|
|
|
|||
|
|
@ -193,7 +193,9 @@ volatile dq_queue_t g_waitingforfill;
|
|||
#endif
|
||||
|
||||
#ifdef CONFIG_SIG_SIGSTOP_ACTION
|
||||
/* This is the list of all tasks that have been stopped via SIGSTOP or SIGSTP */
|
||||
/* This is the list of all tasks that have been stopped
|
||||
* via SIGSTOP or SIGSTP
|
||||
*/
|
||||
|
||||
volatile dq_queue_t g_stoppedtasks;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -94,10 +94,10 @@ static const char g_pthreadname[] = "<pthread>";
|
|||
* This functions sets up parameters in the Task Control Block (TCB) in
|
||||
* preparation for starting a new thread.
|
||||
*
|
||||
* pthread_argsetup() is called from task_init() and nxtask_start() to create
|
||||
* a new task (with arguments cloned via strdup) or pthread_create() which
|
||||
* has one argument passed by value (distinguished by the pthread boolean
|
||||
* argument).
|
||||
* pthread_argsetup() is called from task_init() and nxtask_start() to
|
||||
* create a new task (with arguments cloned via strdup) or pthread_create()
|
||||
* which has one argument passed by value (distinguished by the pthread
|
||||
* boolean argument).
|
||||
*
|
||||
* Input Parameters:
|
||||
* tcb - Address of the new task's TCB
|
||||
|
|
@ -260,7 +260,8 @@ int pthread_create(FAR pthread_t *thread, FAR const pthread_attr_t *attr,
|
|||
|
||||
/* Allocate a TCB for the new task. */
|
||||
|
||||
ptcb = (FAR struct pthread_tcb_s *)kmm_zalloc(sizeof(struct pthread_tcb_s));
|
||||
ptcb = (FAR struct pthread_tcb_s *)
|
||||
kmm_zalloc(sizeof(struct pthread_tcb_s));
|
||||
if (!ptcb)
|
||||
{
|
||||
serr("ERROR: Failed to allocate TCB\n");
|
||||
|
|
|
|||
|
|
@ -1037,7 +1037,9 @@ int sched_sporadic_resume(FAR struct tcb_s *tcb)
|
|||
|
||||
unrealized = now - sporadic->eventtime;
|
||||
|
||||
/* Ignore very short pre-emptions that are below our timing resolution. */
|
||||
/* Ignore very short pre-emptions that are below
|
||||
* our timing resolution.
|
||||
*/
|
||||
|
||||
if (unrealized > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -12,30 +12,31 @@
|
|||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* 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.
|
||||
* 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 of the copyright holder nor the names of its
|
||||
* contributors may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
* 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 HOLDER 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.
|
||||
* 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 HOLDER 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.
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
|
|
@ -300,7 +301,8 @@ FAR struct bt_buf_s *bt_buf_alloc(enum bt_buf_type_e type,
|
|||
*/
|
||||
|
||||
leave_critical_section(flags);
|
||||
buf = (FAR struct bt_buf_s *)kmm_malloc((sizeof (struct bt_buf_s)));
|
||||
buf = (FAR struct bt_buf_s *)
|
||||
kmm_malloc((sizeof (struct bt_buf_s)));
|
||||
|
||||
/* Check if we successfully allocated the buffer structure */
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,10 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* NOTE: The CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE options is marked as marked
|
||||
* 'experimental' and with the default 0 zero because there are no interrupt
|
||||
* level allocations performed by the current IEEE 802.15.4 MAC code.
|
||||
/* NOTE: The CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE options is marked as
|
||||
* marked 'experimental' and with the default 0 zero because there are no
|
||||
* interrupt level allocations performed by the current IEEE 802.15.4 MAC
|
||||
* code.
|
||||
*/
|
||||
|
||||
#if !defined(CONFIG_IEEE802154_PRIMITIVE_PREALLOC) || \
|
||||
|
|
@ -101,8 +102,8 @@ struct ieee802154_priv_primitive_s
|
|||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0
|
||||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
||||
/* The g_primfree is a list of primitive structures that are available for
|
||||
* general use. The number of messages in this list is a system configuration
|
||||
* item.
|
||||
* general use. The number of messages in this list is a system
|
||||
* configuration item.
|
||||
*/
|
||||
|
||||
static struct ieee802154_priv_primitive_s *g_primfree;
|
||||
|
|
@ -118,7 +119,8 @@ static struct ieee802154_priv_primitive_s *g_primfree_irq;
|
|||
|
||||
/* Pool of pre-allocated primitive structures */
|
||||
|
||||
static struct ieee802154_priv_primitive_s g_primpool[CONFIG_IEEE802154_PRIMITIVE_PREALLOC];
|
||||
static struct ieee802154_priv_primitive_s
|
||||
g_primpool[CONFIG_IEEE802154_PRIMITIVE_PREALLOC];
|
||||
#endif /* CONFIG_IEEE802154_PRIMITIVE_PREALLOC > 0 */
|
||||
|
||||
static bool g_poolinit = false;
|
||||
|
|
@ -159,8 +161,8 @@ void ieee802154_primitivepool_initialize(void)
|
|||
int remaining = CONFIG_IEEE802154_PRIMITIVE_PREALLOC;
|
||||
|
||||
#if CONFIG_IEEE802154_PRIMITIVE_PREALLOC > CONFIG_IEEE802154_PRIMITIVE_IRQRESERVE
|
||||
/* Initialize g_primfree, the list of primitive structures that are available
|
||||
* for general use.
|
||||
/* Initialize g_primfree, the list of primitive structures that are
|
||||
* available for general use.
|
||||
*/
|
||||
|
||||
g_primfree = NULL;
|
||||
|
|
@ -228,9 +230,9 @@ void ieee802154_primitivepool_initialize(void)
|
|||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A reference to the allocated primitive structure. All user fields in this
|
||||
* structure have been zeroed. On a failure to allocate, NULL is
|
||||
* returned.
|
||||
* A reference to the allocated primitive structure.
|
||||
* All user fields in this structure have been zeroed.
|
||||
* On a failure to allocate, NULL is returned.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
@ -317,7 +319,9 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Remember that this primitive structure was dynamically allocated */
|
||||
/* Remember that this primitive structure
|
||||
* was dynamically allocated
|
||||
*/
|
||||
|
||||
pool = POOL_PRIMITIVE_DYNAMIC;
|
||||
}
|
||||
|
|
@ -341,8 +345,8 @@ FAR struct ieee802154_primitive_s *ieee802154_primitive_allocate(void)
|
|||
* Name: ieee802154_primitive_free
|
||||
*
|
||||
* Description:
|
||||
* The ieee802154_primitive_free function will return a primitive structure to
|
||||
* the free pool of messages if it was a pre-allocated primitive
|
||||
* The ieee802154_primitive_free function will return a primitive structure
|
||||
* to the free pool of messages if it was a pre-allocated primitive
|
||||
* structure. If the primitive structure was allocated dynamically it will
|
||||
* be deallocated.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@
|
|||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/* The g_free_metadata is a list of meta-data structures that are available for
|
||||
* general use. The number of messages in this list is a system configuration
|
||||
* item.
|
||||
/* The g_free_metadata is a list of meta-data structures that are available
|
||||
* for general use. The number of messages in this list is a system
|
||||
* configuration item.
|
||||
*/
|
||||
|
||||
static FAR struct pktradio_metadata_s *g_free_metadata;
|
||||
|
|
@ -140,8 +140,8 @@ void pktradio_metadata_initialize(void)
|
|||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* A reference to the allocated metadata structure. All user fields in this
|
||||
* structure have been zeroed. On a failure to allocate, NULL is
|
||||
* A reference to the allocated metadata structure. All user fields in
|
||||
* this structure have been zeroed. On a failure to allocate, NULL is
|
||||
* returned.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
|
@ -185,10 +185,10 @@ FAR struct pktradio_metadata_s *pktradio_metadata_allocate(void)
|
|||
|
||||
if (metadata != NULL)
|
||||
{
|
||||
/* Zero and tag the allocated meta-data structure. */
|
||||
/* Zero and tag the allocated meta-data structure. */
|
||||
|
||||
memset(metadata, 0, sizeof(struct pktradio_metadata_s));
|
||||
metadata->pm_pool = pool;
|
||||
memset(metadata, 0, sizeof(struct pktradio_metadata_s));
|
||||
metadata->pm_pool = pool;
|
||||
}
|
||||
|
||||
return metadata;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue