From patchwork Mon Sep 12 12:35:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoyou Xie X-Patchwork-Id: 75991 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp828139qgf; Mon, 12 Sep 2016 05:35:58 -0700 (PDT) X-Received: by 10.98.58.195 with SMTP id v64mr30558436pfj.97.1473683750882; Mon, 12 Sep 2016 05:35:50 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d1si21507408pas.279.2016.09.12.05.35.50; Mon, 12 Sep 2016 05:35:50 -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 S1758669AbcILMfr (ORCPT + 27 others); Mon, 12 Sep 2016 08:35:47 -0400 Received: from mail-pf0-f169.google.com ([209.85.192.169]:34141 "EHLO mail-pf0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758381AbcILMfn (ORCPT ); Mon, 12 Sep 2016 08:35:43 -0400 Received: by mail-pf0-f169.google.com with SMTP id p64so52328573pfb.1 for ; Mon, 12 Sep 2016 05:35:42 -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=i7P4XGle7oEHWZWzc6cpxm8ibdvnt3kWQ0IWDpPInwk=; b=LyyH+ZYbNexBK0UEYuvFgc4tdgCww/pW+I3ytJzvLymewUNGYUVi5wsOGjcmIXZCwb jz+LC5zQ4ho3PdhCAkkXsTN6qt4G/uOHhXpwxKhQgF/k3C/6lkfIHlHUq0Lv18QjxEVN 0orL/ubG763cveScbbV0PrxlexqVSXBsI3Tk0= 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=i7P4XGle7oEHWZWzc6cpxm8ibdvnt3kWQ0IWDpPInwk=; b=LbBl6jZNpfs/cYhdPnbLNWhujPjdyDR4oyFJrlAbl79hEOuPxm/sy5sWPI/JToML/W 5lxD8UgWbYC8vQNr0fBlEvTTdDPdcuhLJxUbWJkYSsNgH8mSV7txAfCuA98BZ/BbPCyu HbEwHoxMGK7aB4HNAp1GsLmz7kqm+2ySwwHYnT+/DV1jMUH0/kjVB/OXQ4uzlSOIBvhG 7+Ce8LIzhlJdZVzWotigIULHShFkOQb+7gAGs9EGi3j0KLyF3vUdE/HrxEZIiUOBtY5n VCRA1E0EQfp9rZ77MbPcCz+9pJ3aIQetU1HTch+vrB50IehuTXMXb7WKhrg6W5JjXdGX gUlg== X-Gm-Message-State: AE9vXwOJbLwBDCVnytdwp3sfzIx0PhoSPOzHUOITiRo7pLfbuqc3rTWOMrbdagJTnqPjehkg X-Received: by 10.98.22.212 with SMTP id 203mr33174598pfw.74.1473683742285; Mon, 12 Sep 2016 05:35:42 -0700 (PDT) Received: from localhost.localdomain ([45.56.152.29]) by smtp.gmail.com with ESMTPSA id u1sm22496013pfb.62.2016.09.12.05.35.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Sep 2016 05:35:41 -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, JBeulich@suse.com, dan.j.williams@intel.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] mm: move phys_mem_access_prot_allowed() declaration to pgtable.h Date: Mon, 12 Sep 2016 20:35:03 +0800 Message-Id: <1473683703-15727-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..ad625dd 100644 --- a/include/asm-generic/pgtable.h +++ b/include/asm-generic/pgtable.h @@ -814,4 +814,7 @@ 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 /* _ASM_GENERIC_PGTABLE_H */