Thread (14 messages) flat view 14 messages, 3 authors, 2018-11-27

Re: [PATCH 3/9] powerpc/mm: Remove extern from function definition

From: LEROY Christophe <hidden>
Date: 2018-10-24 15:14:24

Breno Leitao [off-list ref] a écrit :
hi Christophe,

On 10/23/2018 12:38 PM, LEROY Christophe wrote:
quoted
Breno Leitao [off-list ref] a écrit :
quoted
This patch removes the keyword from the definition part, while keeps
it in
the declaration part.
I think checkpatch also says that extern should be avoided in declarations.
Thanks for the review. I tried to look at this complain, but I didn't see
this behavior on checkpatch.pl from kernel 4.19. I created a commit that adds
a new extern prototype and checked the patch. Take a look:
Use option --strict with checkpatch.pl

Christophe
# git show

	commit 720cd4ee7bf3c0607eaea79e209b719bac79508e
	Author: Breno Leitao [off-list ref]
	Date:   Wed Oct 24 10:31:54 2018 -0400

	powerpc/mm: New test function

	New test function.

	Signed-off-by: Breno Leitao [off-list ref]

	diff --git a/arch/powerpc/include/asm/hugetlb.h
	b/arch/powerpc/include/asm/hugetlb.h
	index 2d00cc530083..4a348e42cab6 100644
	--- a/arch/powerpc/include/asm/hugetlb.h
	+++ b/arch/powerpc/include/asm/hugetlb.h
	@@ -167,6 +167,8 @@ extern int huge_ptep_set_access_flags(struct  
vm_area_struct *vma,
				      unsigned long addr, pte_t *ptep,
				      pte_t pte, int dirty);

	+extern int test(int foo);
	+
	static inline pte_t huge_ptep_get(pte_t *ptep)
	{
		return *ptep;

	diff --git a/mm/hugetlb.c b/mm/hugetlb.c
	index 5c390f5a5207..2e8f5f77f7f6 100644
	--- a/mm/hugetlb.c
	+++ b/mm/hugetlb.c
	@@ -3204,6 +3204,11 @@ static void set_huge_ptep_writable(struct
	vm_area_struct *vma,
		update_mmu_cache(vma, address, ptep);
	}

	+int test(int foo)
	+{
	+	return foo;
	+}
	+
	bool is_hugetlb_entry_migration(pte_t pte)
	{
	swp_entry_t swp;


# scripts/checkpatch.pl -g HEAD

	total: 0 errors, 0 warnings, 19 lines checked

	Commit 720cd4ee7bf3 ("powerpc/mm: New test function") has no obvious
	style problems and is ready for submission.
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help