dmesg only flushes when it encounter a newline. Without a newline, the line
is held in memory pending another printk. In this particular example
(example_atomic.c), the last pr_info in atomic_bitwise() prints when
another printk happens (either by another module, or __exit for this
module.
This can be confusing to new learner. This patch adds a newline to the last
pr_info forcing dmesg to print to the screen when the module is loaded.
The rule of thumb is to include the headers we are the direct user of.
In particular, if we need an atomic API, we include <linux/atomic.h>.
On the other hand we should not use headers for no reason. In particular,
if we are not doing any IRQ job, why is the <linux/irq.h> included?
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cppcheck[1] is integrated into CI pipeline for running static analysis.
However, Cppcheck is known to report false-positive, and we have to
suppress some warnings in advance.
[1] https://cppcheck.sourceforge.io/