From patchwork Thu Oct 31 07:27:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Xi X-Patchwork-Id: 13857652 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EF0410A3E; Thu, 31 Oct 2024 07:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.249.212.187 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730359932; cv=none; b=qECdWgz54GBLPG7wZXd12bnT9qa17RCxzi85iohQzyN5ogiTa8Zrwi4/0JAc2IuJaa0BTecxY8DFv2smxR+wGWpyMngECH9Cg8NouCz8pd9btejLEFUpywYwBcA+WputIjk2pfT8wkv8/Jx8QdgIn38uq7MTxd4GHAWbGs+6+3o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730359932; c=relaxed/simple; bh=1dGgcyfhlwe/HxebVzbWbX+YlU5aP6L1vpGPBd0sQZg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=Cvs6WbSsah/yr4LSQOrZmVCIHjjkxEcc9EHwub2oqz6aqgs67oLwIpiJ/ySwJBpLkjDVcDG9sA8+AAA1nBWeOTGCsoXvkmOdRowokvxhdASPflEiZYwPV28JS3FN4SIqa9ddqBDDIE3bJ3IKdXLb9qhm+1Lu3pb3b7k1DyRMonU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com; spf=pass smtp.mailfrom=huawei.com; arc=none smtp.client-ip=45.249.212.187 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=huawei.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=huawei.com Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4XfFyQ6hFDzySM0; Thu, 31 Oct 2024 15:30:22 +0800 (CST) Received: from kwepemm600002.china.huawei.com (unknown [7.193.23.29]) by mail.maildlp.com (Postfix) with ESMTPS id EED8E1800A5; Thu, 31 Oct 2024 15:32:02 +0800 (CST) Received: from huawei.com (10.44.142.84) by kwepemm600002.china.huawei.com (7.193.23.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 31 Oct 2024 15:32:02 +0800 From: Qi Xi To: , , , , , , , , CC: Subject: [PATCH] fs/proc: Fix compile warning about variable 'vmcore_mmap_ops' Date: Thu, 31 Oct 2024 15:27:46 +0800 Message-ID: <20241031072746.12897-1-xiqi2@huawei.com> X-Mailer: git-send-email 2.33.0 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600002.china.huawei.com (7.193.23.29) When build with !CONFIG_MMU, the variable 'vmcore_mmap_ops' is defined but not used: >> fs/proc/vmcore.c:458:42: warning: unused variable 'vmcore_mmap_ops' 458 | static const struct vm_operations_struct vmcore_mmap_ops = { Fix this by declaring it __maybe_unused. Fixes: 9cb218131de1 ("vmcore: introduce remap_oldmem_pfn_range()") Reported-by: kernel test robot Closes: https://lore.kernel.org/lkml/202410301936.GcE8yUos-lkp@intel.com/ Signed-off-by: Qi Xi --- fs/proc/vmcore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 1fb213f379a5..9651f105c25b 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -455,7 +455,7 @@ static vm_fault_t mmap_vmcore_fault(struct vm_fault *vmf) #endif } -static const struct vm_operations_struct vmcore_mmap_ops = { +static const struct vm_operations_struct __maybe_unused vmcore_mmap_ops = { .fault = mmap_vmcore_fault, };