Skip to content

Conversation

Jordymalone
Copy link
Contributor

There are two commits:

  1. Incorrect use of ARRAY_SIZE(leds) when freeing buttons in several example files. Replaced with ARRAY_SIZE(buttons).
  2. Improved LaTeX formatting by replacing softirqs (software interrupts) with \textbf{softirqs} (\textit{software interrupts}).

This helps ensure the examples are correct and the documentation is easier to read.

lkmpg.tex Outdated
@@ -1778,7 +1778,7 @@ \subsection{Spinlocks}
In contrast, \cpp|spin_lock_irqsave()| disables interrupts and also saves the interrupt state, ensuring that interrupts are restored to their previous state when the lock is released.
This makes \cpp|spin_lock_irqsave()| a safer option in scenarios where preserving the interrupt state is crucial.

Next, \cpp|spin_lock_bh()| disables softirqs (software interrupts) but allows hardware interrupts to continue.
Next, \cpp|spin_lock_bh()| disables \textbf{softirqs} (\textit{software interrupts}) but allows hardware interrupts to continue.
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove \textit annotating.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed \textit as suggested.

Jordymalone and others added 2 commits August 28, 2025 10:10
Replaced plain text 'softirqs (software interrupts)' with
\textbf{softirqs} (software interrupts) for better emphasis.

Co-authored-by: EricccTaiwan <yphbchou0911@gmail.com>
Signed-off-by: Jordan Chiu <jordan871130@gmail.com>
The gpio_free_array function was incorrectly passed ARRAY_SIZE(leds)
when freeing the 'buttons' array in multiple examples:
- examples/intrp.c
- examples/bottomhalf.c
- examples/bh_halfthreaded.c

This mismatch could lead to invalid memory access if the size of
'buttons' differs from 'leds'.

Updated all occurrences to use ARRAY_SIZE(buttons) for correctness.

Co-authored-by: EricccTaiwan <yphbchou0911@gmail.com>
Signed-off-by: Jordan Chiu <jordan871130@gmail.com>
@Jordymalone Jordymalone requested a review from jserv August 28, 2025 02:52
@jserv jserv merged commit a8b652b into sysprog21:master Aug 28, 2025
1 check passed
@jserv
Copy link
Contributor

jserv commented Aug 28, 2025

Thank @Jordymalone for contributing!

@Jordymalone Jordymalone deleted the fix branch August 28, 2025 08:10
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.

2 participants