Antonio Borneo [Mon, 10 Apr 2023 10:02:55 +0000 (12:02 +0200)]
checkpatch: exclude gerrit's Change-Id line from commit description
Checkpatch rejects patches that have empty commit description and
logs them with:
WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
But if the patch has a gerrit's Change-Id line placed before the
line Signed-off-by, then checkpatch considers the Change-Id line
as a valid commit description text.
Use the Change-Id tag as a marker of the end of the commit message,
thus not counting its line as part of the commit description.
This patch is not relevant for the Linux kernel development process
as gerrit is not involved and the Change-Id tag is rejected. But
other projects, like OpenOCD, base the development on gerrit and
reuse kernel's checkpatch with flag '--ignore GERRIT_CHANGE_ID'.
This patch has been refused [1] in Linux upstream because it has
not been considered relevant for that project.
Let's take it as another add-on in OpenOCD checkpatch.
Jan Matyas [Thu, 10 Oct 2024 18:35:19 +0000 (20:35 +0200)]
autoconf: Add support for code coverage
Add support for code coverage collection. This helps
developers to check if their test scenarios really exercised
all the OpenOCD functionality that they intended to test.
- Option --enable-gcov has been added to configure.ac
which enables the coverage collection using Gcov. (Disabled
by default.)
- The steps to collect and inspect the coverage have been
described in HACKING file.
Change-Id: I259e401937a255e7ad7f155359a0b7787e4d0752 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8521 Tested-by: jenkins Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
target/breakpoints: fix types in `watchpoint_add_internal()`
There was a conflict:
1. commit 2cd8ebf44d1a ("breakpoints: use 64-bit type for watchpoint mask
and value")
2. commit 0bf3373e808a ("target/breakpoints: Use 'unsigned int' for
length")
The second commit was created erlier, but merged later so the types of
`mask` and `value` became `uint32_t` in `watchpoint_add_internal()`.
This created a bug:
`WATCHPOINT_IGNORE_DATA_VALUE_MASK` is defined as `(~(uint64_t)0)`.
Truncation to uint32_t makes it so the comparisons with the constant
don't work.
Change-Id: I19c414c351f52aff72a60330d83c29db7bbca375 Signed-off-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8500 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Jan Matyas <jan.matyas@codasip.com> Tested-by: jenkins Reviewed-by: zapb <dev@zapb.de> Reviewed-by: Karl Palsson <karlp@tweak.au>
Marek Kraus [Wed, 23 Oct 2024 14:27:33 +0000 (16:27 +0200)]
tcl/target/bl702: implement full software reset
In previous implementation, it was known that it does not perform
full reset, and that some peripherals, such as GLB core,
which handles among other stuff GPIOs, was not reset.
It was presumed, that full reset by software is not possible,
although, by accident, even when comment says that
CTRL_PWRON_RESET is set to 1, it is not
(value written into 0x40000018 supposed to be 0x7, not 0x6).
CTRL_PWRON_RESET indeed triggers full "power-on like" reset,
so this method is implemented in this commit.
There are some workarounds to make reset seamless, without any
error messages, which are described in comments of TCL script.
Only down-side of this reset is, that chip is halted after reset
bit later in BootROM than previous implementation,
but it's still good.
Change-Id: Ife2cdcc6a2d96a2e24039bfec149705baf046318 Signed-off-by: Marek Kraus <gamelaster@outlook.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8529 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Marc Schink [Fri, 30 Aug 2024 08:47:55 +0000 (10:47 +0200)]
tcl/interface: Restructure parport config files
Provide cable specific configuration files like for the FTDI interface.
Depcrecate the old configuration files but keep them until the next
release for compatibility reasons.
Change-Id: I436bd60779a107120c9e1b1f0b8a69a39a240ad4 Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8514 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Antonio Borneo [Sat, 12 Oct 2024 09:48:05 +0000 (11:48 +0200)]
stlink: deprecate HLA support
The STLink API that supports dap-direct is available from STLink
firmware v2j24, published in early 2015.
We can reasonably expect that any old STLink still in use today
has got at least one firmware update during the last 10 years.
Most of the board files in upstream OpenOCD still use the STLink
in HLA mode. This limits the test coverage of the dap-direct code,
which was introduced in OpenOCD v0.11.0.
- Rename interface/stlink.cfg as interface/stlink-hla.cfg to still
provide support for HLA, adding a deprecated message.
- Rename interface/stlink-dap.cfg as interface/stlink.cfg to make
dap-direct the default trasport.
- Add a redirect file interface/stlink-dap.cfg for users that have
out-of-tree custom board files.
- Update all the board files to the new setup.
- Remove STLink HLA mentions from the documentation, while adding
a reference to interface/stlink-hla.cfg
Checkpatch-ignore: LONG_LINE
Change-Id: I99366bb03cd3b83f8f408514e657f30e59813063 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8523 Tested-by: jenkins Reviewed-by: Andrzej Sierżęga <asier70@gmail.com>
Antonio Borneo [Mon, 15 Jul 2024 09:56:36 +0000 (11:56 +0200)]
target: cortex_m: fix polling for target kept under reset
In multi-target SoC not all the targets are running simultaneously
and some target could be powered off or kept under reset.
Commit 4892e32294c6 ("target/cortex_m: allow poll quickly get out
of TARGET_RESET state") does not considers the case of a target
that is kept in reset and expects the target to change state from
TARGET_RESET immediately.
This causes OpenOCD to log continuously:
Info : [stm32mp15x.cm4] external reset detected
Info : [stm32mp15x.cm4] external reset detected
Info : [stm32mp15x.cm4] external reset detected
Read again dhcsr to detect the 'stable' reset status and quit,
waiting for next poll to re-check the target's status.
Change-Id: Ic66029b988404a1599bb99bc66d4a8845b8b02c6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com> Fixes: 4892e32294c6 ("target/cortex_m: allow poll quickly get out of TARGET_RESET state")
Reviewed-on: https://review.openocd.org/c/openocd/+/8399 Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
R. Diez [Sat, 1 Jun 2024 19:20:31 +0000 (21:20 +0200)]
configure: show adapter Xilinx XVC/PCIe in the configuration summary
Adapter Xilinx XVC/PCIe was not appearing in the configuration summary
because of the wrong variable name: build_xlnx_pcie_xvc
instead of enable_xlnx_pcie_xvc.
Also build this adapter automatically on Linux.
Change-Id: I69ea92f550052b9ce55ce32597ac446a15a87388 Signed-off-by: R. Diez <rdiezmail-openocd@yahoo.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8312 Tested-by: jenkins Reviewed-by: R. Diez <rdiez-2006@rd10.de> Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Jan Matyas [Thu, 3 Oct 2024 07:59:24 +0000 (09:59 +0200)]
gitignore: Start ignoring ".vscode"
To help the developers who use Visual Studio Code IDE,
ignore the ".vscode" folder in Git. This folder contains
local configuration of the VSCode workspace.
Change-Id: I1d54d8ce2bd0680f2fa1fb773bb33c786bdcc608 Signed-off-by: Jan Matyas <jan.matyas@codasip.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8518 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Antonio Borneo [Fri, 27 Sep 2024 20:36:52 +0000 (22:36 +0200)]
openocd: fix build with jimtcl 0.83
In jimtcl 0.82, the include file jim.h included in turn stdio.h
This made redundant to include the former in openocd source files.
Since jimtcl 0.83, jim.h drops the include of stdio.h, causing
openocd build to fail.
Include stdio.h in the files that need it.
Change-Id: Ic81c9b273d7520f4d2d8c32bc3e0a6bcfffb67ed Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8512 Reviewed-by: Jonathan McDowell <noodles-openocd@earth.li> Tested-by: jenkins
Antonio Borneo [Sun, 22 Sep 2024 16:32:21 +0000 (18:32 +0200)]
openocd: build: allow more socket connections on Windows
Cross compiling OpenOCD for Windows forces the maximum number of
open files (including sockets) to 64. See in include file
psdk_inc/_fd_types.h:
#ifndef FD_SETSIZE
#define FD_SETSIZE 64
#endif
This limit is far lower than the default value 1024 used by Linux.
In pull request #644 [1] in risc-v fork it's reported that:
- each socket server of OpenOCD (GDB, telnet, ...) uses one FD;
- each active connection to a socket server uses another FD;
- multi-core devices with 32 or more cores, each having a GDB
connection, already saturates the 64 available FD at the 26th
GDB connection.
The patch [2] proposed and merged in risc-v fork adds the compile
flag
-DFD_SETSIZE=128
to all the host types. While this looks fine for Windows, it
reduces the default value for Linux and other OS.
Add the compile flag FD_SETSIZE only to cross compile for Windows.
Antonio Borneo [Sun, 8 Sep 2024 19:20:48 +0000 (21:20 +0200)]
target: convert 'unsigned' to 'unsigned int'
Conversion done with
checkpatch --fix-inplace -types UNSPECIFIED_INT
Ignore the cast as they could be better addressed.
Fix only minor additional checkpatch issue (spacing and line
length).
Use Checkpatch-ignore below for the function pointers in the file
'armv7a_cache_l2x.h' that do not assign the identifier names to
the function arguments.
Most of these struct are unused and should be fixed or dropped.
Walter Ji [Thu, 22 Feb 2024 09:06:53 +0000 (17:06 +0800)]
target/mips32: add dsp access support for gdb
Change order of dsp register name array and removed hi0 and lo0
to comply with gdb definition of dsp in mips-dsp.xml, the regs
name array is now mapping corresponding dsp accumulator names
onto `mips32_regs` and `core_regs` instead of mapping to instr
arrays in dsp functions.
feature now requires a place to store cached dsp registers.
Add dsp registers to reg_list for gdb to access them.
Add dsp module enable detection to avoid DSP Disabled exception
while reading dsp accumulators.
Add dsp register reading procedure in `mips32_pracc_read_regs`
and writing procedure in `mips32_pracc_write_regs`.
Change-Id: Iacc335da030ab85989922c81aac7925b3dc17459 Signed-off-by: Walter Ji <walter.ji@oss.cipunited.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8476 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Oleksij Rempel <linux@rempel-privat.de>
Antonio Borneo [Sun, 2 Apr 2023 18:47:41 +0000 (20:47 +0200)]
HACKING: add info on ignoring check-patch checks
Due to checkpatch internal state machine, the field 'Checkpatch-ignore:'
must be in the commit message before the 'Signed-off-by:' line.
Report it in the documentation and add that multiple 'Checkpatch-ignore:'
lines are allowed.
Change-Id: I770cdc4cb5b33bcf63c860c154ab3cbd4785ad20 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/7572 Tested-by: jenkins
Antonio Borneo [Sun, 1 Sep 2024 12:45:36 +0000 (14:45 +0200)]
rtos: chibios: fix version display
The field 'struct chibios_chdebug::ch_version' is 16 bits wide, so
using le_to_h_u32() and be_to_h_u32() overflows in the following
fields of the struct.
Restrict the endianness conversion to 16 bits and use the target
endianness dependent target_buffer_get_u16().
Convert the 'struct chibios_chdebug::ch_version' to an array of
uint8_t.
Change-Id: Iaa80e9cb1a65c27512919398b8ffbf14e5c240cd Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8473 Tested-by: jenkins
Matt Trescott [Wed, 10 Jul 2024 18:46:28 +0000 (14:46 -0400)]
flash/nor/atsame5: add PIC32CX-SG device IDs
These devices are essentially the same as the E54 series with the
exception of immutable boot (SG41, SG61) and HSM (SG60, SG61), and some
bug fixes found only in E54 revision F. When the security features are
not enabled, they behave identically except for the different DIDs.
Signed-off-by: Matt Trescott <mtc@melexis.com>
Change-Id: Ic93313f3e20af0ed4a5768880d17b335a7b7bb04
Reviewed-on: https://review.openocd.org/c/openocd/+/8355 Tested-by: jenkins Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Marc Schink [Mon, 24 Jun 2024 14:26:02 +0000 (16:26 +0200)]
server/telnet: Restructure commands
Use a command group 'telnet' with subcommands instead of individual
commands with 'telnet_' prefix. Even though there is only one subcommand
at the moment, make this change to ensure consistency with other commands.
The old command is still available to ensure backwards compatibility,
but are marked as deprecated.
Change-Id: I5e88632fa0d0ce5a8129e9fcf5ae743fc5b093cb Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8378 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
server/gdb_server: improve error handling for `Z/z` packet
* Report errors for `z` packet.
* Report not supported types as required by GDB Remote Protocol's
documentation:
> Implementation notes: A remote target shall return an empty string
for an unrecognized breakpoint or watchpoint packet type.
binarybuffer: Invert buf_cmp* return value and rename to buf_eq*
The current semantics are a bit confusing, as the return value looks
like memcmp (0/false being equal) but the bool return type means one
likely expects true to mean equal. Make this clearer by switching them
out for buf_eq* functions that do that instead.
daniellizewski [Thu, 21 Mar 2024 13:58:34 +0000 (09:58 -0400)]
src/rtos/rtos_nuttx_stackings.c: Fix stack alignment for cortex-m targets
Backtraces performed by GDB on any thread other than the current
thread would fail if hardware 8 byte ISR stack alignment
was enabled on cortex_m targets. Stack reads now adjust
the stored SP to account for a potential offset introduced by hardware.
Fixed incorrect register offsets for cortex_m Nuttx frames by reading
the TCB info symbols to determine correct offsets.
Fixed offsets can no longer be used since the offsets have changed
multiple times for different Nuttx versions.
Tested on nuttx-12.1.0.
Tested using custom stm32h7 board and custom s32k148 board variants.
Built with CONFIG_ARCH_FPU enabled and disabled to
test FPU and non FPU frame logic.
Peter Collingbourne [Thu, 1 Aug 2024 22:48:25 +0000 (15:48 -0700)]
aarch64: Invalidate caches on reset
When a target is reset we must invalidate register caches in order
to avoid showing stale register values or writing them back to
registers. Use EDPRSR.SR to detect a previous reset, and EDPRSR.R to
detect a current reset state.
Change-Id: Ia1e97d7154cf7789d392274eee475733086a835b Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8425 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
binarybuffer: Fix inverted return value in buf_cmp
This is the fast path for when there is a mismatch in the leading whole
bytes, which means we should return true to indicate not equal like all
the other cases here and in the surrounding functions. Otherwise we'll
incorrectly report _buf1 == _buf2 if and only if there are mismatches in
the leading whole bytes.
This was introduced during the refactor and optimisation referenced
below.
The only in-tree caller of this is jtag_check_value_inner, which will
just fail to catch some errors. However, downstream in riscv-openocd it
gets used in the riscv target to determine whether an IR scan is needed
to select the debug module, and with an IRLEN >= 8 this breaks resetting
if the encoding for the DMI isn't all-ones in its leading whole bytes
(to match BYPASS), since it will believe they are the same and not do an
IR scan, failing (with "At least one TAP shouldn't be in BYPASS mode")
in the subsequent DR scan due to the TAP still being recorded as having
bypass set (and really having an instruction of either BYPASS or
IDCODE).
Fixes: e4ee891759b0 ("improve buf_cmp and buf_cmp_mask helpers")
Change-Id: Ic4f7ed094429abc4c06a775eb847a8b3ddf2e2d6 Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8489 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz> Tested-by: jenkins
Marc Schink [Wed, 3 Jul 2024 13:16:27 +0000 (15:16 +0200)]
README: Use proper Markdown syntax
The README file contains a mixture of Markdown and non-Markdown syntax.
Refurbish the document and use only Markdown syntax according to the
specification in [1].
[1] https://www.markdownguide.org/
Change-Id: If58f4e2971dc798a03a78841226804ab1f2d33c8 Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: https://review.openocd.org/c/openocd/+/8387 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
daniellizewski [Fri, 23 Aug 2024 12:31:04 +0000 (08:31 -0400)]
src/flash/nor/kinetis.c: Fixed flash bank write gap
Flash banks created in kinetis_create_missing_banks did not populate
bank->minimal_write_gap. The default value of 0 was interpreted as
FLASH_WRITE_CONTINUOUS. This created unnecessary large padding if your
binary had a gap in the populated flash. It also caused flash errors
when loading with GDB because the erroneously padded pages were not
erased first. Tested using an S32k148 using s32k.cfg.
Change-Id: I9b7af698e29ac2c4f5fc8ecd82fa7f4b1a0d43f1 Signed-off-by: daniellizewski <daniellizewski@geotab.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8463 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
Jun Yan [Sat, 31 Aug 2024 11:28:46 +0000 (19:28 +0800)]
tcl/interface/ftdi: add support for Sipeed USB-JTAG/TTL Debugger
Sipeed USB-JTAG/TTL Debugger is a compact FT2232D-based JTAG adapter.
Change-Id: Ibc9075723f47cd9b49ba4bb39e3d292e7d80bed7 Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8472 Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Tested-by: jenkins
Parshintsev Anatoly [Fri, 30 Aug 2024 19:45:07 +0000 (22:45 +0300)]
rtos/hwthread: fix threadid generation
Looks like 7f2d3e2925 introduced a regression by incorrectly assigning
threads. The title of the commit message says that the intention was to
"derive threadid from SMP index", this is not what happens, however.
Instead threadid is assigned based on an index of all examined targets
in an SMP group.
Now, imagine a situation when we have two targets: `target.A` and
`target.B`. Let's assume that `target.A` is NOT examined (it could be
under reset, for example). Then, according to the algorithm when
assigning thread identifiers `target.B` will be assigned tid of 1. The
respected inferior on GDB side will be called `Thread 1`.
Now, imagine that `target.A` activates and succefully examined - OpenOCD
will re-assign thread identifiers. And now on GDB side `Thread 1` will
represent the state of `target.A`. Which is incorrect.
*Error 2*
The reverse mapping between `threadid` and targets does not take the
state of targets into account.
Marek Vasut [Thu, 22 Aug 2024 23:29:02 +0000 (01:29 +0200)]
tcl/target: Make sure R-Car Gen3 _targets variable is global
The _targets has to be global as it is accessed at the end of this file.
This is already the case for setup_a5x {}, assure it is the same way for
setup_crx{} . Without this change, the _targets at the end of this file
is empty in case the Cortex-R is the boot core, fix this.
Change-Id: I4979e3125ec7d93bbd56eee0096ae1d9c5f6a565 Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8470 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Adam Novak [Mon, 26 Aug 2024 02:51:22 +0000 (22:51 -0400)]
cpld: update warning to suggest virtex2 refresh
virtex2 refresh replaced virtex2 program, but the even older programming
commands like xc6s_program still suggest the old, now-removed program
command. This changes the warnings to suggest the command that is still
there, and also adds some indication that you will need to use the .pld
name instead of the .tap name.
Change-Id: I292da62a95a9b414c69cdb1bba8a28dfd16a7336 Signed-off-by: Adam Novak <interfect@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8468 Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com> Reviewed-by: Daniel Anselmi <danselmi@gmx.ch>
Ondřej Hošek [Sun, 25 Aug 2024 21:50:07 +0000 (23:50 +0200)]
flash/stm32l4x: option_write usage: mask is optional
If no mask is given, the value in the option register is replaced
completely. If a mask is set, only those bits that are set in the mask
are transferred into the option register; the others remain unchanged.
Antonio Borneo [Sun, 25 Aug 2024 13:38:07 +0000 (15:38 +0200)]
binarybuffer: str_to_buf(): align prefix to TCL syntax
Integer values are interpreted by TCL as decimal, binary, octal
or hexadecimal if prepended with '0d', '0b', '0o' or '0x'
respectively.
The case of '0' prefix has been interpreted as octal till TCL 8.6
but is interpreted as part of a decimal number by JimTCL and from
TCL 9.
Align str_to_buf() to latest TCL syntax by:
- addding support for '0d', '0b' and '0o' prefix;
- dropping support for '0' prefix.
Change-Id: I708ef72146d75b7bf429df329a0269cf48700a44 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8465 Tested-by: jenkins Reviewed-by: Jan Matyas <jan.matyas@codasip.com>
Richard Allen [Wed, 15 May 2024 17:29:05 +0000 (12:29 -0500)]
target: fix profiler output on Windows
Open output file in binary mode to disable EOL
conversion on Windows (and sometimes cygwin depending
on installation settings and path).
Change-Id: I38276dd1af011ce5781b0264b7cbb08c32a1a2ad Signed-off-by: Richard Allen <rsaxvc@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8278 Reviewed-by: Karl Palsson <karlp@tweak.au> Tested-by: jenkins Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Antonio Borneo [Thu, 1 Aug 2024 08:43:41 +0000 (10:43 +0200)]
checkpatch: only report error on hit
The Linux checkpatch script used by OpenOCD reports hits either as
error, warning and check.
Such classification is meaningful for Linux maintainers, but for
OpenOCD Jenkins they are all considered as errors.
Having such classification in the checkpatch report by Jenkins is
misleading for developers that expect 'warnings' to be probably
ignored by maintainers, while having no idea what 'checks' means.
This patch flattens all the checkpatch reports to 'error' only.
Checkpatch can trigger false positives. OpenOCD uses the tag
Checkpatch-ignore:
in the commit message to prevent Jenkins to report the error, as
described in HACKING.
Change-Id: I1d3164ba1f725c0763dfe362192ffa669b3856e6 Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8424 Reviewed-by: Karl Palsson <karlp@tweak.au> Tested-by: jenkins
Antonio Borneo [Sun, 14 Jul 2024 12:59:34 +0000 (14:59 +0200)]
binarybuffer: str_to_buf(): simplify it and fix scan-build error
The function str_to_buf() can be simplified by writing directly
the intermediate results in the output buffer.
Such simplification improves the readability and also makes
scan-build happy, as it does not trigger anymore the warning:
src/helper/binarybuffer.c:328:8: warning: Use of memory
allocated with size zero [unix.Malloc]
if ((b256_buf[(buf_len / 8)] & mask) != 0x0) {
Change-Id: I1cef9a1ec5ff0e5841ba582610f273e89e7a81da Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8396 Reviewed-by: Jan Matyas <jan.matyas@codasip.com> Tested-by: jenkins