Skip to content

Commit

Permalink
global change: fix tools/checkpatch.sh warnnings
Browse files Browse the repository at this point in the history
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a
Signed-off-by: ligd <liguiding@fishsemi.com>
  • Loading branch information
GUIDINGLI authored and patacongo committed Apr 9, 2020
1 parent 231ad20 commit cbf31bc
Show file tree
Hide file tree
Showing 25 changed files with 189 additions and 125 deletions.
1 change: 1 addition & 0 deletions arch/arm/src/common/up_releasestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* Configuration */

#undef HAVE_KERNEL_HEAP
Expand Down
1 change: 1 addition & 0 deletions arch/or1k/src/common/up_releasestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/

/* Configuration */

#undef HAVE_KERNEL_HEAP
Expand Down
16 changes: 12 additions & 4 deletions drivers/usbhost/usbhost_cdcacm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);

Expand Down
24 changes: 18 additions & 6 deletions drivers/usbhost/usbhost_hidkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
24 changes: 18 additions & 6 deletions drivers/usbhost/usbhost_hidmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions drivers/usbhost/usbhost_storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);

Expand Down
5 changes: 3 additions & 2 deletions include/nuttx/kmalloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand Down
13 changes: 8 additions & 5 deletions include/nuttx/mm/mm.h
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions include/nuttx/wqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions libs/libc/misc/lib_stream.c
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 4 additions & 2 deletions mm/mm_heap/mm_free.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion mm/mm_heap/mm_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down
5 changes: 4 additions & 1 deletion mm/mm_heap/mm_sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@
# include <nuttx/irq.h>
#endif

#ifdef MONITOR_MM_SEMAPHORE
# include <debug.h>
#endif

/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions net/bluetooth/bluetooth_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions net/ieee802154/ieee802154_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit cbf31bc

Please sign in to comment.