Fix some build warnings when W=1
cover Fix some build warnings when W=1
These patches fix some build warnings when W=1, the most of warnings are missing prototype as follows:
arch/riscv/mm/init.c:520:13: warning: no previous prototype for 'resource_init' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:130:5: warning: no previous prototype for 'set_memory_ro' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:136:5: warning: no previous prototype for 'set_memory_rw' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:142:5: warning: no previous prototype for 'set_memory_x' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:147:5: warning: no previous prototype for 'set_memory_nx' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:152:5: warning: no previous prototype for 'set_direct_map_invalid_noflush' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:169:5: warning: no previous prototype for 'set_direct_map_default_noflush' [-Wmissing-prototypes] arch/riscv/mm/pageattr.c:97:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
Zong Li (2):
riscv: Fix build warning for mm/init
riscv: fix build warning of mm/pageattr
arch/riscv/mm/init.c | 2 +- arch/riscv/mm/pageattr.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.27.0
PATCH 1/2 riscv: Fix build warning for mm/init
Add static keyword for resource_init, this function is only used in this object file.
--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/mm/init.c +1 -1
@@ -517,7 +517,7 @@ void mark_rodata_ro(void) }#endif -void __init resource_init (void ) +static void __init resource_init (void ) {struct memblock_region *region;
Signature · 1 line
2.27.0
PATCH 2/2 riscv: fix build warning of mm/pageattr
In reply to Zong LiAdd hearder for missing prototype. Also, static keyword should be at beginning of declaration.
--- arch/riscv/mm/pageattr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/riscv/mm/pageattr.c +2 -1
@@ -7,6 +7,7 @@#include <linux/pgtable.h> #include <asm/tlbflush.h> #include <asm/bitops.h> +#include <asm/set_memory.h> struct pageattr_masks {pgprot_t set_mask;
@@ -94,7 +95,7 @@ static int pageattr_pte_hole(unsigned long addr, unsigned long next,return 0 ; } -const static struct mm_walk_ops pageattr_ops = { +static const struct mm_walk_ops pageattr_ops = { .pgd_entry = pageattr_pgd_entry, .p4d_entry = pageattr_p4d_entry, .pud_entry = pageattr_pud_entry,
Signature · 1 line
2.27.0
Re: [PATCH 2/2] riscv: fix build warning of mm/pageattr
Quoted 5 lines · Zong Li
Add hearder for missing prototype. Also, static keyword should be at beginning of declaration.
Signed-off-by Zong Li <[email protected]>
Which prototype is missing?
- Pekka
Pekka Enberg
Reviewed-byRe: [PATCH 2/2] riscv: fix build warning of mm/pageattr
Quoted 9 lines · Pekka Enberg
Quoted 5 lines · Zong Li
Add hearder for missing prototype. Also, static keyword should be at beginning of declaration.
Signed-off-by Zong Li <[email protected]>Which prototype is missing?
Aah, never mind, you mention them in the cover letter. I think patch description would be a better place to ensure they end up in git logs.
For both patches:
- Pekka
Re: [PATCH 2/2] riscv: fix build warning of mm/pageattr
In reply to Zong LiQuoted 1 line · Zong Li
Add hearder for missing prototype. Also, static keyword should be at
s/hearder/header/
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Re: [PATCH 2/2] riscv: fix build warning of mm/pageattr
Quoted 5 lines · Andreas Schwab
Quoted 1 line · Zong Li
Add hearder for missing prototype. Also, static keyword should be at
Quoted 8 lines
s/hearder/header/
Andreas.
--
Andreas Schwab, [email protected]
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."
Hi all,
Let me describe the details in the commit message and fix the typo in the next version.
Thanks for reviewing.
Palmer Dabbelt
maintainerQuoted 12 lines · On Wed, 15 Jul 2020 23:15:25 PDT (-0700), [email protected] wrote:
These patches fix some build warnings when W=1, the most of warnings are missing prototype as follows:
arch/riscv/mm/init.c:520:13: warning: no previous prototype for 'resource_init' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:130:5: warning: no previous prototype for 'set_memory_ro' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:136:5: warning: no previous prototype for 'set_memory_rw' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:142:5: warning: no previous prototype for 'set_memory_x' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:147:5: warning: no previous prototype for 'set_memory_nx' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:152:5: warning: no previous prototype for 'set_direct_map_invalid_noflush' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:169:5: warning: no previous prototype for 'set_direct_map_default_noflush' [-Wmissing-prototypes]arch/riscv/mm/pageattr.c:97:1: warning: 'static' is not at beginning of declaration [-Wold-style-declaration]
Quoted 7 lines
Zong Li (2):
riscv: Fix build warning for mm/init
riscv: fix build warning of mm/pageattrarch/riscv/mm/init.c | 2 +- arch/riscv/mm/pageattr.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
Thanks, these are on for-next.