~lkcamp/patches

x86/cpu: Include missing header v1 PROPOSED

Luciano Leão: 1
 x86/cpu: Include missing header

 1 files changed, 1 insertions(+), 0 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~lkcamp/patches/patches/35265/mbox | git am -3
Learn more about email & git

[PATCH] x86/cpu: Include missing header Export this patch

Includes the header containing the prototype of a global function,
solving the following warning:

 arch/x86/kernel/cpu/feat_ctl.c:112:6: warning: no previous prototype for
 'init_ia32_feat_ctl'
 [-Wmissing-prototypes]

Signed-off-by: Luciano Leão <lucianorsleao@gmail.com>
---
 arch/x86/kernel/cpu/feat_ctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kernel/cpu/feat_ctl.c b/arch/x86/kernel/cpu/feat_ctl.c
index 993697e71854..e4d4923b1f62 100644
--- a/arch/x86/kernel/cpu/feat_ctl.c
+++ b/arch/x86/kernel/cpu/feat_ctl.c
@@ -5,6 +5,7 @@
#include <asm/msr-index.h>
#include <asm/processor.h>
#include <asm/vmx.h>
#include <asm/cpu.h>
#include "cpu.h"

#undef pr_fmt
-- 
2.30.2




Hi, Luciano,

First of all, a bug like this usually has an interesting history. Why?
We can clearly see that there’s already some „cpu.h“ referenced here. What we
can do, then, is `git blame` the current file, then we see the commit
0e79ad863df43 which already attempts to solve the same warning you noticed. If
we go to `<asm/cpu.h>` and look at the lines related to the
`init_ia32_feat_ctl` function we will notice that 5d5103595e9e5 moved them from
the first to the second file, leaving us with the same warning again (please
look at the date for each commit). Thus, there are two changes I’ll propose:

1. Tell this story :) It’s always interesting to provide some context. Then you
can say you’re actually fixing an old of date header or something like this. 2.
Remove the “cpu.h“ include. Of course, test that, but it is probably not really
needed.