openocd: src/rtos: replace the GPL-2.0-or-later license tag
[fw/openocd] / src / rtos / nuttx.c
index c52547120c1383688324520d6c9819bbab2fdada..3afad3d029f55f8cd8d1a51e3852381ed29d07be 100644 (file)
@@ -1,20 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
 /***************************************************************************
  *   Copyright 2016,2017 Sony Video & Sound Products Inc.                  *
  *   Masatoshi Tateishi - Masatoshi.Tateishi@jp.sony.com                   *
  *   Masayuki Ishikawa - Masayuki.Ishikawa@jp.sony.com                     *
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- *   This program is distributed in the hope that it will be useful,       *
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
- *   GNU General Public License for more details.                          *
- *                                                                         *
- *   You should have received a copy of the GNU General Public License     *
- *   along with this program.  If not, see <http://www.gnu.org/licenses/>. *
  ***************************************************************************/
 
 #ifdef HAVE_CONFIG_H
@@ -119,11 +108,10 @@ static const struct stack_register_offset nuttx_stack_offsets_cortex_m[] = {
 
 
 static const struct rtos_register_stacking nuttx_stacking_cortex_m = {
-       0x48,                                   /* stack_registers_size */
-       -1,                                     /* stack_growth_direction */
-       17,                                     /* num_output_registers */
-       0,                                      /* stack_alignment */
-       nuttx_stack_offsets_cortex_m   /* register_offsets */
+       .stack_registers_size = 0x48,
+       .stack_growth_direction = -1,
+       .num_output_registers = 17,
+       .register_offsets = nuttx_stack_offsets_cortex_m
 };
 
 static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[] = {
@@ -147,11 +135,10 @@ static const struct stack_register_offset nuttx_stack_offsets_cortex_m_fpu[] = {
 };
 
 static const struct rtos_register_stacking nuttx_stacking_cortex_m_fpu = {
-       0x8c,                                   /* stack_registers_size */
-       -1,                                     /* stack_growth_direction */
-       17,                                     /* num_output_registers */
-       0,                                      /* stack_alignment */
-       nuttx_stack_offsets_cortex_m_fpu        /* register_offsets */
+       .stack_registers_size = 0x8c,
+       .stack_growth_direction = -1,
+       .num_output_registers = 17,
+       .register_offsets = nuttx_stack_offsets_cortex_m_fpu
 };
 
 static int pid_offset = PID;
@@ -233,7 +220,7 @@ retok:
 
 static bool nuttx_detect_rtos(struct target *target)
 {
-       if ((target->rtos->symbols != NULL) &&
+       if ((target->rtos->symbols) &&
                        (target->rtos->symbols[0].address != 0) &&
                        (target->rtos->symbols[1].address != 0)) {
                return true;
@@ -259,7 +246,7 @@ static int nuttx_update_threads(struct rtos *rtos)
        uint32_t i;
        uint8_t state;
 
-       if (rtos->symbols == NULL) {
+       if (!rtos->symbols) {
                LOG_ERROR("No symbols for NuttX");
                return -3;
        }