From patchwork Tue Sep 13 07:26:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 76040 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp1226237qgf; Tue, 13 Sep 2016 00:27:06 -0700 (PDT) X-Received: by 10.66.252.167 with SMTP id zt7mr2096456pac.93.1473751626756; Tue, 13 Sep 2016 00:27:06 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si26156189paz.233.2016.09.13.00.27.06; Tue, 13 Sep 2016 00:27:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755479AbcIMH1D (ORCPT + 27 others); Tue, 13 Sep 2016 03:27:03 -0400 Received: from mail-pf0-f182.google.com ([209.85.192.182]:33527 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754626AbcIMH1A (ORCPT ); Tue, 13 Sep 2016 03:27:00 -0400 Received: by mail-pf0-f182.google.com with SMTP id g202so61176191pfb.0 for ; Tue, 13 Sep 2016 00:27:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=Aah0aNhPrpVwCnVObnhcNE1aF9zD/iYpAvEAL8r3S5A=; b=IgAQL/LqAOwjZrqr2hfayXN3+bkZI5wHnkGJgcMrDvG5XMZ21krcGT/8Zgsrr7UCiJ c+JY6Pk0H9J9pnt7Aw4qQ+CnIQahPtK/1VDDIkCiJfYl+l/pHc1FyZz8J18wmG9d4pYH g7ELcKnfUg2ZQ0SxnJWGOw5MO0ixJS4w/JV4w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Aah0aNhPrpVwCnVObnhcNE1aF9zD/iYpAvEAL8r3S5A=; b=c09+j2afWWbQA6sqGA3zDjcAC1KJe2XdpPeLHIXQh/wiqQE59f88M/3drEwkst5C3C ShK9vQPfMFAmFHCx9Q/dEwNv8OhccI83FIeKrKL37mpjxGGz8dAAzUO5vY9YV825F+MP 2uzOSCopb60Su36O0h7rgcHP7XgeZ2Ssh7x+lX+3+eG2LYmF/PKdzuqgfn71JYkhXZIv j4uRyG7nWBWNLK5QOT3K0rOHUWTU1ZhLnUiwgSNLbtmnGwcysGYMUkJK9n4AQgsCE4MQ vgMmJ+uG8OKlLQR0axilvd4STJUrwEk2nc36OkMP0n/ni9VfOYlrIg4qMRO2TBkCc3ud 6UlA== X-Gm-Message-State: AE9vXwNZ28ajOTBab67Gr9nj2qCZ3EZEcIWYLEhRv9G88Fkpc/OrvvmlhUcsqXaF6OxtWNDe X-Received: by 10.98.58.195 with SMTP id v64mr38370373pfj.97.1473751619827; Tue, 13 Sep 2016 00:26:59 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.36]) by smtp.gmail.com with ESMTPSA id y2sm28995330pan.31.2016.09.13.00.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 13 Sep 2016 00:26:59 -0700 (PDT) From: Baoyou Xie To: ralf@linux-mips.org, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, arnd@arndb.de, akpm@linux-foundation.org, paul.burton@imgtec.com, chenhc@lemote.com, david.daney@cavium.com, kumba@gentoo.org, yamada.masahiro@socionext.com, kirill.shutemov@linux.intel.com, dave.hansen@linux.intel.com, toshi.kani@hpe.com, dan.j.williams@intel.com, luto@kernel.org, JBeulich@suse.com Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, baoyou.xie@linaro.org, xie.baoyou@zte.com.cn Subject: [PATCH v2] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h Date: Tue, 13 Sep 2016 15:26:37 +0800 Message-Id: <1473751597-12139-1-git-send-email-baoyou.xie@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We get 1 warning when building kernel with W=1: drivers/char/mem.c:220:12: warning: no previous prototype for 'phys_mem_access_prot_allowed' [-Wmissing-prototypes] int __weak phys_mem_access_prot_allowed(struct file *file, In fact, its declaration is spreading to several header files in different architecture, but need to be declare in common header file. So this patch moves phys_mem_access_prot_allowed() to pgtable.h. Signed-off-by: Baoyou Xie --- arch/mips/include/asm/pgtable.h | 2 -- arch/x86/include/asm/pgtable_types.h | 2 -- include/asm-generic/pgtable.h | 3 +++ 3 files changed, 3 insertions(+), 4 deletions(-) -- 2.7.4 diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index 70128d3..9e9e944 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -673,8 +673,6 @@ static inline pmd_t pmdp_huge_get_and_clear(struct mm_struct *mm, struct file; pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot); -int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, - unsigned long size, pgprot_t *vma_prot); #endif /* diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h index f1218f5..8b4de22 100644 --- a/arch/x86/include/asm/pgtable_types.h +++ b/arch/x86/include/asm/pgtable_types.h @@ -439,8 +439,6 @@ extern pgprot_t pgprot_writethrough(pgprot_t prot); struct file; pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, unsigned long size, pgprot_t vma_prot); -int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, - unsigned long size, pgprot_t *vma_prot); /* Install a pte for a particular vaddr in kernel space. */ void set_pte_vaddr(unsigned long vaddr, pte_t pte); diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h index d4458b6..c4f8fd2 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -800,6 +800,9 @@ static inline int pmd_clear_huge(pmd_t *pmd) #endif #endif +struct file; +int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, + unsigned long size, pgprot_t *vma_prot); #endif /* !__ASSEMBLY__ */ #ifndef io_remap_pfn_range