You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(75) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(70) |
Feb
(20) |
Mar
(52) |
Apr
(149) |
May
(387) |
Jun
(466) |
Jul
(133) |
Aug
(87) |
Sep
(122) |
Oct
(140) |
Nov
(185) |
Dec
(105) |
2010 |
Jan
(85) |
Feb
(45) |
Mar
(75) |
Apr
(17) |
May
(41) |
Jun
(52) |
Jul
(33) |
Aug
(29) |
Sep
(36) |
Oct
(15) |
Nov
(26) |
Dec
(34) |
2011 |
Jan
(26) |
Feb
(25) |
Mar
(26) |
Apr
(29) |
May
(20) |
Jun
(27) |
Jul
(15) |
Aug
(32) |
Sep
(13) |
Oct
(64) |
Nov
(60) |
Dec
(10) |
2012 |
Jan
(64) |
Feb
(63) |
Mar
(39) |
Apr
(43) |
May
(54) |
Jun
(11) |
Jul
(30) |
Aug
(45) |
Sep
(11) |
Oct
(70) |
Nov
(24) |
Dec
(23) |
2013 |
Jan
(17) |
Feb
(8) |
Mar
(35) |
Apr
(40) |
May
(20) |
Jun
(24) |
Jul
(36) |
Aug
(25) |
Sep
(42) |
Oct
(40) |
Nov
(9) |
Dec
(21) |
2014 |
Jan
(29) |
Feb
(24) |
Mar
(60) |
Apr
(22) |
May
(22) |
Jun
(46) |
Jul
(11) |
Aug
(23) |
Sep
(26) |
Oct
(10) |
Nov
(14) |
Dec
(2) |
2015 |
Jan
(28) |
Feb
(47) |
Mar
(33) |
Apr
(58) |
May
(5) |
Jun
(1) |
Jul
|
Aug
(8) |
Sep
(12) |
Oct
(25) |
Nov
(58) |
Dec
(21) |
2016 |
Jan
(12) |
Feb
(40) |
Mar
(2) |
Apr
(1) |
May
(67) |
Jun
(2) |
Jul
(5) |
Aug
(36) |
Sep
|
Oct
(24) |
Nov
(17) |
Dec
(50) |
2017 |
Jan
(14) |
Feb
(16) |
Mar
(2) |
Apr
(35) |
May
(14) |
Jun
(16) |
Jul
(3) |
Aug
(3) |
Sep
|
Oct
(19) |
Nov
|
Dec
(16) |
2018 |
Jan
(55) |
Feb
(11) |
Mar
(34) |
Apr
(14) |
May
(4) |
Jun
(20) |
Jul
(39) |
Aug
(16) |
Sep
(17) |
Oct
(16) |
Nov
(20) |
Dec
(30) |
2019 |
Jan
(29) |
Feb
(24) |
Mar
(37) |
Apr
(26) |
May
(19) |
Jun
(21) |
Jul
(2) |
Aug
(3) |
Sep
(9) |
Oct
(12) |
Nov
(12) |
Dec
(12) |
2020 |
Jan
(47) |
Feb
(36) |
Mar
(54) |
Apr
(44) |
May
(37) |
Jun
(19) |
Jul
(32) |
Aug
(13) |
Sep
(16) |
Oct
(24) |
Nov
(32) |
Dec
(11) |
2021 |
Jan
(14) |
Feb
(5) |
Mar
(40) |
Apr
(32) |
May
(42) |
Jun
(31) |
Jul
(29) |
Aug
(47) |
Sep
(38) |
Oct
(17) |
Nov
(74) |
Dec
(33) |
2022 |
Jan
(11) |
Feb
(15) |
Mar
(40) |
Apr
(21) |
May
(39) |
Jun
(44) |
Jul
(19) |
Aug
(46) |
Sep
(79) |
Oct
(35) |
Nov
(21) |
Dec
(15) |
2023 |
Jan
(56) |
Feb
(13) |
Mar
(43) |
Apr
(28) |
May
(60) |
Jun
(15) |
Jul
(29) |
Aug
(28) |
Sep
(32) |
Oct
(21) |
Nov
(42) |
Dec
(39) |
2024 |
Jan
(35) |
Feb
(17) |
Mar
(28) |
Apr
(7) |
May
(14) |
Jun
(35) |
Jul
(30) |
Aug
(35) |
Sep
(30) |
Oct
(28) |
Nov
(38) |
Dec
(18) |
2025 |
Jan
(21) |
Feb
(28) |
Mar
(36) |
Apr
(35) |
May
(34) |
Jun
(58) |
Jul
(9) |
Aug
(16) |
Sep
|
Oct
|
Nov
|
Dec
|
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:22:13
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 5be78fafa9b7c9354956fa72c69dbb82338f6e4a (commit) from c8c9121e36856ebcade0a513cbaf1723070419f6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 5be78fafa9b7c9354956fa72c69dbb82338f6e4a Author: Antonio Borneo <bor...@gm...> Date: Sat May 4 17:01:23 2019 +0200 HACKING: add chapter on checkpatch Include hints on how to skip some of the tests in some really exceptional case. Note: the file includes an example of commit message with a signed off tag that triggers a checkpatch error. Let checkpatch to ignore BAD_SIGN_OFF error. Checkpatch-ignore: BAD_SIGN_OFF Change-Id: I05bf0ab8008649f3f9b38452e056dc3df83a1a4f Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5609 Tested-by: jenkins diff --git a/HACKING b/HACKING index 96b05f2d6..be5699990 100644 --- a/HACKING +++ b/HACKING @@ -171,6 +171,8 @@ while(!done) { @endcode \note use "git add ." before commit to add new files. + \note check @ref checkpatch for hint about checkpatch script + Commit message template, notice the short first line. The field '<c>specify touched area</c>' should identify the main part or subsystem the patch touches. @@ -179,7 +181,9 @@ specify touched area: short comment <blank line> Longer comments over several lines, explaining (where applicable) the reason for the patch and the general idea the solution is based on, -any major design decisions, etc... +any major design decisions, etc. Limit each comment line's length to 75 +characters; since 75 it's too short for a URL, you can put the URL in a +separate line preceded by 'Link: '. <blank line> Signed-off-by: ... @endcode @@ -227,6 +231,65 @@ git push review Further reading: http://www.coreboot.org/Git +@section checkpatch About checkpatch script + +OpenOCD source code includes the script checkpatch to let developers to +verify their patches before submitting them for review (see @ref gerrit). + +Every patch for OpenOCD project that is submitted for review on Gerrit +is tested by Jenkins. Jenkins will run the checkpatch script to analyze +each patch. +If the script highlights either errors or warnings, Gerrit will add the +score "-1" to the patch and maintainers will probably ignore the patch, +waiting for the developer to send a fixed version. + +The script checkpatch verifies the SPDX tag for new files against a very +short list of license tags. +If the license of your contribution is not listed there, but compatible +with OpenOCD license, please alert the maintainers or add the missing +license in the first patch of your patch series. + +The script checkpatch has been originally developed for the Linux kernel +source code, thus includes specific tests and checks related to Linux +coding style and to Linux code structure. While the script has been +adapted for OpenOCD specificities, it still includes some Linux related +test. It is then possible that it triggers sometimes some <em>false +positive</em>! + +If you think that the error identified by checkpatch is a false +positive, please report it to the openocd-devel mailing list or prepare +a patch for fixing checkpatch and send it to Gerrit for review. + +\attention The procedure below is allowed only for <em>exceptional +cases</em>. Do not use it to submit normal patches. + +There are <em>exceptional cases</em> in which you need to skip some of +the tests from checkpatch in order to pass the approval from Gerrit. + +For example, a patch that modify one line inside a big comment block +will not show the beginning or the end of the comment block. This can +prevent checkpatch to detect the comment block. Checkpatch can wrongly +consider the modified comment line as a code line, triggering a set of +false errors. + +Only for <em>exceptional cases</em>, it is allowed to submit patches +to Gerrit with the special field 'Checkpatch-ignore:' in the commit +message. This field will cause checkpatch to ignore the error types +listed in the field, only for the patch itself. +The error type is printed by checkpatch on failure. +For example the names of Windows APIs mix lower and upper case chars, +in violation of OpenOCD coding style, triggering a 'CAMELCASE' error: +@code +CHECK:CAMELCASE: Avoid CamelCase: <WSAGetLastError> +#96105: FILE: src/helper/log.c:505: ++ error_code = WSAGetLastError(); +@endcode +Adding in the commit message of the patch the line: +@code +Checkpatch-ignore: CAMELCASE +@endcode +will force checkpatch to ignore the CAMELCASE error. + @section timeline When can I expect my contribution to be committed? The code review is intended to take as long as a week or two to allow ----------------------------------------------------------------------- Summary of changes: HACKING | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:21:53
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via c8c9121e36856ebcade0a513cbaf1723070419f6 (commit) from 01cf43aab9176f76d46b515134e8a7f3dddd416f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c8c9121e36856ebcade0a513cbaf1723070419f6 Author: Antonio Borneo <bor...@gm...> Date: Sun Jun 12 14:36:35 2022 +0200 checkpatch: fix path of documentation In OpenOCD documentation is in folder "doc". Fix search path of 'checkpatch.rst'. This file is used to provide verbose explanation of failing checks while using command line flag '-v'. Change-Id: Id864369d371cbd5a24e76bf90c54ff03159051c3 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7022 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index dc01effb4..10b0b8c25 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -78,7 +78,12 @@ my $codespell = 0; my $codespellfile = "/usr/share/codespell/dictionary.txt"; my $user_codespellfile = ""; my $conststructsfile = "$D/const_structs.checkpatch"; +if (!$OpenOCD) { my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst"; +} # !$OpenOCD +# OpenOCD Specific: Begin +my $docsfile = "$D/../../doc/checkpatch.rst"; +# OpenOCD Specific: End my $typedefsfile; my $color = "auto"; my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE ----------------------------------------------------------------------- Summary of changes: tools/scripts/checkpatch.pl | 5 +++++ 1 file changed, 5 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:21:32
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 01cf43aab9176f76d46b515134e8a7f3dddd416f (commit) via 9f25e470f90be7ad05b2685a624d372be6998df2 (commit) from 496308701342032d54bfe04c6e2653be252ccd94 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 01cf43aab9176f76d46b515134e8a7f3dddd416f Author: Antonio Borneo <bor...@gm...> Date: Tue Aug 30 15:28:56 2022 +0200 checkpatch: extend check for camel[0-9_]*CASE Linux has some automatically generated macros that can trigger camelCASE check. This forces checkpatch to only detect the pattern [A-Z][a-z]|[a-z][A-Z] for adjacent case transition. In OpenOCD we do not have such case, so extend the check to [A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z] and remove the detection of Linux special cases. Change-Id: I82cb6dc668edbb093f68991337da1f4b933f1fac Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7152 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 0319d43d5..dc01effb4 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -1130,6 +1130,7 @@ sub seed_camelcase_file { my @lines = split('\n', $text); foreach my $line (@lines) { + if (!$OpenOCD) { next if ($line !~ /(?:[A-Z][a-z]|[a-z][A-Z])/); if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)/) { $camelcase{$1} = 1; @@ -1138,6 +1139,17 @@ sub seed_camelcase_file { } elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][a-z]|[a-z][A-Z])\w*)\s*[;\{]/) { $camelcase{$1} = 1; } + } # !$OpenOCD + # OpenOCD Specific: Begin: extend to camel[0-9_]*CASE + next if ($line !~ /(?:[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z])/); + if ($line =~ /^[ \t]*(?:#[ \t]*define|typedef\s+$Type)\s+(\w*(?:[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z])\w*)/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*$Declare\s+(\w*(?:[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z])\w*)\s*[\(\[,;]/) { + $camelcase{$1} = 1; + } elsif ($line =~ /^\s*(?:union|struct|enum)\s+(\w*(?:[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z])\w*)\s*[;\{]/) { + $camelcase{$1} = 1; + } + # OpenOCD Specific: End } } @@ -5798,6 +5810,7 @@ sub process { my $var = $1; #CamelCase + if (!$OpenOCD) { if ($var !~ /^$Constant$/ && $var =~ /[A-Z][a-z]|[a-z][A-Z]/ && #Ignore some autogenerated defines and enum values @@ -5809,9 +5822,20 @@ sub process { $var !~ /^(?:[a-z0-9_]*|[A-Z0-9_]*)?_?[a-z][A-Z](?:_[a-z0-9_]+|_[A-Z0-9_]+)?$/ && #Ignore some three character SI units explicitly, like MiB and KHz $var !~ /^(?:[a-z_]*?)_?(?:[KMGT]iB|[KMGT]?Hz)(?:_[a-z_]+)?$/) { + } + } # !$OpenOCD + # OpenOCD Specific: Begin: remove Linux exceptions, extend to camel[0-9_]*CASE + if ($var !~ /^$Constant$/ && + $var =~ /[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z]/) { + # OpenOCD Specific: End while ($var =~ m{\b($Ident)}g) { my $word = $1; + if (!$OpenOCD) { next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); + } # !$OpenOCD + # OpenOCD Specific: Begin: extend to camel[0-9_]*CASE + next if ($word !~ /[A-Z][0-9_]*[a-z]|[a-z][0-9_]*[A-Z]/); + # OpenOCD Specific: End if (!$OpenOCD) { # This will not work for OpenOCD jenkins because it runs # checkpatch from a tree already patched. Any new camelcase commit 9f25e470f90be7ad05b2685a624d372be6998df2 Author: Antonio Borneo <bor...@gm...> Date: Sat Apr 17 22:37:12 2021 +0200 checkpatch: enable CAMELCASE test OpenOCD has to deal with CamelCase API, mainly from inttypes.h, jimtcl, libusb and Windows. Modify checkpatch script to load from a file the list of allowed CamelCase symbols. Populate the file 'camelcase.txt' with the symbols that OpenOCD has to get from external library, plus some of the symbols that should be fixed later. Enable CAMELCASE test in configuration script. Add generated files to .gitignore. Remove the check for 'known' CamelCase symbols from include folder as this will not work on OpenOCD Jenkins, as it run checkpatch on already patched code. Change-Id: I0415af673ed9f985394405ff8f1eeec81135410a Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6170 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 9d2084659..8cb9a3729 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -9,7 +9,6 @@ --ignore AVOID_EXTERNS --ignore BLOCK_COMMENT_STYLE ---ignore CAMELCASE --ignore COMPLEX_MACRO --ignore CONST_STRUCT --ignore ENOSYS diff --git a/.gitignore b/.gitignore index 955ca3c2e..818bb0cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,6 @@ tags GPATH GRTAGS GTAGS + +# checkpatch script files +.checkpatch-camelcase.* diff --git a/tools/scripts/camelcase.txt b/tools/scripts/camelcase.txt new file mode 100644 index 000000000..59fe5cae0 --- /dev/null +++ b/tools/scripts/camelcase.txt @@ -0,0 +1,217 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# The OpenOCD coding-style rules forbids CamelCase names for symbols, +# either functions, variables, macros and enums. +# The script checkpatch detects the CamelCase symbols. +# This file contains the exceptions to the coding-style, mainly due +# to external dependencies and libraries. + +# format types from inttypes.h (only some are already used) +PRId8 +PRId16 +PRId32 +PRId64 +PRIi8 +PRIi16 +PRIi32 +PRIi64 +PRIo8 +PRIo16 +PRIo32 +PRIo64 +PRIu8 +PRIu16 +PRIu32 +PRIu64 +PRIx8 +PRIx16 +PRIx32 +PRIx64 +PRIX8 +PRIX16 +PRIX32 +PRIX64 +SCNd8 +SCNd16 +SCNd32 +SCNd64 +SCNi8 +SCNi16 +SCNi32 +SCNi64 +SCNo8 +SCNo16 +SCNo32 +SCNo64 +SCNu8 +SCNu16 +SCNu32 +SCNu64 +SCNx8 +SCNx16 +SCNx32 +SCNx64 +SCNX8 +SCNX16 +SCNX32 +SCNX64 + +# OpenOCD format types +TARGET_PRIdADDR +TARGET_PRIoADDR +TARGET_PRIuADDR +TARGET_PRIxADDR + +# from libusb.h +bcdDevice +bConfigurationValue +bEndpointAddress +bInterfaceClass +bInterfaceNumber +bInterfaceProtocol +bInterfaceSubClass +bmAttributes +bNumConfigurations +bNumEndpoints +bNumInterfaces +idProduct +idVendor +iInterface +iProduct +iSerialNumber +wMaxPacketSize + +# from jimtcl/jim.h and jimtcl/jim-eventloop.h +Jim_AppendString +Jim_AppendStrings +Jim_Cmd +Jim_CmdPrivData +Jim_CmdProc +Jim_CompareStringImmediate +Jim_ConcatObj +Jim_CreateCommand +Jim_CreateInterp +Jim_DecrRefCount +Jim_DelCmdProc +Jim_DeleteAssocData +Jim_DeleteCommand +Jim_DictAddElement +Jim_DictPairs +Jim_DuplicateObj +Jim_Eval +Jim_EvalExpression +Jim_EvalObj +Jim_EvalObjPrefix +Jim_EvalSource +Jim_Eval_Named +Jim_FreeInterp +Jim_FreeObj +Jim_GetAssocData +Jim_GetCommand +Jim_GetDouble +Jim_GetEnum +Jim_GetExitCode +Jim_GetGlobalVariableStr +Jim_GetIntRepPtr +Jim_GetLong +Jim_GetResult +Jim_GetString +Jim_GetVariable +Jim_GetWide +Jim_IncrRefCount +Jim_InitStaticExtensions +Jim_Interp +Jim_ListAppendElement +Jim_ListGetIndex +Jim_ListLength +Jim_MakeErrorMessage +Jim_NewDictObj +Jim_NewEmptyStringObj +Jim_NewIntObj +Jim_NewListObj +Jim_NewStringObj +Jim_NewWideObj +Jim_Obj +Jim_ProcessEvents +Jim_RegisterCoreCommands +Jim_SetAssocData +Jim_SetEmptyResult +Jim_SetResult +Jim_SetResultBool +Jim_SetResultFormatted +Jim_SetResultInt +Jim_SetResultString +Jim_SetVariable +Jim_String +Jim_WrongNumArgs +cmdProc +currentScriptObj +delProc +emptyObj +privData +returnCode +typePtr + +# from elf.h +Elf32_Addr +Elf32_Ehdr +Elf32_Half +Elf32_Off +Elf32_Phdr +Elf32_Size +Elf32_Word +Elf64_Addr +Elf64_Ehdr +Elf64_Half +Elf64_Off +Elf64_Phdr +Elf64_Word +Elf64_Xword + +# for BSD's +__FreeBSD__ +__FreeBSD_kernel__ + +# for Windows +CreateFile +CloseHandle +CreatePipe +CreateProcess +FormatMessage +GetLastError +GetModuleFileName +GetSystemTimeAsFileTime +GetTickCount +GetVersionEx +HighPart +LowPart +MsgWaitForMultipleObjects +PeekMessage +PeekNamedPipe +QuadPart +ReadFile +SetConsoleCtrlHandler +SetHandleInformation +Sleep +WaitForSingleObject +WriteFile +WSACleanup +WSAGetLastError +WSAStartup +ZeroMemory +bInheritHandle +dwFlags +dwHighDateTime +dwLowDateTime +dwPlatformId +dwOSVersionInfoSize +hProcess +hThread +hStdError +hStdInput +hStdOutput +lpSecurityDescriptor +nLength + +# OpenOCD exceptions that should be removed +KiB diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 12e7ab855..0319d43d5 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -988,6 +988,32 @@ sub read_words { return 0; } +# OpenOCD specific: Begin: Load list of allowed CamelCase symbols +if (show_type("CAMELCASE")) { + my $allowed_camelcase_file = "$root/tools/scripts/camelcase.txt"; + if (open(my $words, '<', $allowed_camelcase_file)) { + while (<$words>) { + my $line = $_; + + $line =~ s/\s*\n?$//g; + $line =~ s/^\s*//g; + + next if ($line =~ m/^\s*#/); + next if ($line =~ m/^\s*$/); + if ($line =~ /\s/) { + print("$allowed_camelcase_file: '$line' invalid - ignored\n"); + next; + } + + $camelcase{$line} = 1; + } + close($allowed_camelcase_file); + } else { + warn "No camelcase symbols to ignore - file '$allowed_camelcase_file': $!\n"; + } +} +# OpenOCD specific: End + my $const_structs; if (show_type("CONST_STRUCT")) { read_words(\$const_structs, $conststructsfile) @@ -5786,6 +5812,10 @@ sub process { while ($var =~ m{\b($Ident)}g) { my $word = $1; next if ($word !~ /[A-Z][a-z]|[a-z][A-Z]/); + if (!$OpenOCD) { + # This will not work for OpenOCD jenkins because it runs + # checkpatch from a tree already patched. Any new camelcase + # in include file will be ignored as it was pre-existing. if ($check) { seed_camelcase_includes(); if (!$file && !$camelcase_file_seeded) { @@ -5793,6 +5823,7 @@ sub process { $camelcase_file_seeded = 1; } } + } # !$OpenOCD if (!defined $camelcase{$word}) { $camelcase{$word} = 1; CHK("CAMELCASE", ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 1 - .gitignore | 3 + tools/scripts/camelcase.txt | 217 ++++++++++++++++++++++++++++++++++++++++++++ tools/scripts/checkpatch.pl | 55 +++++++++++ 4 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 tools/scripts/camelcase.txt hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:21:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 496308701342032d54bfe04c6e2653be252ccd94 (commit) via 1c1fd1a71a20862335c89dca9b8ee5ca81e0dc85 (commit) from bb1411e5987be66a8168e801a28f840d3b3b939b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 496308701342032d54bfe04c6e2653be252ccd94 Author: Antonio Borneo <bor...@gm...> Date: Fri Apr 16 23:57:06 2021 +0200 checkpatch: add commit-message field to ignore some check The script 'checkpatch.pl' is part of the automatic tests used by Linux Maintainers and developers to test new patches. The Linux development process is e-mail base. An error reported by checkpatch is not a blocking point; the developer can explain in the e-mail why he is submitting a patch that fails at checkpatch or that is in violation of the coding style. It's up to the maintainer to decide to accept or reject the explanation and then the patch. The OpenOCD development process relies on Gerrit and Jenkins as front-end tools. Jenkins tests every new patch with checkpatch and then builds the new code. If checkpatch fails, Jenkins adds a failure label to the patch; this often causes the patch to get ignored by maintainers that considers it as 'not ready'. Checkpatch can be instrumented to ignore some test, but this has to be specified in the command line or in the configuration file. Let checkpatch extract from the patch's commit message the new field 'Checkpatch-ignore:' that lists the additional tests that has to be ignored for that patch only. The developer that detects as error or a limitation in checkpatch can add the field and the problematic test in the commit message and re-push the patch. The maintainer should check the list of tests and decide how to proceed. Change-Id: Iafc1b2893a07c7b3fc7e3ad15bd694aba9bd8519 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6169 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 14876a114..12e7ab855 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -3011,6 +3011,13 @@ sub process { } } +# OpenOCD specific: Begin: Extend list of checkpatch tests to ignore + if ($in_commit_log && $line =~ /^\s*Checkpatch-ignore:\s*(.*)/) { + my @array = split(/[\s,]+/, $1); + hash_save_array_words(\%ignore_type, \@array); + } +# OpenOCD specific: End + # Check for patch separator if ($line =~ /^---$/) { $has_patch_separator = 1; commit 1c1fd1a71a20862335c89dca9b8ee5ca81e0dc85 Author: Antonio Borneo <bor...@gm...> Date: Mon May 6 15:30:54 2019 +0200 checkpatch: increase the max indentation level OpenOCD uses longer lines (120 char vs 100) and smaller tab size (4 char vs 8) wrt Linux kernel coding style. Clearly deep level of indentation is bad for code readability, but let's be more permissive on the indentation level. Change-Id: I16cf0b761145ec6072509dc26bb09c693e89e608 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6167 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 3c656973a..14876a114 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -4238,7 +4238,9 @@ sub process { my ($level, @ctx) = ctx_statement_level($linenr, $realcnt, 0); - if ($line =~ /^\+\t{6,}/) { + # OpenOCD specific: Begin: replace s/6/10/ + if ($line =~ /^\+\t{10,}/) { + # OpenOCD specific: End WARN("DEEP_INDENTATION", "Too many leading tabs - consider code refactoring\n" . $herecurr); } ----------------------------------------------------------------------- Summary of changes: tools/scripts/checkpatch.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:20:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via bb1411e5987be66a8168e801a28f840d3b3b939b (commit) from 8b4d9503d866bd7f70f743c3422076ba9ac9d58f (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit bb1411e5987be66a8168e801a28f840d3b3b939b Author: Antonio Borneo <bor...@gm...> Date: Wed Jan 27 19:00:38 2021 +0100 checkpatch: adapt shell script to the tool's new version With the new checkpatch it's not possible to send in one shot a set of patches through stdin because the Signed-off-by tag present in each patch will trigger the error of duplicated Signed-off-by. Use the new command-line flag '--git' to let checkpatch to extract the patches from git and analyse them one-by-one. While there, add the SPDX tag to the script. Change-Id: I74791b627b8cd68f2d49146d15ae35bbc610e64e Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/6166 Tested-by: jenkins diff --git a/tools/checkpatch.sh b/tools/checkpatch.sh index 0a630a248..7375fc2b6 100755 --- a/tools/checkpatch.sh +++ b/tools/checkpatch.sh @@ -1,5 +1,5 @@ #!/bin/sh -# +# SPDX-License-Identifier: GPL-2.0-or-later since=${1:-HEAD^} -git format-patch -M --stdout $since | tools/scripts/checkpatch.pl - +tools/scripts/checkpatch.pl --git ${since}.. ----------------------------------------------------------------------- Summary of changes: tools/checkpatch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:20:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8b4d9503d866bd7f70f743c3422076ba9ac9d58f (commit) via b0c36e0457446b76b32ca13db3e51f66b540d159 (commit) from 7d1e08456c785eb7e5497cf7d66296c8f16736a5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8b4d9503d866bd7f70f743c3422076ba9ac9d58f Author: Antonio Borneo <bor...@gm...> Date: Sun Apr 26 16:03:45 2020 +0200 checkpatch: check for SPDX tags of licenses in use Fix the patch of the external helper spdxcheck.py accordingly to OpenOCD folder structure. List only the current LICENSES subfolders in spdxcheck.py . Enable the check for SPDX headers. Extend the check for TCL and Makefile.am files. Change-Id: I0a40da0127746217ee0ac416058d5ceb922428ff Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5608 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index c6e4bbef0..9d2084659 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -23,7 +23,6 @@ --ignore PREFER_DEFINED_ATTRIBUTE_MACRO --ignore PREFER_FALLTHROUGH --ignore PREFER_KERNEL_TYPES ---ignore SPDX_LICENSE_TAG --ignore SPLIT_STRING --ignore SSCANF_TO_KSTRTO --ignore SWITCH_CASE_INDENT_LEVEL diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 9ef94ff43..3c656973a 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -1132,10 +1132,12 @@ sub is_maintained_obsolete { sub is_SPDX_License_valid { my ($license) = @_; - return 1 if (!$tree || which("python3") eq "" || !(-x "$root/scripts/spdxcheck.py") || !(-e "$gitroot")); + # OpenOCD specific: Begin: replace s"scripts"tools/scripts" + return 1 if (!$tree || which("python3") eq "" || !(-x "$root/tools/scripts/spdxcheck.py") || !(-e "$gitroot")); my $root_path = abs_path($root); - my $status = `cd "$root_path"; echo "$license" | scripts/spdxcheck.py -`; + my $status = `cd "$root_path"; echo "$license" | tools/scripts/spdxcheck.py -`; + # OpenOCD specific: End return 0 if ($status ne ""); return 1; } @@ -3669,6 +3671,10 @@ sub process { $comment = '#'; } elsif ($realfile =~ /\.rst$/) { $comment = '..'; + # OpenOCD specific: Begin + } elsif ($realfile =~ /\.(am|cfg|tcl)$/) { + $comment = '#'; + # OpenOCD specific: End } # check SPDX comment style for .[chsS] files diff --git a/tools/scripts/spdxcheck.py b/tools/scripts/spdxcheck.py index 18cb9f5b3..f88294379 100755 --- a/tools/scripts/spdxcheck.py +++ b/tools/scripts/spdxcheck.py @@ -49,7 +49,9 @@ def read_spdxdata(repo): # The subdirectories of LICENSES in the kernel source # Note: exceptions needs to be parsed as last directory. - license_dirs = [ "preferred", "dual", "deprecated", "exceptions" ] + # OpenOCD specific: Begin + license_dirs = [ "preferred", "stand-alone", "exceptions" ] + # OpenOCD specific: End lictree = repo.head.commit.tree['LICENSES'] spdx = SPDXdata() commit b0c36e0457446b76b32ca13db3e51f66b540d159 Author: Antonio Borneo <bor...@gm...> Date: Mon May 6 10:24:52 2019 +0200 checkpatch: add list of typedef used in OpenOCD The new checkpatch from Linux kernel does not recognizes the specific types used in OpenOCD, e.g. "fd_set" and "Jim_Obj". As consequence, it consider "fd_set" as the name of a variable, then misinterpret the asterisk for the pointer "fd_set *" as a multiplication, thus suggest to add a space after the asterisk and replace "fd_set *x" with "fd_set * x". Let checkpatch recognize the typedef used in OpenOCD. Change-Id: Ibc295e6a8b47ffa88b50a6d510b7970760e5199d Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5607 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 1ab743e2c..c6e4bbef0 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -5,6 +5,8 @@ --show-types --strict +--typedefsfile tools/scripts/typedefs.txt + --ignore AVOID_EXTERNS --ignore BLOCK_COMMENT_STYLE --ignore CAMELCASE diff --git a/tools/scripts/typedefs.txt b/tools/scripts/typedefs.txt new file mode 100644 index 000000000..97f330d9d --- /dev/null +++ b/tools/scripts/typedefs.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +fd_set +Jim_Cmd +Jim_CmdProc +Jim_DelCmdProc +Jim_Interp +Jim_Obj ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 3 ++- tools/scripts/checkpatch.pl | 10 ++++++++-- tools/scripts/spdxcheck.py | 4 +++- tools/scripts/typedefs.txt | 8 ++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 tools/scripts/typedefs.txt hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:20:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 7d1e08456c785eb7e5497cf7d66296c8f16736a5 (commit) from 772d8b42b65e4a1eb381d441219bc5c589ae6373 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7d1e08456c785eb7e5497cf7d66296c8f16736a5 Author: Paul Fertser <fer...@gm...> Date: Sun Apr 21 23:48:08 2019 +0200 checkpatch: fix check for the FSF address Replace s/Linux/OpenOCD/ in the message about FSF address. This is part of the old commit a9a5c17cf5e1 ("checkpatch: fix check for the FSF address"). Change-Id: I79b79769ef723f86690862277612ea8ab7855c07 Signed-off-by: Paul Fertser <fer...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5128 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 6f877c379..9ef94ff43 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -3516,7 +3516,7 @@ sub process { my $msg_level = \&ERROR; $msg_level = \&CHK if ($file); &{$msg_level}("FSF_MAILING_ADDRESS", - "Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. Linux already includes a copy of the GPL.\n" . $herevet) + "Do not include the paragraph about writing to the Free Software Foundation's mailing address from the sample GPL notice. The FSF has changed addresses in the past, and may do so again. OpenOCD already includes a copy of the GPL.\n" . $herevet) } # check for Kconfig help text having a real description ----------------------------------------------------------------------- Summary of changes: tools/scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:19:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 772d8b42b65e4a1eb381d441219bc5c589ae6373 (commit) from 20d4a58bd93aa17f8deb9ab6d310491f8fe9719b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 772d8b42b65e4a1eb381d441219bc5c589ae6373 Author: Antonio Borneo <bor...@gm...> Date: Wed Apr 17 08:00:38 2019 +0200 checkpatch: don't spell-check the spelling file Prevent checkpatch to complain for commits that add new entries in the dictionary of misspelled words. Remove the ignore flag TYPO_SPELLING from .checkpatch.conf, now spelling is functional. Change-Id: I911dedafc243e34f753d2be687977066719ff2eb Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5123 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 928028003..1ab743e2c 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -27,6 +27,3 @@ --ignore SWITCH_CASE_INDENT_LEVEL --ignore TRACING_LOGGING --ignore VOLATILE - -# Temporarily lines, to commit checkpatch itself. To be removed! ---ignore TYPO_SPELLING diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 07dca63db..6f877c379 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -3398,6 +3398,9 @@ sub process { # Check for various typo / spelling mistakes if (defined($misspellings) && + # OpenOCD specific: Begin: don't check spelling on spelling_file + index($spelling_file, $realfile) + length($realfile) != length($spelling_file) && + # OpenOCD specific: End ($in_commit_log || $line =~ /^(?:\+|Subject:)/i)) { while ($rawline =~ /(?:^|[^\w\-'`])($misspellings)(?:[^\w\-'`]|$)/gi) { my $typo = $1; ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 3 --- tools/scripts/checkpatch.pl | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:19:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 20d4a58bd93aa17f8deb9ab6d310491f8fe9719b (commit) via ccdc51e2de9a5379e9aaa2ff15e0be3e73b265c1 (commit) from c893a26a008a3a260bb40dc3f14ee7bdcc353981 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 20d4a58bd93aa17f8deb9ab6d310491f8fe9719b Author: Antony Pavlov <ant...@gm...> Date: Wed Apr 10 14:53:56 2019 +0200 checkpatch: check for OpenOCD tree, not for kernel tree checkpatch.pl looks for Linux kernel specific paths and files to check source tree. As openocd misses kernel files it ends with this error message: Must be run from the top-level dir. of a kernel tree This patch also renames 'kernel' -> 'openocd' in source tree-related messages. This is the old commit c5d89883165e ("checkpatch.pl: check for openocd tree, not for kernel tree") re-applied. Also remove the flag "--no-tree" from .checkpatch.conf, not required anymore. Change-Id: I336a66558c75494b7ae339ea63559c31f23aad84 Signed-off-by: Antony Pavlov <ant...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5122 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 0aad4c5b4..928028003 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -29,5 +29,4 @@ --ignore VOLATILE # Temporarily lines, to commit checkpatch itself. To be removed! ---no-tree --ignore TYPO_SPELLING diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index aa3e63743..07dca63db 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -97,7 +97,7 @@ Version: $V Options: -q, --quiet quiet -v, --verbose verbose mode - --no-tree run without a kernel tree + --no-tree run without an OpenOCD tree --no-signoff do not check for 'Signed-off-by' line --patch treat FILE as patchfile (default) --emacs emacs compile window format @@ -124,7 +124,7 @@ Options: requires --strict for use with --file --min-conf-desc-length=n set the min description length, if shorter, warn --tab-size=n set the number of spaces for tab (default $tabsize) - --root=PATH PATH to the kernel tree root + --root=PATH PATH to the OpenOCD tree root --no-summary suppress the per-file summary --mailback only produce a report in case of warnings/errors --summary-file include the filename in summary @@ -461,14 +461,16 @@ if ($tree) { } else { if (top_of_kernel_tree('.')) { $root = '.'; - } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && + # OpenOCD specific: Begin: replace s"/scripts/"/tools/scripts/" + } elsif ($0 =~ m@(.*)/tools/scripts/[^/]*$@ && top_of_kernel_tree($1)) { $root = $1; } + # OpenOCD specific: End } if (!defined $root) { - print "Must be run from the top-level dir. of a kernel tree\n"; + print "Must be run from the top-level dir. of an OpenOCD tree\n"; exit(2); } } @@ -1365,11 +1367,19 @@ exit($exit); sub top_of_kernel_tree { my ($root) = @_; + if (!$OpenOCD) { my @tree_check = ( "COPYING", "CREDITS", "Kbuild", "MAINTAINERS", "Makefile", "README", "Documentation", "arch", "include", "drivers", "fs", "init", "ipc", "kernel", "lib", "scripts", ); + } # !$OpenOCD + # OpenOCD specific: Begin + my @tree_check = ( + "AUTHORS", "BUGS", "COPYING", "HACKING", "Makefile.am", + "README", "contrib", "doc", "src", "tcl", "testing", "tools", + ); + # OpenOCD specific: End foreach my $check (@tree_check) { if (! -e $root . '/' . $check) { commit ccdc51e2de9a5379e9aaa2ff15e0be3e73b265c1 Author: Paul Fertser <fer...@gm...> Date: Sat Oct 26 11:34:22 2013 +0400 checkpatch: correct false positives reporting instructions This is the old commit 75b4cbe35646 ("checkpatch: correct false positives reporting instructions") re-applied. Change-Id: I348ae549e9d2587093b0fb6652aadf34724f0aab Signed-off-by: Paul Fertser <fer...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5121 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 762e9ed82..aa3e63743 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -1342,11 +1342,21 @@ NOTE: perl $^V is not modern enough to detect all possible issues. EOM } if ($exit) { + if (!$OpenOCD) { print << "EOM" NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. EOM + } # !$OpenOCD + # OpenOCD specific: Begin + print << "EOM" + +NOTE: If any of the errors are false positives, please report + them to the openocd-devel mailing list or prepare a patch + and send it to Gerrit for review. +EOM + # OpenOCD specific: End } } ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 1 - tools/scripts/checkpatch.pl | 28 ++++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:18:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via c893a26a008a3a260bb40dc3f14ee7bdcc353981 (commit) via 7bf39f64f64959a3fea60e74a26c9b54e4ab0f0a (commit) from 9c6c5b61b3c78a9f78152be6d403d9e3b76ef6f9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c893a26a008a3a260bb40dc3f14ee7bdcc353981 Author: Paul Fertser <fer...@gm...> Date: Sat Oct 26 11:24:43 2013 +0400 checkpatch: treat jenkins as valid email This is needed to avoid checkpatch barking on already committed patches. This is the old commit cadd51971535 ("checkpatch: treat jenkins as valid email") re-applied. Remove the flag BAD_SIGN_OFF, not anymore needed. Change-Id: I6744f80de982f7934f3a5197ac2df1c29962cbd0 Signed-off-by: Paul Fertser <fer...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5120 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index 4f2c931ca..0aad4c5b4 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -30,5 +30,4 @@ # Temporarily lines, to commit checkpatch itself. To be removed! --no-tree ---ignore BAD_SIGN_OFF --ignore TYPO_SPELLING diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 1daedd2f2..762e9ed82 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -1403,6 +1403,10 @@ sub parse_email { $address = ""; $comment = ""; } + # OpenOCD specific: Begin: handle jenkins as valid email + } elsif ($formatted_email eq "jenkins") { + $address = "jenkins"; + # OpenOCD specific: End } # Extract comments from names excluding quoted parts commit 7bf39f64f64959a3fea60e74a26c9b54e4ab0f0a Author: Paul Fertser <fer...@gm...> Date: Mon Oct 14 10:03:00 2013 +0400 checkpatch: add logging functions It's commonly considered that user-visible strings should not be split to different lines in the sources to ease grepping for them. Hence, checkpatch traditionally makes an exception for logging functions, lines having them can be of arbitrary length. OpenOCD uses different (from Linux, the kernel) names, so they need to be added to avoid false positives. This is the old commit bb3cd6ec438d ("checkpatch: add logging functions") re-applied and updated. Change-Id: Ib18e4532cf7e1f79821b74c9bb6134a8a4e8be1b Signed-off-by: Paul Fertser <fer...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5119 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index edbd464b2..1daedd2f2 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -597,6 +597,7 @@ our $typeTypedefs = qr{(?x: our $zero_initializer = qr{(?:(?:0[xX])?0+$Int_type?|NULL|false)\b}; +if (!$OpenOCD) { our $logFunctions = qr{(?x: printk(?:_ratelimited|_once|_deferred_once|_deferred|)| (?:[a-z0-9]+_){1,2}(?:printk|emerg|alert|crit|err|warning|warn|notice|info|debug|dbg|vdbg|devel|cont|WARN)(?:_ratelimited|_once|)| @@ -606,6 +607,12 @@ our $logFunctions = qr{(?x: MODULE_[A-Z_]+| seq_vprintf|seq_printf|seq_puts )}; +} # !$OpenOCD +# OpenOCD specific: Begin: list log functions +our $logFunctions = qr{(?x: + LOG_(?:TARGET_|)(?:DEBUG_IO|DEBUG|INFO|WARNING|ERROR|USER|USER_N|OUTPUT) +)}; +# OpenOCD specific: End our $allocFunctions = qr{(?x: (?:(?:devm_)? ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 1 - tools/scripts/checkpatch.pl | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:18:19
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9c6c5b61b3c78a9f78152be6d403d9e3b76ef6f9 (commit) from 85a918b44d4f297e0dd30fc5bf6e798c991ddc6c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9c6c5b61b3c78a9f78152be6d403d9e3b76ef6f9 Author: Antonio Borneo <bor...@gm...> Date: Sat Jun 11 22:41:17 2022 +0200 checkpatch: add variable $OpenOCD The script checkpatch.pl require some adaptation for OpenOCD that cannot be achieved through the config file .checkpatch.conf; the script's code has to be modified. To merge new version of the script from Linux kernel it becomes relevant highlighting the changes, while minimizing the diff wrt the initial script. Add the perl variable '$OpenOCD' and suggest how to highlight changes. Change-Id: Ia8d26426850008f0465858a1d84cc774bc1146ed Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7021 Tested-by: jenkins diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 79e759aac..edbd464b2 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -22,6 +22,19 @@ my $V = '0.32'; use Getopt::Long qw(:config no_auto_abbrev); +# ATTENTION: easily track modification to this script for OpenOCD. +# When possible, don't modify the existing code, don't change its indentation, +# but remove it enclosing it within: +# +# if (!$OpenOCD) { +# original_code; +# } # !$OpenOCD +# +# Mark every addition within comments +# # OpenOCD specific: Begin[: additional comment] +# # OpenOCD specific: End +my $OpenOCD = 1; + my $quiet = 0; my $verbose = 0; my %verbose_messages = (); ----------------------------------------------------------------------- Summary of changes: tools/scripts/checkpatch.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:17:38
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 85a918b44d4f297e0dd30fc5bf6e798c991ddc6c (commit) from 8d395421ab359716843144dbe069607133a29b16 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 85a918b44d4f297e0dd30fc5bf6e798c991ddc6c Author: Antonio Borneo <bor...@gm...> Date: Wed Apr 17 09:50:27 2019 +0200 checkpatch: add OpenOCD specific config flags This initial setup covers the old commits: commit 09571d62bc1e ("checkpatch: disable extern and switch indent checks") commit 2f6f7c442d24 ("checkpatch: remove typedef check") commit 9ad57e96b3c1 ("checkpatch: remove volatile check") commit 3da783f62854 ("checkpatch: increase line length to 120") commit 2af5b97ba31f ("checkpatch: remove __packed and __aligned checks") commit 164450a01576 ("Change checkpatch.pl tab expanding to 4 characters.") It also skips the check for SPDX_LICENSE_TAG, not implemented in OpenOCD yet. Extend to the check in 'strict' mode and skip all the check that cannot apply on OpenOCD project. Change-Id: I6c3bdf27465dc563464fbc8fafbaec696e287624 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5117 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf index d931644f6..4f2c931ca 100644 --- a/.checkpatch.conf +++ b/.checkpatch.conf @@ -1,7 +1,32 @@ # SPDX-License-Identifier: GPL-2.0-or-later +--max-line-length=120 +--tab-size=4 +--show-types +--strict + +--ignore AVOID_EXTERNS +--ignore BLOCK_COMMENT_STYLE +--ignore CAMELCASE +--ignore COMPLEX_MACRO +--ignore CONST_STRUCT +--ignore ENOSYS --ignore FILE_PATH_CHANGES --ignore GERRIT_CHANGE_ID +--ignore LINE_SPACING +--ignore LOGICAL_CONTINUATIONS +--ignore MACRO_WITH_FLOW_CONTROL +--ignore NEW_TYPEDEFS +--ignore PARENTHESIS_ALIGNMENT +--ignore PREFER_DEFINED_ATTRIBUTE_MACRO +--ignore PREFER_FALLTHROUGH +--ignore PREFER_KERNEL_TYPES +--ignore SPDX_LICENSE_TAG +--ignore SPLIT_STRING +--ignore SSCANF_TO_KSTRTO +--ignore SWITCH_CASE_INDENT_LEVEL +--ignore TRACING_LOGGING +--ignore VOLATILE # Temporarily lines, to commit checkpatch itself. To be removed! --no-tree ----------------------------------------------------------------------- Summary of changes: .checkpatch.conf | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:17:16
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 8d395421ab359716843144dbe069607133a29b16 (commit) from 61d0757acf222fdd5669b471cc251e03101db273 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8d395421ab359716843144dbe069607133a29b16 Author: Antonio Borneo <bor...@gm...> Date: Tue Apr 16 23:10:45 2019 +0200 checkpatch: import new script version from kernel v6.0-rc3 Replace existing checkpatch script with the one available in the latest Linux kernel. Add also from the same kernel version the spelling database and the script spdxcheck.py, even if the script cannot be found by checkpatch in the current path. Add an empty "const_structs.checkpatch" file and an initial "spdxexclude" file. The script as is doesn't work properly in OpenOCD project. Further patches in this series are required. Gerrit will use the checkpatch in this commit to test/build the commit itself. A minimal configuration file is then required to avoid a failure in the test/build process. This commit includes the OpenOCD commits: commit 164450a01576 ("Change checkpatch.pl tab expanding to 4 characters.") commit 667d510dabd5 ("checkpatch: fix false indent trigger") already merged in upstream checkpatch in kernel v6.0-rc3. Change-Id: Ic9cdecff2df0a1e23cdb01d10f14c5988480b8d6 Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/5116 Tested-by: jenkins diff --git a/.checkpatch.conf b/.checkpatch.conf new file mode 100644 index 000000000..d931644f6 --- /dev/null +++ b/.checkpatch.conf @@ -0,0 +1,9 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +--ignore FILE_PATH_CHANGES +--ignore GERRIT_CHANGE_ID + +# Temporarily lines, to commit checkpatch itself. To be removed! +--no-tree +--ignore BAD_SIGN_OFF +--ignore TYPO_SPELLING diff --git a/doc/checkpatch.rst b/doc/checkpatch.rst new file mode 100644 index 000000000..b52452bc2 --- /dev/null +++ b/doc/checkpatch.rst @@ -0,0 +1,1249 @@ +.. SPDX-License-Identifier: GPL-2.0-only + +========== +Checkpatch +========== + +Checkpatch (scripts/checkpatch.pl) is a perl script which checks for trivial +style violations in patches and optionally corrects them. Checkpatch can +also be run on file contexts and without the kernel tree. + +Checkpatch is not always right. Your judgement takes precedence over checkpatch +messages. If your code looks better with the violations, then its probably +best left alone. + + +Options +======= + +This section will describe the options checkpatch can be run with. + +Usage:: + + ./scripts/checkpatch.pl [OPTION]... [FILE]... + +Available options: + + - -q, --quiet + + Enable quiet mode. + + - -v, --verbose + Enable verbose mode. Additional verbose test descriptions are output + so as to provide information on why that particular message is shown. + + - --no-tree + + Run checkpatch without the kernel tree. + + - --no-signoff + + Disable the 'Signed-off-by' line check. The sign-off is a simple line at + the end of the explanation for the patch, which certifies that you wrote it + or otherwise have the right to pass it on as an open-source patch. + + Example:: + + Signed-off-by: Random J Developer <ra...@de...> + + Setting this flag effectively stops a message for a missing signed-off-by + line in a patch context. + + - --patch + + Treat FILE as a patch. This is the default option and need not be + explicitly specified. + + - --emacs + + Set output to emacs compile window format. This allows emacs users to jump + from the error in the compile window directly to the offending line in the + patch. + + - --terse + + Output only one line per report. + + - --showfile + + Show the diffed file position instead of the input file position. + + - -g, --git + + Treat FILE as a single commit or a git revision range. + + Single commit with: + + - <rev> + - <rev>^ + - <rev>~n + + Multiple commits with: + + - <rev1>..<rev2> + - <rev1>...<rev2> + - <rev>-<count> + + - -f, --file + + Treat FILE as a regular source file. This option must be used when running + checkpatch on source files in the kernel. + + - --subjective, --strict + + Enable stricter tests in checkpatch. By default the tests emitted as CHECK + do not activate by default. Use this flag to activate the CHECK tests. + + - --list-types + + Every message emitted by checkpatch has an associated TYPE. Add this flag + to display all the types in checkpatch. + + Note that when this flag is active, checkpatch does not read the input FILE, + and no message is emitted. Only a list of types in checkpatch is output. + + - --types TYPE(,TYPE2...) + + Only display messages with the given types. + + Example:: + + ./scripts/checkpatch.pl mypatch.patch --types EMAIL_SUBJECT,BRACES + + - --ignore TYPE(,TYPE2...) + + Checkpatch will not emit messages for the specified types. + + Example:: + + ./scripts/checkpatch.pl mypatch.patch --ignore EMAIL_SUBJECT,BRACES + + - --show-types + + By default checkpatch doesn't display the type associated with the messages. + Set this flag to show the message type in the output. + + - --max-line-length=n + + Set the max line length (default 100). If a line exceeds the specified + length, a LONG_LINE message is emitted. + + + The message level is different for patch and file contexts. For patches, + a WARNING is emitted. While a milder CHECK is emitted for files. So for + file contexts, the --strict flag must also be enabled. + + - --min-conf-desc-length=n + + Set the Kconfig entry minimum description length, if shorter, warn. + + - --tab-size=n + + Set the number of spaces for tab (default 8). + + - --root=PATH + + PATH to the kernel tree root. + + This option must be specified when invoking checkpatch from outside + the kernel root. + + - --no-summary + + Suppress the per file summary. + + - --mailback + + Only produce a report in case of Warnings or Errors. Milder Checks are + excluded from this. + + - --summary-file + + Include the filename in summary. + + - --debug KEY=[0|1] + + Turn on/off debugging of KEY, where KEY is one of 'values', 'possible', + 'type', and 'attr' (default is all off). + + - --fix + + This is an EXPERIMENTAL feature. If correctable errors exists, a file + <inputfile>.EXPERIMENTAL-checkpatch-fixes is created which has the + automatically fixable errors corrected. + + - --fix-inplace + + EXPERIMENTAL - Similar to --fix but input file is overwritten with fixes. + + DO NOT USE this flag unless you are absolutely sure and you have a backup + in place. + + - --ignore-perl-version + + Override checking of perl version. Runtime errors maybe encountered after + enabling this flag if the perl version does not meet the minimum specified. + + - --codespell + + Use the codespell dictionary for checking spelling errors. + + - --codespellfile + + Use the specified codespell file. + Default is '/usr/share/codespell/dictionary.txt'. + + - --typedefsfile + + Read additional types from this file. + + - --color[=WHEN] + + Use colors 'always', 'never', or only when output is a terminal ('auto'). + Default is 'auto'. + + - --kconfig-prefix=WORD + + Use WORD as a prefix for Kconfig symbols (default is `CONFIG_`). + + - -h, --help, --version + + Display the help text. + +Message Levels +============== + +Messages in checkpatch are divided into three levels. The levels of messages +in checkpatch denote the severity of the error. They are: + + - ERROR + + This is the most strict level. Messages of type ERROR must be taken + seriously as they denote things that are very likely to be wrong. + + - WARNING + + This is the next stricter level. Messages of type WARNING requires a + more careful review. But it is milder than an ERROR. + + - CHECK + + This is the mildest level. These are things which may require some thought. + +Type Descriptions +================= + +This section contains a description of all the message types in checkpatch. + +.. Types in this section are also parsed by checkpatch. +.. The types are grouped into subsections based on use. + + +Allocation style +---------------- + + **ALLOC_ARRAY_ARGS** + The first argument for kcalloc or kmalloc_array should be the + number of elements. sizeof() as the first argument is generally + wrong. + + See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html + + **ALLOC_SIZEOF_STRUCT** + The allocation style is bad. In general for family of + allocation functions using sizeof() to get memory size, + constructs like:: + + p = alloc(sizeof(struct foo), ...) + + should be:: + + p = alloc(sizeof(*p), ...) + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#allocating-memory + + **ALLOC_WITH_MULTIPLY** + Prefer kmalloc_array/kcalloc over kmalloc/kzalloc with a + sizeof multiply. + + See: https://www.kernel.org/doc/html/latest/core-api/memory-allocation.html + + +API usage +--------- + + **ARCH_DEFINES** + Architecture specific defines should be avoided wherever + possible. + + **ARCH_INCLUDE_LINUX** + Whenever asm/file.h is included and linux/file.h exists, a + conversion can be made when linux/file.h includes asm/file.h. + However this is not always the case (See signal.h). + This message type is emitted only for includes from arch/. + + **AVOID_BUG** + BUG() or BUG_ON() should be avoided totally. + Use WARN() and WARN_ON() instead, and handle the "impossible" + error condition as gracefully as possible. + + See: https://www.kernel.org/doc/html/latest/process/deprecated.html#bug-and-bug-on + + **CONSIDER_KSTRTO** + The simple_strtol(), simple_strtoll(), simple_strtoul(), and + simple_strtoull() functions explicitly ignore overflows, which + may lead to unexpected results in callers. The respective kstrtol(), + kstrtoll(), kstrtoul(), and kstrtoull() functions tend to be the + correct replacements. + + See: https://www.kernel.org/doc/html/latest/process/deprecated.html#simple-strtol-simple-strtoll-simple-strtoul-simple-strtoull + + **CONSTANT_CONVERSION** + Use of __constant_<foo> form is discouraged for the following functions:: + + __constant_cpu_to_be[x] + __constant_cpu_to_le[x] + __constant_be[x]_to_cpu + __constant_le[x]_to_cpu + __constant_htons + __constant_ntohs + + Using any of these outside of include/uapi/ is not preferred as using the + function without __constant_ is identical when the argument is a + constant. + + In big endian systems, the macros like __constant_cpu_to_be32(x) and + cpu_to_be32(x) expand to the same expression:: + + #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x)) + #define __cpu_to_be32(x) ((__force __be32)(__u32)(x)) + + In little endian systems, the macros __constant_cpu_to_be32(x) and + cpu_to_be32(x) expand to __constant_swab32 and __swab32. __swab32 + has a __builtin_constant_p check:: + + #define __swab32(x) \ + (__builtin_constant_p((__u32)(x)) ? \ + ___constant_swab32(x) : \ + __fswab32(x)) + + So ultimately they have a special case for constants. + Similar is the case with all of the macros in the list. Thus + using the __constant_... forms are unnecessarily verbose and + not preferred outside of include/uapi. + + See: https://lore.kernel.org/lkml/1400106425.12666.6.camel@joe-AO725/ + + **DEPRECATED_API** + Usage of a deprecated RCU API is detected. It is recommended to replace + old flavourful RCU APIs by their new vanilla-RCU counterparts. + + The full list of available RCU APIs can be viewed from the kernel docs. + + See: https://www.kernel.org/doc/html/latest/RCU/whatisRCU.html#full-list-of-rcu-apis + + **DEPRECATED_VARIABLE** + EXTRA_{A,C,CPP,LD}FLAGS are deprecated and should be replaced by the new + flags added via commit f77bf01425b1 ("kbuild: introduce ccflags-y, + asflags-y and ldflags-y"). + + The following conversion scheme maybe used:: + + EXTRA_AFLAGS -> asflags-y + EXTRA_CFLAGS -> ccflags-y + EXTRA_CPPFLAGS -> cppflags-y + EXTRA_LDFLAGS -> ldflags-y + + See: + + 1. https://lore.kernel.org/lkml/200...@ur.../ + 2. https://lore.kernel.org/lkml/131...@gm.../ + 3. https://www.kernel.org/doc/html/latest/kbuild/makefiles.html#compilation-flags + + **DEVICE_ATTR_FUNCTIONS** + The function names used in DEVICE_ATTR is unusual. + Typically, the store and show functions are used with <attr>_store and + <attr>_show, where <attr> is a named attribute variable of the device. + + Consider the following examples:: + + static DEVICE_ATTR(type, 0444, type_show, NULL); + static DEVICE_ATTR(power, 0644, power_show, power_store); + + The function names should preferably follow the above pattern. + + See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes + + **DEVICE_ATTR_RO** + The DEVICE_ATTR_RO(name) helper macro can be used instead of + DEVICE_ATTR(name, 0444, name_show, NULL); + + Note that the macro automatically appends _show to the named + attribute variable of the device for the show method. + + See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes + + **DEVICE_ATTR_RW** + The DEVICE_ATTR_RW(name) helper macro can be used instead of + DEVICE_ATTR(name, 0644, name_show, name_store); + + Note that the macro automatically appends _show and _store to the + named attribute variable of the device for the show and store methods. + + See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes + + **DEVICE_ATTR_WO** + The DEVICE_AATR_WO(name) helper macro can be used instead of + DEVICE_ATTR(name, 0200, NULL, name_store); + + Note that the macro automatically appends _store to the + named attribute variable of the device for the store method. + + See: https://www.kernel.org/doc/html/latest/driver-api/driver-model/device.html#attributes + + **DUPLICATED_SYSCTL_CONST** + Commit d91bff3011cf ("proc/sysctl: add shared variables for range + check") added some shared const variables to be used instead of a local + copy in each source file. + + Consider replacing the sysctl range checking value with the shared + one in include/linux/sysctl.h. The following conversion scheme may + be used:: + + &zero -> SYSCTL_ZERO + &one -> SYSCTL_ONE + &int_max -> SYSCTL_INT_MAX + + See: + + 1. https://lore.kernel.org/lkml/201...@re.../ + 2. https://lore.kernel.org/lkml/201...@re.../ + + **ENOSYS** + ENOSYS means that a nonexistent system call was called. + Earlier, it was wrongly used for things like invalid operations on + otherwise valid syscalls. This should be avoided in new code. + + See: https://lore.kernel.org/lkml/5eb...@am.../ + + **ENOTSUPP** + ENOTSUPP is not a standard error code and should be avoided in new patches. + EOPNOTSUPP should be used instead. + + See: https://lore.kernel.org/netdev/202...@lu.../ + + **EXPORT_SYMBOL** + EXPORT_SYMBOL should immediately follow the symbol to be exported. + + **IN_ATOMIC** + in_atomic() is not for driver use so any such use is reported as an ERROR. + Also in_atomic() is often used to determine if sleeping is permitted, + but it is not reliable in this use model. Therefore its use is + strongly discouraged. + + However, in_atomic() is ok for core kernel use. + + See: https://lore.kernel.org/lkml/200...@li.../ + + **LOCKDEP** + The lockdep_no_validate class was added as a temporary measure to + prevent warnings on conversion of device->sem to device->mutex. + It should not be used for any other purpose. + + See: https://lore.kernel.org/lkml/1268959062.9440.467.camel@laptop/ + + **MALFORMED_INCLUDE** + The #include statement has a malformed path. This has happened + because the author has included a double slash "//" in the pathname + accidentally. + + **USE_LOCKDEP** + lockdep_assert_held() annotations should be preferred over + assertions based on spin_is_locked() + + See: https://www.kernel.org/doc/html/latest/locking/lockdep-design.html#annotations + + **UAPI_INCLUDE** + No #include statements in include/uapi should use a uapi/ path. + + **USLEEP_RANGE** + usleep_range() should be preferred over udelay(). The proper way of + using usleep_range() is mentioned in the kernel docs. + + See: https://www.kernel.org/doc/html/latest/timers/timers-howto.html#delays-information-on-the-various-kernel-delay-sleep-mechanisms + + +Comments +-------- + + **BLOCK_COMMENT_STYLE** + The comment style is incorrect. The preferred style for multi- + line comments is:: + + /* + * This is the preferred style + * for multi line comments. + */ + + The networking comment style is a bit different, with the first line + not empty like the former:: + + /* This is the preferred comment style + * for files in net/ and drivers/net/ + */ + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting + + **C99_COMMENTS** + C99 style single line comments (//) should not be used. + Prefer the block comment style instead. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#commenting + + **DATA_RACE** + Applications of data_race() should have a comment so as to document the + reasoning behind why it was deemed safe. + + See: https://lore.kernel.org/lkml/202...@go.../ + + **FSF_MAILING_ADDRESS** + Kernel maintainers reject new instances of the GPL boilerplate paragraph + directing people to write to the FSF for a copy of the GPL, since the + FSF has moved in the past and may do so again. + So do not write paragraphs about writing to the Free Software Foundation's + mailing address. + + See: https://lore.kernel.org/lkml/20131006222342.GT19510@leaf/ + + +Commit message +-------------- + + **BAD_SIGN_OFF** + The signed-off-by line does not fall in line with the standards + specified by the community. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1 + + **BAD_STABLE_ADDRESS_STYLE** + The email format for stable is incorrect. + Some valid options for stable address are:: + + 1. st...@vg... + 2. st...@ke... + + For adding version info, the following comment style should be used:: + + st...@vg... # version info + + **COMMIT_COMMENT_SYMBOL** + Commit log lines starting with a '#' are ignored by git as + comments. To solve this problem addition of a single space + infront of the log line is enough. + + **COMMIT_MESSAGE** + The patch is missing a commit description. A brief + description of the changes made by the patch should be added. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes + + **EMAIL_SUBJECT** + Naming the tool that found the issue is not very useful in the + subject line. A good subject line summarizes the change that + the patch brings. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes + + **FROM_SIGN_OFF_MISMATCH** + The author's email does not match with that in the Signed-off-by: + line(s). This can be sometimes caused due to an improperly configured + email client. + + This message is emitted due to any of the following reasons:: + + - The email names do not match. + - The email addresses do not match. + - The email subaddresses do not match. + - The email comments do not match. + + **MISSING_SIGN_OFF** + The patch is missing a Signed-off-by line. A signed-off-by + line should be added according to Developer's certificate of + Origin. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin + + **NO_AUTHOR_SIGN_OFF** + The author of the patch has not signed off the patch. It is + required that a simple sign off line should be present at the + end of explanation of the patch to denote that the author has + written it or otherwise has the rights to pass it on as an open + source patch. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#sign-your-work-the-developer-s-certificate-of-origin + + **DIFF_IN_COMMIT_MSG** + Avoid having diff content in commit message. + This causes problems when one tries to apply a file containing both + the changelog and the diff because patch(1) tries to apply the diff + which it found in the changelog. + + See: https://lore.kernel.org/lkml/201...@li.../ + + **GERRIT_CHANGE_ID** + To be picked up by gerrit, the footer of the commit message might + have a Change-Id like:: + + Change-Id: Ic8aaa0728a43936cd4c6e1ed590e01ba8f0fbf5b + Signed-off-by: A. U. Thor <au...@ex...> + + The Change-Id line must be removed before submitting. + + **GIT_COMMIT_ID** + The proper way to reference a commit id is: + commit <12+ chars of sha1> ("<title line>") + + An example may be:: + + Commit e21d2170f36602ae2708 ("video: remove unnecessary + platform_set_drvdata()") removed the unnecessary + platform_set_drvdata(), but left the variable "dev" unused, + delete it. + + See: https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes + + +Comparison style +---------------- + + **ASSIGN_IN_IF** + Do not use assignments in if condition. + Example:: + + if ((foo = bar(...)) < BAZ) { + + should be written as:: + + foo = bar(...); + if (foo < BAZ) { + + **BOOL_COMPARISON** + Comparisons of A to true and false are better written + as A and !A. + + See: https://lore.kernel.org/lkml/1365563834.27174.12.camel@joe-AO722/ + + **COMPARISON_TO_NULL** + Comparisons to NULL in the form (foo == NULL) or (foo != NULL) + are better written as (!foo) and (foo). + + **CONSTANT_COMPARISON** + Comparisons with a constant or upper case identifier on the left + side of the test should be avoided. + + +Indentation and Line Breaks +--------------------------- + + **CODE_INDENT** + Code indent should use tabs instead of spaces. + Outside of comments, documentation and Kconfig, + spaces are never used for indentation. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation + + **DEEP_INDENTATION** + Indentation with 6 or more tabs usually indicate overly indented + code. + + It is suggested to refactor excessive indentation of + if/else/for/do/while/switch statements. + + See: https://lore.kernel.org/lkml/1328311239.21255.24.camel@joe2Laptop/ + + **SWITCH_CASE_INDENT_LEVEL** + switch should be at the same indent as case. + Example:: + + switch (suffix) { + case 'G': + case 'g': + mem <<= 30; + break; + case 'M': + case 'm': + mem <<= 20; + break; + case 'K': + case 'k': + mem <<= 10; + fallthrough; + default: + break; + } + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#indentation + + **LONG_LINE** + The line has exceeded the specified maximum length. + To use a different maximum line length, the --max-line-length=n option + may be added while invoking checkpatch. + + Earlier, the default line length was 80 columns. Commit bdc48fa11e46 + ("checkpatch/coding-style: deprecate 80-column warning") increased the + limit to 100 columns. This is not a hard limit either and it's + preferable to stay within 80 columns whenever possible. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings + + **LONG_LINE_STRING** + A string starts before but extends beyond the maximum line length. + To use a different maximum line length, the --max-line-length=n option + may be added while invoking checkpatch. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings + + **LONG_LINE_COMMENT** + A comment starts before but extends beyond the maximum line length. + To use a different maximum line length, the --max-line-length=n option + may be added while invoking checkpatch. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#breaking-long-lines-and-strings + + **SPLIT_STRING** + Quoted strings that appear as messages in userspace and can be + grepped, should not be split across multiple lines. + + See: https://lore.kernel.org/lkml/20120203052727.GA15035@leaf/ + + **MULTILINE_DEREFERENCE** + A single dereferencing identifier spanned on multiple lines like:: + + struct_identifier->member[index]. + member = <foo>; + + is generally hard to follow. It can easily lead to typos and so makes + the code vulnerable to bugs. + + If fixing the multiple line dereferencing leads to an 80 column + violation, then either rewrite the code in a more simple way or if the + starting part of the dereferencing identifier is the same and used at + multiple places then store it in a temporary variable, and use that + temporary variable only at all the places. For example, if there are + two dereferencing identifiers:: + + member1->member2->member3.foo1; + member1->member2->member3.foo2; + + then store the member1->member2->member3 part in a temporary variable. + It not only helps to avoid the 80 column violation but also reduces + the program size by removing the unnecessary dereferences. + + But if none of the above methods work then ignore the 80 column + violation because it is much easier to read a dereferencing identifier + on a single line. + + **TRAILING_STATEMENTS** + Trailing statements (for example after any conditional) should be + on the next line. + Statements, such as:: + + if (x == y) break; + + should be:: + + if (x == y) + break; + + +Macros, Attributes and Symbols +------------------------------ + + **ARRAY_SIZE** + The ARRAY_SIZE(foo) macro should be preferred over + sizeof(foo)/sizeof(foo[0]) for finding number of elements in an + array. + + The macro is defined in include/linux/kernel.h:: + + #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + + **AVOID_EXTERNS** + Function prototypes don't need to be declared extern in .h + files. It's assumed by the compiler and is unnecessary. + + **AVOID_L_PREFIX** + Local symbol names that are prefixed with `.L` should be avoided, + as this has special meaning for the assembler; a symbol entry will + not be emitted into the symbol table. This can prevent `objtool` + from generating correct unwind info. + + Symbols with STB_LOCAL binding may still be used, and `.L` prefixed + local symbol names are still generally usable within a function, + but `.L` prefixed local symbol names should not be used to denote + the beginning or end of code regions via + `SYM_CODE_START_LOCAL`/`SYM_CODE_END` + + **BIT_MACRO** + Defines like: 1 << <digit> could be BIT(digit). + The BIT() macro is defined via include/linux/bits.h:: + + #define BIT(nr) (1UL << (nr)) + + **CONST_READ_MOSTLY** + When a variable is tagged with the __read_mostly annotation, it is a + signal to the compiler that accesses to the variable will be mostly + reads and rarely(but NOT never) a write. + + const __read_mostly does not make any sense as const data is already + read-only. The __read_mostly annotation thus should be removed. + + **DATE_TIME** + It is generally desirable that building the same source code with + the same set of tools is reproducible, i.e. the output is always + exactly the same. + + The kernel does *not* use the ``__DATE__`` and ``__TIME__`` macros, + and enables warnings if they are used as they can lead to + non-deterministic builds. + + See: https://www.kernel.org/doc/html/latest/kbuild/reproducible-builds.html#timestamps + + **DEFINE_ARCH_HAS** + The ARCH_HAS_xyz and ARCH_HAVE_xyz patterns are wrong. + + For big conceptual features use Kconfig symbols instead. And for + smaller things where we have compatibility fallback functions but + want architectures able to override them with optimized ones, we + should either use weak functions (appropriate for some cases), or + the symbol that protects them should be the same symbol we use. + + See: https://lore.kernel.org/lkml/CA+...@ma.../ + + **DO_WHILE_MACRO_WITH_TRAILING_SEMICOLON** + do {} while(0) macros should not have a trailing semicolon. + + **INIT_ATTRIBUTE** + Const init definitions should use __initconst instead of + __initdata. + + Similarly init definitions without const require a separate + use of const. + + **INLINE_LOCATION** + The inline keyword should sit between storage class and type. + + For example, the following segment:: + + inline static int example_function(void) + { + ... + } + + should be:: + + static inline int example_function(void) + { + ... + } + + **MISPLACED_INIT** + It is possible to use section markers on variables in a way + which gcc doesn't understand (or at least not the way the + developer intended):: + + static struct __initdata samsung_pll_clock exynos4_plls[nr_plls] = { + + does not put exynos4_plls in the .initdata section. The __initdata + marker can be virtually anywhere on the line, except right after + "struct". The preferred location is before the "=" sign if there is + one, or before the trailing ";" otherwise. + + See: https://lore.kernel.org/lkml/1377655732.3619.19.camel@joe-AO722/ + + **MULTISTATEMENT_MACRO_USE_DO_WHILE** + Macros with multiple statements should be enclosed in a + do - while block. Same should also be the case for macros + starting with `if` to avoid logic defects:: + + #define macrofun(a, b, c) \ + do { \ + if (a == 5) \ + do_this(b, c); \ + } while (0) + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#macros-enums-and-rtl + + **PREFER_FALLTHROUGH** + Use the `fallthrough;` pseudo keyword instead of + `/* fallthrough */` like comments. + + **TRAILING_SEMICOLON** + Macro definition should not end with a semicolon. The macro + invocation style should be consistent with function calls. + This can prevent any unexpected code paths:: + + #define MAC do_something; + + If this macro is used within a if else statement, like:: + + if (some_condition) + MAC; + + else + do_something; + + Then there would be a compilation error, because when the macro is + expanded there are two trailing semicolons, so the else branch gets + orphaned. + + See: https://lore.kernel.org/lkml/1399671106.2912.21.camel@joe-AO725/ + + **SINGLE_STATEMENT_DO_WHILE_MACRO** + For the multi-statement macros, it is necessary to use the do-while + loop to avoid unpredictable code paths. The do-while loop helps to + group the multiple statements into a single one so that a + function-like macro can be used as a function only. + + But for the single statement macros, it is unnecessary to use the + do-while loop. Although the code is syntactically correct but using + the do-while loop is redundant. So remove the do-while loop for single + statement macros. + + **WEAK_DECLARATION** + Using weak declarations like __attribute__((weak)) or __weak + can have unintended link defects. Avoid using them. + + +Functions and Variables +----------------------- + + **CAMELCASE** + Avoid CamelCase Identifiers. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#naming + + **CONST_CONST** + Using `const <type> const *` is generally meant to be + written `const <type> * const`. + + **CONST_STRUCT** + Using const is generally a good idea. Checkpatch reads + a list of frequently used structs that are always or + almost always constant. + + The existing structs list can be viewed from + `scripts/const_structs.checkpatch`. + + See: https://lore.kernel.org/lkml/alpine.DEB.2.10.1608281509480.3321@hadrien/ + + **EMBEDDED_FUNCTION_NAME** + Embedded function names are less appropriate to use as + refactoring can cause function renaming. Prefer the use of + "%s", __func__ to embedded function names. + + Note that this does not work with -f (--file) checkpatch option + as it depends on patch context providing the function name. + + **FUNCTION_ARGUMENTS** + This warning is emitted due to any of the following reasons: + + 1. Arguments for the function declaration do not follow + the identifier name. Example:: + + void foo + (int bar, int baz) + + This should be corrected to:: + + void foo(int bar, int baz) + + 2. Some arguments for the function definition do not + have an identifier name. Example:: + + void foo(int) + + All arguments should have identifier names. + + **FUNCTION_WITHOUT_ARGS** + Function declarations without arguments like:: + + int foo() + + should be:: + + int foo(void) + + **GLOBAL_INITIALISERS** + Global variables should not be initialized explicitly to + 0 (or NULL, false, etc.). Your compiler (or rather your + loader, which is responsible for zeroing out the relevant + sections) automatically does it for you. + + **INITIALISED_STATIC** + Static variables should not be initialized explicitly to zero. + Your compiler (or rather your loader) automatically does + it for you. + + **MULTIPLE_ASSIGNMENTS** + Multiple assignments on a single line makes the code unnecessarily + complicated. So on a single line assign value to a single variable + only, this makes the code more readable and helps avoid typos. + + **RETURN_PARENTHESES** + return is not a function and as such doesn't need parentheses:: + + return (bar); + + can simply be:: + + return bar; + + +Permissions +----------- + + **DEVICE_ATTR_PERMS** + The permissions used in DEVICE_ATTR are unusual. + Typically only three permissions are used - 0644 (RW), 0444 (RO) + and 0200 (WO). + + See: https://www.kernel.org/doc/html/latest/filesystems/sysfs.html#attributes + + **EXECUTE_PERMISSIONS** + There is no reason for source files to be executable. The executable + bit can be removed safely. + + **EXPORTED_WORLD_WRITABLE** + Exporting world writable sysfs/debugfs files is usually a bad thing. + When done arbitrarily they can introduce serious security bugs. + In the past, some of the debugfs vulnerabilities would seemingly allow + any local user to write arbitrary values into device registers - a + situation from which little good can be expected to emerge. + + See: https://lore.kernel.org/linux-arm-kernel/cov...@op.../ + + **NON_OCTAL_PERMISSIONS** + Permission bits should use 4 digit octal permissions (like 0700 or 0444). + Avoid using any other base like decimal. + + **SYMBOLIC_PERMS** + Permission bits in the octal form are more readable and easier to + understand than their symbolic counterparts because many command-line + tools use this notation. Experienced kernel developers have been using + these traditional Unix permission bits for decades and so they find it + easier to understand the octal notation than the symbolic macros. + For example, it is harder to read S_IWUSR|S_IRUGO than 0644, which + obscures the developer's intent rather than clarifying it. + + See: https://lore.kernel.org/lkml/CA+...@ma.../ + + +Spacing and Brackets +-------------------- + + **ASSIGNMENT_CONTINUATIONS** + Assignment operators should not be written at the start of a + line but should follow the operand at the previous line. + + **BRACES** + The placement of braces is stylistically incorrect. + The preferred way is to put the opening brace last on the line, + and put the closing brace first:: + + if (x is true) { + we do y + } + + This applies for all non-functional blocks. + However, there is one special case, namely functions: they have the + opening brace at the beginning of the next line, thus:: + + int function(int x) + { + body of function + } + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces + + **BRACKET_SPACE** + Whitespace before opening bracket '[' is prohibited. + There are some exceptions: + + 1. With a type on the left:: + + int [] a; + + 2. At the beginning of a line for slice initialisers:: + + [0...10] = 5, + + 3. Inside a curly brace:: + + = { [0...10] = 5 } + + **CONCATENATED_STRING** + Concatenated elements should have a space in between. + Example:: + + printk(KERN_INFO"bar"); + + should be:: + + printk(KERN_INFO "bar"); + + **ELSE_AFTER_BRACE** + `else {` should follow the closing block `}` on the same line. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces + + **LINE_SPACING** + Vertical space is wasted given the limited number of lines an + editor window can display when multiple blank lines are used. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces + + **OPEN_BRACE** + The opening brace should be following the function definitions on the + next line. For any non-functional block it should be on the same line + as the last construct. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces + + **POINTER_LOCATION** + When using pointer data or a function that returns a pointer type, + the preferred use of * is adjacent to the data name or function name + and not adjacent to the type name. + Examples:: + + char *linux_banner; + unsigned long long memparse(char *ptr, char **retptr); + char *match_strdup(substring_t *s); + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces + + **SPACING** + Whitespace style used in the kernel sources is described in kernel docs. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces + + **TRAILING_WHITESPACE** + Trailing whitespace should always be removed. + Some editors highlight the trailing whitespace and cause visual + distractions when editing files. + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#spaces + + **UNNECESSARY_PARENTHESES** + Parentheses are not required in the following cases: + + 1. Function pointer uses:: + + (foo->bar)(); + + could be:: + + foo->bar(); + + 2. Comparisons in if:: + + if ((foo->bar) && (foo->baz)) + if ((foo == bar)) + + could be:: + + if (foo->bar && foo->baz) + if (foo == bar) + + 3. addressof/dereference single Lvalues:: + + &(foo->bar) + *(foo->bar) + + could be:: + + &foo->bar + *foo->bar + + **WHILE_AFTER_BRACE** + while should follow the closing bracket on the same line:: + + do { + ... + } while(something); + + See: https://www.kernel.org/doc/html/latest/process/coding-style.html#placing-braces-and-spaces + + +Others +------ + + **CONFIG_DESCRIPTION** + Kconfig symbols should have a help text which fully describes + it. + + **CORRUPTED_PATCH** + The patch seems to be corrupted or lines are wrapped. + Please regenerate the patch file before sending it to the maintainer. + + **CVS_KEYWORD** + Since linux moved to git, the CVS markers are no longer used. + So, CVS style keywords ($Id$, $Revision$, $Log$) should not be + added. + + **DEFAULT_NO_BREAK** + switch default case is sometimes written as "default:;". This can + cause new cases added below default to be defective. + + A "break;" should be added after empty default statement to avoid + unwanted fallthrough. + + **DOS_LINE_ENDINGS** + For DOS-formatted patches, there are extra ^M symbols at the end of + the line. These should be removed. + + **DT_SCHEMA_BINDING_PATCH** + DT bindings moved to a json-schema based format instead of + freeform text. + + See: https://www.kernel.org/doc/html/latest/devicetree/bindings/writing-schema.html + + **DT_SPLIT_BINDING_PATCH** + Devicetree bindings should be their own patch. This is because + bindings are logically independent from a driver implementation, + they have a different maintainer (even though they often + are applied via the same tree), and it makes for a cleaner history in the + DT only tree created with git-filter-branch. + + See: https://www.kernel.org/doc/html/latest/devicetree/bindings/submitting-patches.html#i-for-patch-submitters + + **EMBEDDED_FILENAME** + Embedding the complete filename path inside the file isn't particularly + useful as often the path is moved around and becomes incorrect. + + **FILE_PATH_CHANGES** + Whenever files are added, moved, or deleted, the MAINTAINERS file + patterns can be out of sync or outdated. + + So MAINTAINERS might need updating in these cases. + + **MEMSET** + The memset use appears to be incorrect. This may be caused due to + badly ordered parameters. Please recheck the usage. + + **NOT_UNIFIED_DIFF** + The patch file does not appear to be in unified-diff format. Please + regenerate the patch file before sending it to the maintainer. + + **PRINTF_0XDECIMAL** + Prefixing 0x with decimal output is defective and should be corrected. + + **SPDX_LICENSE_TAG** + The source file is missing or has an improper SPDX identifier tag. + The Linux kernel requires the precise SPDX identifier in all source files, + and it is thoroughly documented in the kernel docs. + + See: https://www.kernel.org/doc/html/latest/process/license-rules.html + + **TYPO_SPELLING** + Some words may have been misspelled. Consider reviewing them. diff --git a/tools/scripts/checkpatch.pl b/tools/scripts/checkpatch.pl index 0a119f1ba..79e759aac 100755 --- a/tools/scripts/checkpatch.pl +++ b/tools/scripts/checkpatch.pl @@ -1,38 +1,78 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl +# SPDX-License-Identifier: GPL-2.0 +# # (c) 2001, Dave Jones. (the file handling bit) # (c) 2005, Joel Schopp <js...@au...> (the ugly bit) # (c) 2007,2008, Andy Whitcroft <ap...@uk...> (new conditions, test suite) # (c) 2008-2010 Andy Whitcroft <ap...@ca...> -# Licensed under the terms of the GNU GPL License version 2 +# (c) 2010-2018 Joe Perches <jo...@pe...> use strict; +use warnings; +use POSIX; +use File::Basename; +use Cwd 'abs_path'; +use Term::ANSIColor qw(:constants); +use Encode qw(decode encode); my $P = $0; -$P =~ s@.*/@@g; +my $D = dirname(abs_path($P)); my $V = '0.32'; use Getopt::Long qw(:config no_auto_abbrev); my $quiet = 0; +my $verbose = 0; +my %verbose_messages = (); +my %verbose_emitted = (); my $tree = 1; my $chk_signoff = 1; my $chk_patch = 1; my $tst_only; my $emacs = 0; my $terse = 0; +my $showfile = 0; my $file = 0; +my $git = 0; +my %git_commits = (); my $check = 0; +my $check_orig = 0; my $summary = 1; my $mailback = 0; my $summary_file = 0; my $show_types = 0; +my $list_types = 0; +my $fix = 0; +my $fix_inplace = 0; my $root; +my $gitroot = $ENV{'GIT_DIR'}; +$gitroot = ".git" if !defined($gitroot); my %debug; +my %camelcase = (); +my %use_type = (); +my @use = (); my %ignore_type = (); my @ignore = (); my $help = 0; my $configuration_file = ".checkpatch.conf"; +my $max_line_length = 100; +my $ignore_perl_version = 0; +my $minimum_perl_version = 5.10.0; +my $min_conf_desc_length = 4; +my $spelling_file = "$D/spelling.txt"; +my $codespell = 0; +my $codespellfile = "/usr/share/codespell/dictionary.txt"; +my $user_codespellfile = ""; +my $conststructsfile = "$D/const_structs.checkpatch"; +my $docsfile = "$D/../Documentation/dev-tools/checkpatch.rst"; +my $typedefsfile; +my $color = "auto"; +my $allow_c99_comments = 1; # Can be overridden by --ignore C99_COMMENT_TOLERANCE +# git output parsing needs US English output, so first set backtick child process LANGUAGE +my $git_command ='export LANGUAGE=en_US.UTF-8; git'; +my $tabsize = 8; +my ${CONFIG_} = "CONFIG_"; sub help { my ($exitcode) = @_; @@ -43,16 +83,35 @@ Version: $V Options: -q, --quiet quiet - --no-tree run without a openocd tree + -v, --verbose verbose mode + --no-tree run without a kernel tree --no-signoff do not check for 'Signed-off-by' line --patch treat FILE as patchfile (default) --emacs emacs compile window format --terse one line per report + --showfile emit diffed file position, not input file position + -g, --git treat FILE as a single commit or git revision range + single git commit with: + <rev> + <rev>^ + <rev>~n + multiple git commits with: + <rev1>..<rev2> + <rev1>...<rev2> + <rev>-<count> + git merges are ignored -f, --file treat FILE as regular source file --subjective, --strict enable more subjective tests + --list-types list the possible message types + --types TYPE(,TYPE2...) show only these comma separated message types --ignore TYPE(,TYPE2...) ignore various comma separated message types - --show-types show the message "types" in the output - --root=PATH PATH to the openocd tree root + --show-types show the specific message type in the output + --max-line-length=n set the maximum line length, (default $max_line_length) + if exceeded, warn on patches + requires --strict for use with --file + --min-conf-desc-length=n set the min description length, if shorter, warn + --tab-size=n set the number of spaces for tab (default $tabsize) + --root=PATH PATH to the kernel tree root --no-summary suppress the per-file summary --mailback only produce a report in case of warnings/errors --summary-file include the filename in summary @@ -61,6 +120,24 @@ Options: is all off) --test-only=WORD report only warnings/errors containing WORD literally + --fix EXPERIMENTAL - may create horrible results + If correctable single-line errors exist, create + "<inputfile>.EXPERIMENTAL-checkpatch-fixes" + with potential errors corrected to the preferred + checkpatch style + --fix-inplace EXPERIMENTAL - may create horrible results + Is the same as --fix, but overwrites the input + file. It's your fault if there's no backup or git + --ignore-perl-version override checking of perl version. expect + runtime errors. + --codespell Use the codespell dictionary for spelling/typos + (default:$codespellfile) + --codespellfile Use this codespell dictionary + --typedefsfile Read additional types from this file + --color[=WHEN] Use colors 'always', 'never', or only when output + is a terminal ('auto'). Default is 'auto'. + --kconfig-prefix=WORD use WORD as a prefix for Kconfig symbols (default + ${CONFIG_}) -h, --help, --version display this help and exit When FILE is - read standard input. @@ -69,6 +146,74 @@ EOM exit($exitcode); } +sub uniq { + my %seen; + return grep { !$seen{$_}++ } @_; +} + +sub list_types { + my ($exitcode) = @_; + + my $count = 0; + + local $/ = undef; + + open(my $script, '<', abs_path($P)) or + die "$P: Can't read '$P' $!\n"; + + my $text = <$script>; + close($script); + + my %types = (); + # Also catch when type or level is passed through a variable + while ($text =~ /(?:(\bCHK|\bWARN|\bERROR|&\{\$msg_level})\s*\(|\$msg_type\s*=)\s*"([^"]+)"/g) { + if (defined($1)) { + if (exists($types{$2})) { + $types{$2} .= ",$1" if ($types{$2} ne $1); + } else { + $types{$2} = $1; + } + } else { + $types{$2} = "UNDETERMINED"; + } + } + + print("#\tMessage type\n\n"); + if ($color) { + print(" ( Color coding: "); + print(RED . "ERROR" . RESET); + print(" | "); + print(YELLOW . "WARNING" . RESET); + print(" | "); + print(GREEN . "CHECK" . RESET); + print(" | "); + print("Multiple levels / Undetermined"); + print(" )\n\n"); + } + + foreach my $type (sort keys %types) { + my $orig_type = $type; + if ($color) { + my $level = $types{$type}; + if ($level eq "ERROR") { + $type = RED . $type . RESET; + } elsif ($level eq "WARN") { + $type = YELLOW . $type . RESET; + } elsif ($level eq "CHK") { + $type = GREEN . $type . RESET; + } + } + print(++$count . "\t" . $type . "\n"); + if ($verbose && exists($verbose_messages{$orig_type})) { + my $message = $verbose_messages{$orig_type}; + $message =~ s/\n/\n\t/g; + print("\t" . $message . "\n\n"); + } + } + + exit($exitcode); +} + my $conf = which_conf($configuration_file); if (-f $conf) { my @conf_args; @@ -95,51 +240,189 @@ if (-f $conf) { unshift(@ARGV, @conf_args) if @conf_args; } +sub load_docs { + open(my $docs, '<', "$docsfile") + or warn "$P: Can't read the documentation file $docsfile $!\n"; + + my $type = ''; + my $desc = ''; + my $in_desc = 0; + + while (<$docs>) { + chomp; + my $line = $_; + $line =~ s/\s+$//; + + if ($line =~ /^\s*\*\*(.+)\*\*$/) { + if ($desc ne '') { + $verbose_messages{$type} = trim($desc); + } + $type = $1; + $desc = ''; + $in_desc = 1; + } elsif ($in_desc) { + if ($line =~ /^(?:\s{4,}|$)/) { + $line =~ s/^\s{4}//; + $desc .= $line; + $desc .= "\n"; + } else { + $verbose_messages{$type} = trim($desc); + $type = ''; + $desc = ''; + $in_desc = 0; + } + } + } + + if ($desc ne '') { + $verbose_messages{$type} = trim($desc); + } + close($docs); +} + +# Perl's Getopt::Long allows options to take optional arguments after a space. +# Prevent --color by itself from consuming other arguments +foreach (@ARGV) { + if ($_ eq "--color" || $_ eq "-color") { + $_ = "--color=$color"; + } +} + GetOptions( 'q|quiet+' => \$quiet, + 'v|verbose!' => \$verbose, 'tree!' => \$tree, 'signoff!' => \$chk_signoff, 'patch!' => \$chk_patch, 'emacs!' => \$emacs, 'terse!' => \$terse, + 'showfile!' => \$showfile, 'f|file!' => \$file, + 'g|git!' => \$git, 'subjective!' => \$check, 'strict!' => \$check, 'ignore=s' => \@ignore, + 'types=s' => \@use, 'show-types!' => \$show_types, + 'list-types!' => \$list_types, + 'max-line-length=i' => \$max_line_length, + 'min-conf-desc-length=i' => \$min_conf_desc_length, + 'tab-size=i' => \$tabsize, 'root=s' => \$root, 'summary!' => \$summary, 'mailback!' => \$mailback, 'summary-file!' => \$summary_file, - + 'fix!' => \$fix, + 'fix-inplace!' => \$fix_inplace, + 'ignore-perl-version!' => \$ignore_perl_version, 'debug=s' => \%debug, 'test-only=s' => \$tst_only, + 'codespell!' => \$codespell, + 'codespellfile=s' => \$user_codespellfile, + 'typedefsfile=s' => \$typedefsfile, + 'color=s' => \$color, + 'no-color' => \$color, #keep old behaviors of -nocolor + 'nocolor' => \$color, #keep old behaviors of -nocolor + 'kconfig-prefix=s' => \${CONFIG_}, 'h|help' => \$help, 'version' => \$help -) or help(1); +) or $help = 2; + +if ($user_codespellfile) { + # Use the user provided codespell file unconditionally + $codespellfile = $user_codespellfile; +} elsif (!(-f $codespellfile)) { + # If /usr/share/codespell/dictionary.txt is not present, try to find it + # under codespell's install directory: <codespell_root>/data/dictionary.txt + if (($codespell || $help) && which("python3") ne "") { + my $python_codespell_dict = << "EOF"; + +import os.path as op +import codespell_lib +codespell_dir = op.dirname(codespell_lib.__file__) +codespell_file = op.join(codespell_dir, 'data', 'dictionary.txt') +print(codespell_file, end='') +EOF + + my $codespell_dict = `python3 -c "$python_codespell_dict" 2> /dev/null`; + $codespellfile = $codespell_dict if (-f $codespell_dict); + } +} + +# $help is 1 if either -h, --help or --version is passed as option - exitcode: 0 +# $help is 2 if invalid option is passed - exitcode: 1 +help($help - 1) if ($help); + +die "$P: --git cannot be used with --file or --fix\n" if ($git && ($file || $fix)); +die "$P: --verbose cannot be used with --terse\n" if ($verbose && $terse); + +if ($color =~ /^[01]$/) { + $color = !$color; +} elsif ($color =~ /^always$/i) { + $color = 1; +} elsif ($color =~ /^never$/i) { + $color = 0; +} elsif ($color =~ /^auto$/i) { + $color = (-t STDOUT); +} else { + die "$P: Invalid color mode: $color\n"; +} -help(0) if ($help); +load_docs() if ($verbose); +list_types(0) if ($list_types); + +$fix = 1 if ($fix_inplace); +$check_orig = $check; my $exit = 0; +my $perl_version_ok = 1; +if ($^V && $^V lt $minimum_perl_version) { + $perl_version_ok = 0; + printf "$P: requires at least perl version %vd\n", $minimum_perl_version; + exit(1) if (!$ignore_perl_version); +} + +#if no filenames are given, push '-' to read patch from stdin if ($#ARGV < 0) { - print "$P: no input files\n"; - exit(1); + push(@ARGV, '-'); } -@ignore = split(/,/, join(',',@ignore)); -foreach my $word (@ignore) { - $word =~ s/\s*\n?$//g; - $word =~ s/^\s*//g; - $word =~ s/\s+/ /g; - $word =~ tr/[a-z]/[A-Z]/; +# skip TAB size 1 to avoid additional checks on $tabsize - 1 +die "$P: Invalid TAB size: $tabsize\n" if ($tabsize < 2); + +sub hash_save_array_words { + my ($hashRef, $arrayRef) = @_; + + my @array = split(/,/, join(',', @$arrayRef)); + foreach my $word (@array) { + $word =~ s/\s*\n?$//g; + $word =~ s/^\s*//g; + $word =~ s/\s+/ /g; + $word =~ tr/[a-z]/[A-Z]/; + + next if ($word =~ m/^\s*#/); + next if ($word =~ m/^\s*$/); + + $hashRef->{$word}++; + } +} - next if ($word =~ m/^\s*#/); - next if ($word =~ m/^\s*$/); +sub hash_show_words { + my ($hashRef, $prefix) = @_; - $ignore_type{$word}++; + if (keys %$hashRef) { + print "\nNOTE: $prefix message types:"; + foreach my $word (sort keys %$hashRef) { + print " $word"; + } + print "\n"; + } } +hash_save_array_words(\%ignore_type, \@ignore); +hash_save_array_words(\%use_type, \@use); + my $dbg_values = 0; my $dbg_possible = 0; my $dbg_type = 0; @@ -165,14 +448,14 @@ if ($tree) { } else { if (top_of_kernel_tree('.')) { $root = '.'; - } elsif ($0 =~ m@(.*)/tools/scripts/[^/]*$@ && + } elsif ($0 =~ m@(.*)/scripts/[^/]*$@ && top_of_kernel_tree($1)) { $root = $1; } } if (!defined $root) { - print "Must be run from the top-level dir. of a openocd tree\n"; + print "Must be run from the top-level dir. of a kernel tree\n"; exit(2); } } @@ -190,20 +473,28 @@ our $Sparse = qr{ __force| __iomem| __must_check| - __init_refok| __kprobes| __ref| - __rcu + __refconst| + __refdata| + __rcu| + __private }x; +our $InitAttributePrefix = qr{__(?:mem|cpu|dev|net_|)}; +our $InitAttributeData = qr{$InitAttributePrefix(?:initdata\b)}; +our $InitAttributeConst = qr{$InitAttributePrefix(?:initconst\b)}; +our $InitAttributeInit = qr{$InitAttributePrefix(?:init\b)}; +our $InitAttribute = qr{$InitAttributeData|$InitAttributeConst|$InitAttributeInit}; # Notes to $Attribute: # We need \b after 'init' otherwise 'initconst' will cause a false positive in a check our $Attribute = qr{ const| + volatile| __percpu| __nocast| __safe| - __bitwise__| + __bitwise| __packed__| __packed2__| __naked| @@ -212,37 +503,57 @@ our $Attribute = qr{ __noreturn| __used| __cold| + __pure| __noclone| __deprecated| __read_mostly| + __ro_after_init| __kprobes| - __(?:mem|cpu|dev|)(?:initdata|initconst|init\b)| + $InitAttribute| ____cacheline_aligned| ____cacheline_aligned_in_smp| ____cacheline_internodealigned_in_smp| - __weak + __weak| + __alloc_size\s*\(\s*\d+\s*(?:,\s*\d+\s*)?\) }x; our $Modifier; -our $Inline = qr{inline|__always_inline|noinline}; +our $Inline = qr{inline|__always_inline|noinline|__inline|__inline__}; our $Member = qr{->$Ident|\.$Ident|\[[^]]*\]}; our $Lval = qr{$Ident(?:$Member)*}; -our $Constant = qr{(?:[0-9]+|0x[0-9a-fA-F]+)[UL]*}; -our $Assignment = qr{(?:\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=)}; -our $Compare = qr{<=|>=|==|!=|<|>}; +our $Int_type = qr{(?i)llu|ull|ll|lu|ul|l|u}; +our $Binary = qr{(?i)0b[01]+$Int_type?}; +our $Hex = qr{(?i)0x[0-9a-f]+$Int_type?}; +our $Int = qr{[0-9]+$Int_type?}; +our $Octal = qr{0[0-7]+$Int_type?}; +our $String = qr{(?:\b[Lu])?"[X\t]*"}; +our $Float_hex = qr{(?i)0x[0-9a-f]+p-?[0-9]+[fl]?}; +our $Float_dec = qr{(?i)(?:[0-9]+\.[0-9]*|[0-9]*\.[0-9]+)(?:e-?[0-9]+)?[fl]?}; +our $Float_int = qr{(?i)[0-9]+e-?[0-9]+[fl]?}; +our $Float = qr{$Float_hex|$Float_dec|$Float_int}; +our $Constant = qr{$Float|$Binary|$Octal|$Hex|$Int}; +our $Assignment = qr{\*\=|/=|%=|\+=|-=|<<=|>>=|&=|\^=|\|=|=}; +our $Compare = qr{<=|>=|==|!=|<|(?<!-)>}; +our $Arithmetic = qr{\+|-|\*|\/|%}; our $Operators = qr{ <=|>=|==|!=| =>|->|<<|>>|<|>|!|~| - &&|\|\||,|\^|\+\+|--|&|\||\+|-|\*|\/|% + &&|\|\||,|\^|\+\+|--|&|\||$Arithmetic }x; +our $c90_Keywords = qr{do|for|while|if|else|return|goto|continue|switch|default|case|break}x; + +our $BasicType; our $NonptrType; +our $NonptrTypeMisordered; +our $NonptrTypeWithAttr; our $Type; +our $TypeMisordered; our $Declare; +our $DeclareMisordered; -our $UTF8 = qr { - [\x09\x0A\x0D\x20-\x7E] # ASCII - | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte +our $NON_ASCII_UTF8 = qr{ + [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates @@ -251,40 +562,172 @@ our $UTF8 = qr { | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 }x; -our $typeTypedefs = qr{(?x: +our $UTF8 = qr{ + [\x09\x0A\x0D\x20-\x7E] # ASCII + | $NON_ASCII_UTF8 +}x; + +our $typeC99Typedefs = qr{(?:__)?(?:[us]_?)?int_?(?:8|16|32|64)_t}; +our $typeOtherOSTypedefs = qr{... [truncated message content] |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:12:36
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 61d0757acf222fdd5669b471cc251e03101db273 (commit) from 27e7f5df5ff691a78ca7530892ee5dc05820a947 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 61d0757acf222fdd5669b471cc251e03101db273 Author: Ian Thompson <ia...@ca...> Date: Thu Sep 15 14:14:15 2022 -0700 target/xtensa: invalidate register cache on reset Resolves issues where registers are accessed when poll() logic is inactive or has not yet been triggered. Signed-off-by: Ian Thompson <ia...@ca...> Change-Id: If7a4d00938fb188b008325249627f7773c3484c5 Reviewed-on: https://review.openocd.org/c/openocd/+/7197 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erh...@es...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c index 50658e9d5..d3be8b441 100644 --- a/src/target/xtensa/xtensa.c +++ b/src/target/xtensa/xtensa.c @@ -959,7 +959,6 @@ int xtensa_assert_reset(struct target *target) struct xtensa *xtensa = target_to_xtensa(target); LOG_TARGET_DEBUG(target, "target_number=%i, begin", target->target_number); - target->state = TARGET_RESET; xtensa_queue_pwr_reg_write(xtensa, XDMREG_PWRCTL, PWRCTL_JTAGDEBUGUSE(xtensa) | PWRCTL_DEBUGWAKEUP(xtensa) | PWRCTL_MEMWAKEUP(xtensa) | @@ -968,8 +967,12 @@ int xtensa_assert_reset(struct target *target) int res = xtensa_dm_queue_execute(&xtensa->dbg_mod); if (res != ERROR_OK) return res; + + /* registers are now invalid */ xtensa->reset_asserted = true; - return res; + register_cache_invalidate(xtensa->core_cache); + target->state = TARGET_RESET; + return ERROR_OK; } int xtensa_deassert_reset(struct target *target) ----------------------------------------------------------------------- Summary of changes: src/target/xtensa/xtensa.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-18 08:08:01
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 27e7f5df5ff691a78ca7530892ee5dc05820a947 (commit) from 9f024dbedcf6dae472b2434ab426d64c4f798e90 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 27e7f5df5ff691a78ca7530892ee5dc05820a947 Author: Ian Thompson <ia...@ca...> Date: Thu Sep 15 16:24:33 2022 -0700 target/xtensa: fix clang analyzer warning Reworked xtensa_queue_exec_ins_wide() logic to properly handle endian issues while executing arbitrary instructions. Signed-off-by: Ian Thompson <ia...@ca...> Change-Id: I5752dd254ce8b8822886ffc7edecaa242a93cce8 Reviewed-on: https://review.openocd.org/c/openocd/+/7198 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c index f331a8665..50658e9d5 100644 --- a/src/target/xtensa/xtensa.c +++ b/src/target/xtensa/xtensa.c @@ -498,17 +498,20 @@ static void xtensa_queue_exec_ins(struct xtensa *xtensa, uint32_t ins) static void xtensa_queue_exec_ins_wide(struct xtensa *xtensa, uint8_t *ops, uint8_t oplen) { - if ((oplen > 0) && (oplen <= 64)) { - uint32_t opsw[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; /* 8 DIRx regs: max width 64B */ - uint8_t oplenw = (oplen + 3) / 4; - if (xtensa->target->endianness == TARGET_BIG_ENDIAN) - buf_bswap32((uint8_t *)opsw, ops, oplenw * 4); - else - memcpy(opsw, ops, oplen); + const int max_oplen = 64; /* 8 DIRx regs: max width 64B */ + if ((oplen > 0) && (oplen <= max_oplen)) { + uint8_t ops_padded[max_oplen]; + memcpy(ops_padded, ops, oplen); + memset(ops_padded + oplen, 0, max_oplen - oplen); + unsigned int oplenw = DIV_ROUND_UP(oplen, sizeof(uint32_t)); for (int32_t i = oplenw - 1; i > 0; i--) - xtensa_queue_dbg_reg_write(xtensa, XDMREG_DIR0 + i, opsw[i]); + xtensa_queue_dbg_reg_write(xtensa, + XDMREG_DIR0 + i, + target_buffer_get_u32(xtensa->target, &ops_padded[sizeof(uint32_t)*i])); /* Write DIR0EXEC last */ - xtensa_queue_dbg_reg_write(xtensa, XDMREG_DIR0EXEC, opsw[0]); + xtensa_queue_dbg_reg_write(xtensa, + XDMREG_DIR0EXEC, + target_buffer_get_u32(xtensa->target, &ops_padded[0])); } } ----------------------------------------------------------------------- Summary of changes: src/target/xtensa/xtensa.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 21:19:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9f024dbedcf6dae472b2434ab426d64c4f798e90 (commit) from f9837d1807dae8042aac2e52af3f007ef3cca4d9 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9f024dbedcf6dae472b2434ab426d64c4f798e90 Author: Marc Schink <de...@za...> Date: Thu Sep 15 08:56:27 2022 +0200 flash/nor/stm32lx: Add revision 'X' for Cat.4/3 devices Change-Id: I18c62ddb3963c357c7ce5dfc067c8d63fbc82b99 Signed-off-by: Marc Schink <de...@za...> Reviewed-on: https://review.openocd.org/c/openocd/+/7196 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/flash/nor/stm32lx.c b/src/flash/nor/stm32lx.c index d7a83efa6..64073c31c 100644 --- a/src/flash/nor/stm32lx.c +++ b/src/flash/nor/stm32lx.c @@ -141,7 +141,7 @@ static const struct stm32lx_rev stm32_429_revs[] = { { 0x1000, "A" }, { 0x1018, "Z" }, }; static const struct stm32lx_rev stm32_436_revs[] = { - { 0x1000, "A" }, { 0x1008, "Z" }, { 0x1018, "Y" }, + { 0x1000, "A" }, { 0x1008, "Z" }, { 0x1018, "Y" }, { 0x1038, "X" }, }; static const struct stm32lx_rev stm32_437_revs[] = { { 0x1000, "A" }, ----------------------------------------------------------------------- Summary of changes: src/flash/nor/stm32lx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:59:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via f9837d1807dae8042aac2e52af3f007ef3cca4d9 (commit) from 68fe396b79a7732d1b0674bc60542bed3e0838b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f9837d1807dae8042aac2e52af3f007ef3cca4d9 Author: Tim Nordell <tno...@ai...> Date: Wed Sep 7 11:59:47 2022 -0500 rtos: Support looking up .lto_priv.0 appended to symbol name When FreeRTOS (at least) is compiled with -flto, this leaves certain static symbols with .lto_priv.0 appended to their name. Arguably this could be considered to be a gdb or gcc bug, but one place to resolve it for OpenOCD usage is here at symbol lookup time. Note that the ".0" is for the first such instance of the variable as a static; additional ones would end up as ".1", ".2", etc, and are not considered here. Signed-off-by: Tim Nordell <tno...@ai...> Change-Id: I03580b45e8ea364392ef4e05c96276416b390cb0 Reviewed-on: https://review.openocd.org/c/openocd/+/7179 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index ccf15c7c7..31fd057ed 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -215,6 +215,12 @@ static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, * specified explicitly, then no further symbol lookup is done. When * auto-detecting, the RTOS driver _detect() function must return success. * + * The symbol is tried twice to handle the -flto case with gcc. The first + * attempt uses the symbol as-is, and the second attempt tries the symbol + * with ".lto_priv.0" appended to it. We only consider the first static + * symbol here from the -flto case. (Each subsequent static symbol with + * the same name is exported as .lto_priv.1, .lto_priv.2, etc.) + * * rtos_qsymbol() returns 1 if an RTOS has been detected, or 0 otherwise. */ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_size) @@ -223,7 +229,7 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s uint64_t addr = 0; size_t reply_len; char reply[GDB_BUFFER_SIZE + 1], cur_sym[GDB_BUFFER_SIZE / 2 + 1] = ""; /* Extra byte for null-termination */ - struct symbol_table_elem *next_sym; + struct symbol_table_elem *next_sym = NULL; struct target *target = get_target_from_connection(connection); struct rtos *os = target->rtos; @@ -236,13 +242,34 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s size_t len = unhexify((uint8_t *)cur_sym, strchr(packet + 8, ':') + 1, strlen(strchr(packet + 8, ':') + 1)); cur_sym[len] = 0; + const char no_suffix[] = ""; + const char lto_suffix[] = ".lto_priv.0"; + const size_t lto_suffix_len = strlen(lto_suffix); + + const char *cur_suffix; + const char *next_suffix; + + /* Detect what suffix was used during the previous symbol lookup attempt, and + * speculatively determine the next suffix (only used for the unknown address case) */ + if (len > lto_suffix_len && !strcmp(cur_sym + len - lto_suffix_len, lto_suffix)) { + /* Trim the suffix from cur_sym for comparison purposes below */ + cur_sym[len - lto_suffix_len] = '\0'; + cur_suffix = lto_suffix; + next_suffix = NULL; + } else { + cur_suffix = no_suffix; + next_suffix = lto_suffix; + } + if ((strcmp(packet, "qSymbol::") != 0) && /* GDB is not offering symbol lookup for the first time */ (!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr))) { /* GDB did not find an address for a symbol */ /* GDB could not find an address for the previous symbol */ struct symbol_table_elem *sym = find_symbol(os, cur_sym); - if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */ + if (next_suffix) { + next_sym = sym; + } else if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */ if (!target->rtos_auto_detect) { LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym); goto done; @@ -259,13 +286,16 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s } } - LOG_DEBUG("RTOS: Address of symbol '%s' is 0x%" PRIx64, cur_sym, addr); + LOG_DEBUG("RTOS: Address of symbol '%s%s' is 0x%" PRIx64, cur_sym, cur_suffix, addr); - next_sym = next_symbol(os, cur_sym, addr); + if (!next_sym) { + next_sym = next_symbol(os, cur_sym, addr); + next_suffix = no_suffix; + } /* Should never happen unless the debugger misbehaves */ if (!next_sym) { - LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s' that we did not ask for", cur_sym); + LOG_WARNING("RTOS: Debugger sent us qSymbol with '%s%s' that we did not ask for", cur_sym, cur_suffix); goto done; } @@ -287,17 +317,26 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s } } - if (8 + (strlen(next_sym->symbol_name) * 2) + 1 > sizeof(reply)) { - LOG_ERROR("ERROR: RTOS symbol '%s' name is too long for GDB!", next_sym->symbol_name); + assert(next_suffix); + + reply_len = 8; /* snprintf(..., "qSymbol:") */ + reply_len += 2 * strlen(next_sym->symbol_name); /* hexify(..., next_sym->symbol_name, ...) */ + reply_len += 2 * strlen(next_suffix); /* hexify(..., next_suffix, ...) */ + reply_len += 1; /* Terminating NUL */ + if (reply_len > sizeof(reply)) { + LOG_ERROR("ERROR: RTOS symbol '%s%s' name is too long for GDB!", next_sym->symbol_name, next_suffix); goto done; } - LOG_DEBUG("RTOS: Requesting symbol lookup of '%s' from the debugger", next_sym->symbol_name); + LOG_DEBUG("RTOS: Requesting symbol lookup of '%s%s' from the debugger", next_sym->symbol_name, next_suffix); reply_len = snprintf(reply, sizeof(reply), "qSymbol:"); reply_len += hexify(reply + reply_len, (const uint8_t *)next_sym->symbol_name, strlen(next_sym->symbol_name), sizeof(reply) - reply_len); + reply_len += hexify(reply + reply_len, + (const uint8_t *)next_suffix, strlen(next_suffix), + sizeof(reply) - reply_len); done: gdb_put_packet(connection, reply, reply_len); ----------------------------------------------------------------------- Summary of changes: src/rtos/rtos.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 8 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:59:08
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 68fe396b79a7732d1b0674bc60542bed3e0838b7 (commit) from 9f5a74c228cbab3d80c47c87fa9735167da7eb77 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 68fe396b79a7732d1b0674bc60542bed3e0838b7 Author: Tim Nordell <tno...@ai...> Date: Wed Sep 7 11:52:09 2022 -0500 rtos: Fold is_symbol_mandatory into rtos_qsymbol(..) This is in preparation for a future commit that looks for an optional suffix of .lto_priv.0 on the symbol name. Signed-off-by: Tim Nordell <tno...@ai...> Change-Id: If803332373825b73bc986bd4ea7dfaee9c625c0a Reviewed-on: https://review.openocd.org/c/openocd/+/7178 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 3c3896de3..ccf15c7c7 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -198,14 +198,6 @@ static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, return s; } -/* searches for 'symbol' in the lookup table for 'os' and returns TRUE, - * if 'symbol' is not declared optional */ -static bool is_symbol_mandatory(const struct rtos *os, const char *symbol) -{ - struct symbol_table_elem *s = find_symbol(os, symbol); - return s && !s->optional; -} - /* rtos_qsymbol() processes and replies to all qSymbol packets from GDB. * * GDB sends a qSymbol:: packet (empty address, empty name) to notify @@ -245,22 +237,25 @@ int rtos_qsymbol(struct connection *connection, char const *packet, int packet_s cur_sym[len] = 0; if ((strcmp(packet, "qSymbol::") != 0) && /* GDB is not offering symbol lookup for the first time */ - (!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr)) && /* GDB did not find an address for a symbol */ - is_symbol_mandatory(os, cur_sym)) { /* the symbol is mandatory for this RTOS */ + (!sscanf(packet, "qSymbol:%" SCNx64 ":", &addr))) { /* GDB did not find an address for a symbol */ /* GDB could not find an address for the previous symbol */ - if (!target->rtos_auto_detect) { - LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym); - goto done; - } else { - /* Autodetecting RTOS - try next RTOS */ - if (!rtos_try_next(target)) { - LOG_WARNING("No RTOS could be auto-detected!"); + struct symbol_table_elem *sym = find_symbol(os, cur_sym); + + if (sym && !sym->optional) { /* the symbol is mandatory for this RTOS */ + if (!target->rtos_auto_detect) { + LOG_WARNING("RTOS %s not detected. (GDB could not find symbol \'%s\')", os->type->name, cur_sym); goto done; - } + } else { + /* Autodetecting RTOS - try next RTOS */ + if (!rtos_try_next(target)) { + LOG_WARNING("No RTOS could be auto-detected!"); + goto done; + } - /* Next RTOS selected - invalidate current symbol */ - cur_sym[0] = '\x00'; + /* Next RTOS selected - invalidate current symbol */ + cur_sym[0] = '\x00'; + } } } ----------------------------------------------------------------------- Summary of changes: src/rtos/rtos.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:58:51
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9f5a74c228cbab3d80c47c87fa9735167da7eb77 (commit) from 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9f5a74c228cbab3d80c47c87fa9735167da7eb77 Author: Tim Nordell <tno...@ai...> Date: Wed Sep 7 11:35:33 2022 -0500 rtos: Create a new helper function find_symbol(...) This will be utilized for an upcoming refactorization to support -flto compiled programs. Signed-off-by: Tim Nordell <tno...@ai...> Change-Id: Id523c0b3ac2dad8b248ea0d2cac7b4dd2f83d293 Reviewed-on: https://review.openocd.org/c/openocd/+/7177 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/rtos.c b/src/rtos/rtos.c index 3e43e828d..3c3896de3 100644 --- a/src/rtos/rtos.c +++ b/src/rtos/rtos.c @@ -170,35 +170,40 @@ int gdb_thread_packet(struct connection *connection, char const *packet, int pac return target->rtos->gdb_thread_packet(connection, packet, packet_size); } -static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr) +static struct symbol_table_elem *find_symbol(const struct rtos *os, const char *symbol) { struct symbol_table_elem *s; + for (s = os->symbols; s->symbol_name; s++) + if (!strcmp(s->symbol_name, symbol)) + return s; + + return NULL; +} + +static struct symbol_table_elem *next_symbol(struct rtos *os, char *cur_symbol, uint64_t cur_addr) +{ if (!os->symbols) os->type->get_symbol_list_to_lookup(&os->symbols); if (!cur_symbol[0]) return &os->symbols[0]; - for (s = os->symbols; s->symbol_name; s++) - if (!strcmp(s->symbol_name, cur_symbol)) { - s->address = cur_addr; - s++; - return s; - } + struct symbol_table_elem *s = find_symbol(os, cur_symbol); + if (!s) + return NULL; - return NULL; + s->address = cur_addr; + s++; + return s; } /* searches for 'symbol' in the lookup table for 'os' and returns TRUE, * if 'symbol' is not declared optional */ static bool is_symbol_mandatory(const struct rtos *os, const char *symbol) { - for (struct symbol_table_elem *s = os->symbols; s->symbol_name; ++s) { - if (!strcmp(s->symbol_name, symbol)) - return !s->optional; - } - return false; + struct symbol_table_elem *s = find_symbol(os, symbol); + return s && !s->optional; } /* rtos_qsymbol() processes and replies to all qSymbol packets from GDB. ----------------------------------------------------------------------- Summary of changes: src/rtos/rtos.c | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:58:00
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736 (commit) from 9464c801b9837b111e06d70beb7cad053752120b (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4279b23fcacaf3bb6f7c5e8da9386eaeeafe5736 Author: Ian Thompson <ia...@ca...> Date: Wed Sep 14 09:59:47 2022 -0700 target/xtensa: populate PS correctly during fetch Read PS from EPS[debuglevel] during fetch such that it reflects the correct value when read via telnet (not just via gdb_server). Signed-off-by: Ian Thompson <ia...@ca...> Change-Id: I8504f68989bc6d5fe451a8cb69d01c86f4ec0100 Reviewed-on: https://review.openocd.org/c/openocd/+/7195 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erh...@es...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/xtensa/xtensa.c b/src/target/xtensa/xtensa.c index a6e50ccc7..f331a8665 100644 --- a/src/target/xtensa/xtensa.c +++ b/src/target/xtensa/xtensa.c @@ -1100,6 +1100,9 @@ int xtensa_fetch_all_regs(struct target *target) if (reg_num == XT_PC_REG_NUM_VIRTUAL) { /* reg number of PC for debug interrupt depends on NDEBUGLEVEL */ reg_num = (XT_PC_REG_NUM_BASE + xtensa->core_config->debug.irq_level); + } else if (reg_num == xtensa_regs[XT_REG_IDX_PS].reg_num) { + /* reg number of PS for debug interrupt depends on NDEBUGLEVEL */ + reg_num = (XT_PS_REG_NUM_BASE + xtensa->core_config->debug.irq_level); } else if (reg_num == xtensa_regs[XT_REG_IDX_CPENABLE].reg_num) { /* CPENABLE already read/updated; don't re-read */ reg_fetched = false; ----------------------------------------------------------------------- Summary of changes: src/target/xtensa/xtensa.c | 3 +++ 1 file changed, 3 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-17 20:57:24
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 9464c801b9837b111e06d70beb7cad053752120b (commit) from 219cb9598a6221ed24967f205a144a223add039a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 9464c801b9837b111e06d70beb7cad053752120b Author: Toms Stūrmanis <tom...@gm...> Date: Wed Sep 14 15:13:59 2022 +0300 flash/nor/rsl10: Check return value Change-Id: Id1ad72e74d6a1bddc4dfe46dcf715ef74e19a27f Signed-off-by: Toms Stūrmanis <tom...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7194 Tested-by: jenkins Reviewed-by: Antonio Borneo <bor...@gm...> Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/flash/nor/rsl10.c b/src/flash/nor/rsl10.c index 164701fe0..ef501f4ee 100644 --- a/src/flash/nor/rsl10.c +++ b/src/flash/nor/rsl10.c @@ -747,6 +747,8 @@ COMMAND_HANDLER(rsl10_unlock_command) uint32_t key; retval = mem_ap_read_atomic_u32(ap, RSL10_FLASH_ADDRESS_LOCK_INFO_SETTING, &key); + if (retval != ERROR_OK) + return retval; LOG_INFO("mem read: 0x%08" PRIx32, key); if (key == RSL10_KEY_DEBUG_LOCK) { ----------------------------------------------------------------------- Summary of changes: src/flash/nor/rsl10.c | 2 ++ 1 file changed, 2 insertions(+) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:20:29
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 219cb9598a6221ed24967f205a144a223add039a (commit) from cec3b6232811dc504ad461ad99384e39b40aad52 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 219cb9598a6221ed24967f205a144a223add039a Author: Frank Dischner <fra...@gm...> Date: Wed Apr 20 21:49:44 2022 -0500 FreeRTOS: Fix thread reg list for Cortex-M7 This updates the FreeRTOS module to use the M4F FPU stacking also for the FPV5_SP and FPV5_DP FPUs, which are found on the Cortex-M7. The FPUs are in fact different than the FPV4_SP found on the M4, but the register stacking is the same. Signed-off-by: Frank Dischner <fra...@gm...> Change-Id: I74c45d2cfb55f55e6c557f2450068ad3c2fe9497 Reviewed-on: https://review.openocd.org/c/openocd/+/6939 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c index afea9db90..583e2f752 100644 --- a/src/rtos/FreeRTOS.c +++ b/src/rtos/FreeRTOS.c @@ -437,7 +437,8 @@ static int freertos_get_thread_reg_list(struct rtos *rtos, int64_t thread_id, int cm4_fpu_enabled = 0; struct armv7m_common *armv7m_target = target_to_armv7m(rtos->target); if (is_armv7m(armv7m_target)) { - if (armv7m_target->fp_feature == FPV4_SP) { + if ((armv7m_target->fp_feature == FPV4_SP) || (armv7m_target->fp_feature == FPV5_SP) || + (armv7m_target->fp_feature == FPV5_DP)) { /* Found ARM v7m target which includes a FPU */ uint32_t cpacr; ----------------------------------------------------------------------- Summary of changes: src/rtos/FreeRTOS.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:19:40
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via cec3b6232811dc504ad461ad99384e39b40aad52 (commit) from 58bd387219f4586f09f90fd6ebe441f3e2d29598 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit cec3b6232811dc504ad461ad99384e39b40aad52 Author: Antonio Borneo <bor...@gm...> Date: Sat Sep 10 14:34:51 2022 +0200 mips64: remove empty mips_mips64_soft_reset_halt() The method soft_reset_halt is optional; no need to add an empty function. Remove mips_mips64_soft_reset_halt() and move the TODO comment in struct target_type. Change-Id: Id541a75e7a08645568961d59b73a120c2238701f Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/7184 Tested-by: jenkins Reviewed-by: Tomas Vanek <va...@fb...> diff --git a/src/target/mips_mips64.c b/src/target/mips_mips64.c index 449f5a217..d05b55c46 100644 --- a/src/target/mips_mips64.c +++ b/src/target/mips_mips64.c @@ -205,12 +205,6 @@ static int mips_mips64_deassert_reset(struct target *target) return ERROR_OK; } -static int mips_mips64_soft_reset_halt(struct target *target) -{ - /* TODO */ - return ERROR_OK; -} - static int mips_mips64_single_step_core(struct target *target) { struct mips64_common *mips64 = target->arch_info; @@ -1168,7 +1162,7 @@ struct target_type mips_mips64_target = { .assert_reset = mips_mips64_assert_reset, .deassert_reset = mips_mips64_deassert_reset, - .soft_reset_halt = mips_mips64_soft_reset_halt, + /* TODO: add .soft_reset_halt */ .get_gdb_reg_list = mips64_get_gdb_reg_list, ----------------------------------------------------------------------- Summary of changes: src/target/mips_mips64.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:19:22
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 58bd387219f4586f09f90fd6ebe441f3e2d29598 (commit) from 16cbddf1ce8b38bb5c2f02e438441572d285d946 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 58bd387219f4586f09f90fd6ebe441f3e2d29598 Author: Ian Thompson <ia...@ca...> Date: Fri Sep 9 12:10:20 2022 -0700 target/xtensa: fully initialize buffers for PWRSTAT read Read buffer is sized for 32-bit APB version of PWRSTAT/PWRCTL registers. Initialize to zero so 8-bit JTAG register mirrors are accurate. Signed-off-by: Ian Thompson <ia...@ca...> Change-Id: I81310649fa7180893d0188aab3c8a14315aaea0a Reviewed-on: https://review.openocd.org/c/openocd/+/7183 Tested-by: jenkins Reviewed-by: Erhan Kurubas <erh...@es...> Reviewed-by: Antonio Borneo <bor...@gm...> diff --git a/src/target/xtensa/xtensa_debug_module.c b/src/target/xtensa/xtensa_debug_module.c index 8753b863c..4f33c08aa 100644 --- a/src/target/xtensa/xtensa_debug_module.c +++ b/src/target/xtensa/xtensa_debug_module.c @@ -246,8 +246,8 @@ int xtensa_dm_device_id_read(struct xtensa_debug_module *dm) int xtensa_dm_power_status_read(struct xtensa_debug_module *dm, uint32_t clear) { - uint8_t stat_buf[sizeof(uint32_t)]; - uint8_t stath_buf[sizeof(uint32_t)]; + uint8_t stat_buf[sizeof(uint32_t)] = { 0, 0, 0, 0 }; + uint8_t stath_buf[sizeof(uint32_t)] = { 0, 0, 0, 0 }; /* TODO: JTAG does not work when PWRCTL_JTAGDEBUGUSE is not set. * It is set in xtensa_examine(), need to move reading of XDMREG_OCDID out of this function */ ----------------------------------------------------------------------- Summary of changes: src/target/xtensa/xtensa_debug_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Main OpenOCD repository |
From: OpenOCD-Gerrit <ope...@us...> - 2022-09-13 22:18:41
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Main OpenOCD repository". The branch, master has been updated via 16cbddf1ce8b38bb5c2f02e438441572d285d946 (commit) from fed16496ab31041a7e113db3f3d6b0cf5c23866d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 16cbddf1ce8b38bb5c2f02e438441572d285d946 Author: Paul Fertser <fer...@gm...> Date: Sun Jun 24 20:48:35 2018 +0300 tcl: board: mini2440: fix to work with the current version Change-Id: I5cf3ab09dbf100d40ce40a4599cd8d2af18a5567 Signed-off-by: Paul Fertser <fer...@gm...> Signed-off-by: Antonio Borneo <bor...@gm...> Reviewed-on: https://review.openocd.org/c/openocd/+/4574 Tested-by: jenkins diff --git a/tcl/board/mini2440.cfg b/tcl/board/mini2440.cfg index 790b4c7c8..85d9a35b9 100644 --- a/tcl/board/mini2440.cfg +++ b/tcl/board/mini2440.cfg @@ -123,7 +123,6 @@ reset_config trst_and_srst #------------------------------------------------------------------------- adapter speed 12000 - jtag interface #------------------------------------------------------------------------- # GDB Setup ----------------------------------------------------------------------- Summary of changes: tcl/board/mini2440.cfg | 1 - 1 file changed, 1 deletion(-) hooks/post-receive -- Main OpenOCD repository |