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]
This warning appeared after 5d5103595e9e5 had moved function
init_ia32_feat_ctl()'s prototype from arch/x86/kernel/cpu/cpu.h to
arch/x86/include/asm/cpu.h.
Note that header "cpu.h" (arch/x86/kernel/cpu/cpu.h) was added by
0e79ad863df43 (before 5d5103595e9e5) solely to fix init_ia32_feat_ctl()'s
missing prototype. So, header "cpu.h" is no longer necessary.
Signed-off-by: Luciano Leão <lucianorsleao@gmail.com>
---
arch/x86/kernel/cpu/feat_ctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kernel/cpu/feat_ctl.c b/arch/x86/kernel/cpu/feat_ctl.c
index 993697e71854..809f873b5b2f 100644
--- a/arch/x86/kernel/cpu/feat_ctl.c+++ b/arch/x86/kernel/cpu/feat_ctl.c
@@ -5,7 +5,7 @@
#include <asm/msr-index.h>
#include <asm/processor.h>
#include <asm/vmx.h>
-#include "cpu.h"+#include <asm/cpu.h>#undef pr_fmt
#define pr_fmt(fmt) "x86/cpu: " fmt
--
2.30.2
Hi Luciano,
Thanks for your patch ;)
On 9/15/22 00:58, Luciano Leão wrote:
> Includes the header containing the prototype of a global function,
Includes -> Include. Always use imperative language.
> solving the following warning:> > arch/x86/kernel/cpu/feat_ctl.c:112:6: warning: no previous prototype for> 'init_ia32_feat_ctl'> [-Wmissing-prototypes]> > This warning appeared after 5d5103595e9e5 had moved function> init_ia32_feat_ctl()'s prototype from arch/x86/kernel/cpu/cpu.h to> arch/x86/include/asm/cpu.h.
If you are fixing something, you can add a "Fixes:" tag.
Recommend reading:
https://www.kernel.org/doc/html/latest/process/submitting-patches.html> > Note that header "cpu.h" (arch/x86/kernel/cpu/cpu.h) was added by> 0e79ad863df43 (before 5d5103595e9e5) solely to fix init_ia32_feat_ctl()'s> missing prototype. So, header "cpu.h" is no longer necessary.> > Signed-off-by: Luciano Leão <lucianorsleao@gmail.com>> ---> arch/x86/kernel/cpu/feat_ctl.c | 2 +-> 1 file changed, 1 insertion(+), 1 deletion(-)> > diff --git a/arch/x86/kernel/cpu/feat_ctl.c b/arch/x86/kernel/cpu/feat_ctl.c> index 993697e71854..809f873b5b2f 100644> --- a/arch/x86/kernel/cpu/feat_ctl.c> +++ b/arch/x86/kernel/cpu/feat_ctl.c> @@ -5,7 +5,7 @@> #include <asm/msr-index.h>> #include <asm/processor.h>> #include <asm/vmx.h>> -#include "cpu.h"> +#include <asm/cpu.h>>
Usually header includes are sorted by their file name.
> #undef pr_fmt> #define pr_fmt(fmt) "x86/cpu: " fmt
Hi Luciano,
thanks for the patch. See my comment below.
On Thu, Sep 15, 2022 at 12:58:10AM -0300, Luciano Leão wrote:
> 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]> > This warning appeared after 5d5103595e9e5 had moved function
When referring to commits in the commit message, you should use the standard
format with both the hash and commit title, as shown in [1]. Also make sure to
run ./scripts/checkpatch.pl against your patch to check for issues before
sending. Checkpatch would have pointed this issue out to you.
Thanks,
Nícolas
[1] https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes