openocd: fix SPDX tag format for files .c
[fw/openocd] / src / flash / nand / mx3.c
index abeaf159cc2e0d4354587a251e32188dd2894482..86e94685b7d2758a801ebcd0954ebabb871d6340 100644 (file)
@@ -1,21 +1,10 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 
 /***************************************************************************
  *   Copyright (C) 2009 by Alexei Babich                                   *
  *   Rezonans plc., Chelyabinsk, Russia                                    *
  *   impatt@mail.ru                                                        *
- *                                                                         *
- *   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/>. *
  ***************************************************************************/
 
 /*
@@ -40,7 +29,7 @@ get_next_halfword_from_sram_buffer() not tested
 static const char target_not_halted_err_msg[] =
                "target must be halted to use mx3 NAND flash controller";
 static const char data_block_size_err_msg[] =
-               "minimal granularity is one half-word, %" PRId32 " is incorrect";
+               "minimal granularity is one half-word, %" PRIu32 " is incorrect";
 static const char sram_buffer_bounds_err_msg[] =
                "trying to access out of SRAM buffer bound (addr=0x%" PRIx32 ")";
 static const char get_status_register_err_msg[] = "can't get NAND status";
@@ -64,7 +53,7 @@ NAND_DEVICE_COMMAND_HANDLER(imx31_nand_device_command)
 {
        struct mx3_nf_controller *mx3_nf_info;
        mx3_nf_info = malloc(sizeof(struct mx3_nf_controller));
-       if (mx3_nf_info == NULL) {
+       if (!mx3_nf_info) {
                LOG_ERROR("no memory for nand controller");
                return ERROR_FAIL;
        }