Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion kernel/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,26 @@
size -= 4;
}

for (size_t i = 0; i < size; i++) {
/* align to word boundary */
const unsigned long *checked_stack_word =
(const unsigned long *)ROUND_UP(checked_stack, sizeof(unsigned long));
size -= ((const uint8_t *)checked_stack_word - checked_stack);

/* compare using native machine word size */
size_t i;

for (i = 0; i < size / sizeof(unsigned long); i++) {

Check warning on line 864 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:864 please, no spaces at the start of a line
if (checked_stack_word[i] != (unsigned long)0xaaaaaaaaaaaaaaaa) {

Check failure on line 865 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

kernel/thread.c:865 code indent should use tabs where possible

Check warning on line 865 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:865 please, no spaces at the start of a line

Check warning on line 865 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

SUSPECT_CODE_INDENT

kernel/thread.c:865 suspect code indent for conditional statements (8, 12)

Check warning on line 865 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

TYPECAST_INT_CONSTANT

kernel/thread.c:865 Unnecessary typecast of c90 int constant
break;

Check failure on line 866 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

kernel/thread.c:866 code indent should use tabs where possible

Check warning on line 866 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:866 please, no spaces at the start of a line
}

Check failure on line 867 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

CODE_INDENT

kernel/thread.c:867 code indent should use tabs where possible

Check warning on line 867 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:867 please, no spaces at the start of a line
}

Check warning on line 868 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:868 please, no spaces at the start of a line
unused = i * sizeof(unsigned long);

Check warning on line 869 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

LEADING_SPACE

kernel/thread.c:869 please, no spaces at the start of a line

Check notice on line 870 in kernel/thread.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

kernel/thread.c:870 - for (i = 0; i < size / sizeof(unsigned long); i++) { - if (checked_stack_word[i] != (unsigned long)0xaaaaaaaaaaaaaaaa) { - break; - } - } - unused = i * sizeof(unsigned long); + for (i = 0; i < size / sizeof(unsigned long); i++) { + if (checked_stack_word[i] != (unsigned long)0xaaaaaaaaaaaaaaaa) { + break; + } + } + unused = i * sizeof(unsigned long);
/* Continue checking from last used word to find remaining unused bytes*/
size -= unused;
checked_stack = (const uint8_t *)checked_stack_word + unused;

for (i = 0; i < size; i++) {
if ((checked_stack[i]) == 0xaaU) {
unused++;
} else {
Expand Down
Loading