Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1202766ybh; Thu, 16 Jul 2020 06:09:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3J3RkkT2QZZlyhttSvrW45tz2BkIVpAIC5Y1rO2UJYvQybH0f7ldvTBRwGo9XkjdF6VTj X-Received: by 2002:a17:906:86d4:: with SMTP id j20mr3948834ejy.68.1594904951611; Thu, 16 Jul 2020 06:09:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594904951; cv=none; d=google.com; s=arc-20160816; b=r2OCAsDQ4UBBWqy6b8X7FOlllLlTBk4KDErLFMke0FPu612w6xhPx+qRUc3bkr/Hmt bUwptSUaeMuGjWu3K5uXek76aw+EgkCDgwp3v/dODi76IuB+ZmOSXmEMNlwFqTVPlGDG TP8+iKhQUtInIad4rffphU27v5UqCV6ldl9FF6ayQIPbiSQP7svy1JYLLymbx46JLYIf QuDd6xiBiRUk21VkYcL/4s8NXvZPdfpB6kv7L0/3iPRhI81bXpa4SXR5vSKX4bX9sw0X wiWHYS75OwAeTfZ1G0P96Tx65BxnHKtw5+y8PD4Xya5F3lD9NTu5BVPCNrrmFnD9MzNW wQKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jGzmIzqJnm7CKiLoQ8H6AcVjxIg7aO11yFeUG1Srnrs=; b=UITwirbbklZgk1oH4jHXo30r/ezXsTtO+Xp0bxF137QhS+f82f+PglF9WffRfsskio zhoMBM08DtZd1v97nk3dW8ZQbam3LbfhLVg1nM1F7GluunWHdHlJwDmG4Drg0Bjs1DbL cHffUsMZCCSpVYW1wnxZBMcULGGNAUIUdDMRgamJKL2J9z9RR9fEwaLvgGfTZs+Ha28T IL44WaGXoPeElC5oVH2BYtFnhcpr6HU8+cObfWtqFrMt7tBdR6mhK5mRJghGiAfCaJJG K8YZNFXT9d25Czh92xbmIu2udcWOGkpu4AGPg+ZwuMvDwmaZL0rCKowCKN8AVyaSLoIB MaPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=A9q2xqO9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz22si3000832ejb.742.2020.07.16.06.08.48; Thu, 16 Jul 2020 06:09:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=A9q2xqO9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728780AbgGPNF6 (ORCPT + 99 others); Thu, 16 Jul 2020 09:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728767AbgGPNFy (ORCPT ); Thu, 16 Jul 2020 09:05:54 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF412C061755 for ; Thu, 16 Jul 2020 06:05:54 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id z3so3649965pfn.12 for ; Thu, 16 Jul 2020 06:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jGzmIzqJnm7CKiLoQ8H6AcVjxIg7aO11yFeUG1Srnrs=; b=A9q2xqO9qU7vO2PYAJ7sDGqDrFpOQhpO18YI1qzAdojQMgDPA9vvbwy6Dr+qGyMlCt 0hu0x4+MjSDu59Y1L4wyeRpS1SBGMk/weFFlmPqqkWNwkD+jMvYZP1yfV7b/5+7XWHaV cXMf2/u/3oSKMUlCX4vV2knvHwlk/NIvsKJonyc9mbygZbI1RX6+2ut3TJxs8vm1MT7O 6OqsthAU2ZM5XML9B4JgoAmxMBS8EqYWHIAtatLVxwCfrq752o0gpHG/Xv2wptWcFf4F 0nTOxf1XAJQALDR0EOPkwADZwKZA9JIxftA8904XOF/qPSngheKnxRmZL8dZmy/1v0HU jV9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jGzmIzqJnm7CKiLoQ8H6AcVjxIg7aO11yFeUG1Srnrs=; b=SoaOS5Kkqjur0OfH3YNAecpBG4PYEzJyEWc4oyGsJSY2og6ZCKvnCl9y1rRLdEHrbc NZ9cM+Z0KthWnYFgfThCTmEe9VGmUCq4pk0i4yBV0/muugBjonQue+U2D81qSaox4X3C 7/jvJLPOd3EUZMaaYfjxV2ChIqaDenuDIqV1YusKxT7cSr3pUyfbVsiXFf7lbQuTLDPz vnFCosxQPvf11GK2wb6MMZdis/Bx8K36/cZLTVGsdGbFv53DWVBmcO85bgTIHIS8URrd 8HgvDjLEwzbrEC20aI/Uyt2mrUsgwRxapJbhFoI4JuoZy9HQXJrkszHiHLVN/papjStd ApqQ== X-Gm-Message-State: AOAM530WWvFlX98XiOVh7X0gQqGY8aE+xRYi9uhaplL+muO4J8ABDeF4 7K1MW32LmLH/EZcRX05ntV/nwQ== X-Received: by 2002:a63:4a4c:: with SMTP id j12mr4317304pgl.115.1594904754427; Thu, 16 Jul 2020 06:05:54 -0700 (PDT) Received: from hsinchu02.internal.sifive.com (114-34-229-221.HINET-IP.hinet.net. [114.34.229.221]) by smtp.gmail.com with ESMTPSA id c134sm4770203pfc.115.2020.07.16.06.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 06:05:53 -0700 (PDT) From: Zong Li To: palmer@dabbelt.com, paul.walmsley@sifive.com, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Zong Li , Pekka Enberg Subject: [PATCH v2 2/2] riscv: Fix build warning for mm/pageattr Date: Thu, 16 Jul 2020 21:05:46 +0800 Message-Id: <8691a6a78271c748a2f75f1430b36f304551838d.1594886530.git.zong.li@sifive.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add header for missing prototype. Also, static keyword should be at beginning of declaration. The warning messages as follows (with W=1 build): 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] Signed-off-by: Zong Li Reviewed-by: Pekka Enberg --- arch/riscv/mm/pageattr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/mm/pageattr.c b/arch/riscv/mm/pageattr.c index 289a9a5ea5b5..19fecb362d81 100644 --- a/arch/riscv/mm/pageattr.c +++ b/arch/riscv/mm/pageattr.c @@ -7,6 +7,7 @@ #include #include #include +#include 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, -- 2.27.0