openocd: fix SPDX tag format for files .c
[fw/openocd] / src / flash / nor / numicro.c
index ce3973b9f331a3764be399a1b8b886b018d51161..1a73eb26d0f3a463e06d924a5a0409f33e8859c9 100644 (file)
@@ -1,3 +1,5 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /***************************************************************************
  *   Copyright (C) 2011 by James K. Larson                                 *
  *   jlarson@pacifier.com                                                  *
  *                                                                         *
  *   Copyright (C) 2015 Nemui Trinomius                                    *
  *   nemuisan_kawausogasuki@live.jp                                        *
- *                                                                         *
- *   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
@@ -1385,13 +1374,6 @@ static int numicro_writeblock(struct flash_bank *bank, const uint8_t *buffer,
        init_reg_param(&reg_params[1], "r1", 32, PARAM_OUT);    /* faddr */
        init_reg_param(&reg_params[2], "r2", 32, PARAM_OUT);    /* number of words to program */
 
-       struct armv7m_common *armv7m = target_to_armv7m(target);
-       if (!armv7m) {
-               /* something is very wrong if armv7m is NULL */
-               LOG_ERROR("unable to get armv7m target");
-               return retval;
-       }
-
        /* write code buffer and use Flash programming code within NuMicro     */
        /* Set breakpoint to 0 with time-out of 1000 ms                        */
        while (count > 0) {
@@ -1532,8 +1514,6 @@ static int numicro_erase(struct flash_bank *bank, unsigned int first,
                        retval = target_write_u32(target, NUMICRO_FLASH_ISPCON, (status | ISPCON_ISPFF));
                        if (retval != ERROR_OK)
                                return retval;
-               } else {
-                       bank->sectors[i].is_erased = 1;
                }
        }