Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix riscv013_invalidate_cached_progbuf() #1140

Merged
merged 1 commit into from
Oct 4, 2024

Conversation

TommyMurphyTM1234
Copy link
Collaborator

Fix for this issue:

Using memset() instead of manual loop to zeroize the whole array since memset() is used elsewhere for similar purposes and is more reliable (no miscounting elements).

@TommyMurphyTM1234
Copy link
Collaborator Author

TommyMurphyTM1234 commented Oct 2, 2024

Failed on checkpatch? Sigh - that thing seems like such a waste of time... :-|

This is simply incorrect:

ERROR:COMMIT_MESSAGE: Missing commit description - Add an appropriate one

The commit DOES have a commit description.

git commit -m "Fix riscv013_invalidate_cached_progbuf() - see https://github.com/riscv-collab/riscv-openocd/issues/1139"

@JanMatCodasip
Copy link
Collaborator

The checkpatch script seems to expect commit messages in this format:

Commit title - single line
<blank line>
Commit description - one or more lines

In your case, the "description" part appears missing.

I understand that the checkpatch script may be annoying at times, but in this case:

  • the fix is trivial,
  • forcing committers to take the time to describe their changes has an added value.

Thank you for the patch.

@TommyMurphyTM1234
Copy link
Collaborator Author

The checkpatch script seems to expect commit messages in this format:

Commit title - single line
<blank line>
Commit description - one or more lines

In your case, the "description" part appears missing.

I understand that the checkpatch script may be annoying at times, but in this case:

  • the fix is trivial,
  • forcing committers to take the time to describe their changes has an added value.

Thank you for the patch.

Ok, thanks @JanMatCodasip. I'd forgotten about that requirement and am used to repos that aren't so picky about the commit message and allow a single line. It would be more helpful if checkpatch actually gave a more accurate and prescriptive error message in this case. I'll update the commit/PR this morning to fix the commit message.

@TommyMurphyTM1234
Copy link
Collaborator Author

The checkpatch script seems to expect commit messages in this format:

Commit title - single line
<blank line>
Commit description - one or more lines

In your case, the "description" part appears missing.
I understand that the checkpatch script may be annoying at times, but in this case:

  • the fix is trivial,
  • forcing committers to take the time to describe their changes has an added value.

Thank you for the patch.

Ok, thanks @JanMatCodasip. I'd forgotten about that requirement and am used to repos that aren't so picky about the commit message and allow a single line. It would be more helpful if checkpatch actually gave a more accurate and prescriptive error message in this case. I'll update the commit/PR this morning to fix the commit message.

OMG - checkpatch is such a waste of time!

ERROR:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#7: 
riscv013_invalidate_cached_progbuf() was failing to zeroize the final buffer array element.

See #1139
riscv013_invalidate_cached_progbuf() was failing to zeroize the final
buffer array element. Use memset() instead of a manual loop to zeroize
it in order to address this and simplify the code.
@TommyMurphyTM1234
Copy link
Collaborator Author

TommyMurphyTM1234 commented Oct 3, 2024

Third time lucky?

Edit: looks like it - phew!

Copy link
Collaborator

@en-sc en-sc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@JanMatCodasip JanMatCodasip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@TommyMurphyTM1234 Thanks for your patience with checkpatch :-)

@TommyMurphyTM1234
Copy link
Collaborator Author

LGTM.

Thanks a lot @JanMatCodasip.

@TommyMurphyTM1234 Thanks for your patience with checkpatch :-)

Apologies for venting - hopefully I'll remember its vagaries next time! 😄

@en-sc en-sc merged commit 0a2c146 into riscv-collab:riscv Oct 4, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

riscv013 Invalidate cache function does not invalidate complete progbuf-cache (off by one error?)
3 participants