flash/nor/rp2040: make SPI flash ID detection optional
[openocd.git] / src / flash / nor / str9xpec.c
index 1d9e59e822b0d45a70c9b7d6504527027f13ad15..c39eb3aa84da81ab8964bb01d31c4138a4722592 100644 (file)
@@ -1,22 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+
 /***************************************************************************
  *   Copyright (C) 2005 by Dominic Rath                                    *
  *   Dominic.Rath@gmx.de                                                   *
  *                                                                         *
  *   Copyright (C) 2008 by Spencer Oliver                                  *
  *   spen@spen-soft.co.uk                                                  *
- *                                                                         *
- *   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
@@ -81,7 +70,7 @@ static int str9xpec_write_options(struct flash_bank *bank);
 
 static int str9xpec_set_instr(struct jtag_tap *tap, uint32_t new_instr, tap_state_t end_state)
 {
-       if (tap == NULL)
+       if (!tap)
                return ERROR_TARGET_INVALID;
 
        if (buf_get_u32(tap->cur_instr, 0, tap->ir_length) != new_instr) {
@@ -1043,19 +1032,19 @@ COMMAND_HANDLER(str9xpec_handle_flash_enable_turbo_command)
 
        /* remove arm core from chain - enter turbo mode */
        tap0 = str9xpec_info->tap;
-       if (tap0 == NULL) {
+       if (!tap0) {
                /* things are *WRONG* */
                command_print(CMD, "**STR9FLASH** (tap0) invalid chain?");
                return ERROR_FAIL;
        }
        tap1 = tap0->next_tap;
-       if (tap1 == NULL) {
+       if (!tap1) {
                /* things are *WRONG* */
                command_print(CMD, "**STR9FLASH** (tap1) invalid chain?");
                return ERROR_FAIL;
        }
        tap2 = tap1->next_tap;
-       if (tap2 == NULL) {
+       if (!tap2) {
                /* things are *WRONG* */
                command_print(CMD, "**STR9FLASH** (tap2) invalid chain?");
                return ERROR_FAIL;
@@ -1089,7 +1078,7 @@ COMMAND_HANDLER(str9xpec_handle_flash_disable_turbo_command)
        str9xpec_info = bank->driver_priv;
        tap = str9xpec_info->tap;
 
-       if (tap == NULL)
+       if (!tap)
                return ERROR_FAIL;
 
        /* exit turbo mode via RESET */

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)