mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
global change: fix tools/checkpatch.sh warnnings
Change-Id: I88cfa979c44bcaf3a8f6e036c6bfccd3402ca85a Signed-off-by: ligd <liguiding@fishsemi.com>
This commit is contained in:
+20
-18
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user