Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6397643rwb; Mon, 14 Nov 2022 20:06:33 -0800 (PST) X-Google-Smtp-Source: AA0mqf7dEmhR5azfrERvwDE1OsJjpRHA3Ll77b2niAb9xRvVg1PLW+6dhSVR/1+A9VkJ+qFAl9Oj X-Received: by 2002:a63:d506:0:b0:473:efcb:3950 with SMTP id c6-20020a63d506000000b00473efcb3950mr14717157pgg.232.1668485193412; Mon, 14 Nov 2022 20:06:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668485193; cv=none; d=google.com; s=arc-20160816; b=PmbFhMI4513AjIgHMrHl0YLe6yqlGRDmYUHSSr63mtUf3XunktS10L3ddIaCtwQ3fZ cVDyegGUvXDkSOkl0h1P+1ydfKsPLV/uLGrkxqMf2w8GwOKeMaA5b6nNOuamfsrIhrCI k+ILZB1d5/HJZ41W2tarDj+7QgSlSL8YknNNIA/6KQmLi9KTJNAy3YBFcIsS/+7Ic1sd zgv5y2weLF4cogcV5falHjcfp8IAJvDJNlh68tVA3PrmrqrIenIbkamdOpdzjgYkBVfd C4Q9B/evgqZAyo8VRER0oNDtkaW+SBrtUMMcjEilafowYpVh+Gyy5/gVwQEnSwZkvm0H Ztxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=lvaXuhrAyZaXgHX/JHoMtV3BucM3J/MSMUibS3HymDo=; b=iA6yOfc1Ce3qd68EFDhhXNYj5lpfR+ZfFadXHzfvkwH9Vzm4jR8UdBKOLWI5QtfJcF uEkct1iiYlscD/Hdao1mn3O1kXpiLbzMiRk5GRuZiERJlFZVZTjnAz8Tr/xZD6ov5OjE hk9s3LVfvamhrbb9Ya004tsEKK0uE4IK2aQW08+nMy0Z11HF3HGpdCHrqmGQsjWbzvn7 C3FcOTZtloQbbqD8TeVu119QYqXiHZJmxsoIWx3YUyXDkJFEDNLkh4E6BrB2+r2Hz5tg x6OnxaFYDpJAiQvt/ezhpklbBWgko0AWv3cSNszJUxcdpmFo/qisF0dgo3SclRAoUZ4C 21nA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a63ef54000000b004704ce49b48si11388915pgk.592.2022.11.14.20.06.21; Mon, 14 Nov 2022 20:06:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237763AbiKODfQ (ORCPT + 88 others); Mon, 14 Nov 2022 22:35:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237608AbiKODfO (ORCPT ); Mon, 14 Nov 2022 22:35:14 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50BE57653; Mon, 14 Nov 2022 19:35:12 -0800 (PST) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4NBBY81HTBzqSPh; Tue, 15 Nov 2022 11:31:24 +0800 (CST) Received: from huawei.com (10.67.174.191) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 15 Nov 2022 11:35:10 +0800 From: Li Hua To: CC: , , , , Subject: [PATCH] =?UTF-8?q?coredump:=20Fix=20build=20error=20for=20?= =?UTF-8?q?=E2=80=98dump=5Femit=5Fpage=E2=80=99=20defined=20but=20not=20us?= =?UTF-8?q?ed?= Date: Tue, 15 Nov 2022 12:04:00 +0800 Message-ID: <20221115040400.53712-1-hucool.lihua@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.174.191] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_ELF_CORE is not set: fs/coredump.c:834:12: error: ‘dump_emit_page’ defined but not used [-Werror=unused-function] static int dump_emit_page(struct coredump_params *cprm, struct page *page) ^~~~~~~~~~~~~~ Fix this by adding the missing CONFIG_ELF_CORE for dump_emit_page. Fixes: 06bbaa6dc53c ("[coredump] don't use __kernel_write() on kmap_local_page()") Signed-off-by: Li Hua --- fs/coredump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/coredump.c b/fs/coredump.c index 7bad7785e8e6..8663042ebe9c 100644 --- a/fs/coredump.c +++ b/fs/coredump.c @@ -831,6 +831,7 @@ static int __dump_skip(struct coredump_params *cprm, size_t nr) } } +#ifdef CONFIG_ELF_CORE static int dump_emit_page(struct coredump_params *cprm, struct page *page) { struct bio_vec bvec = { @@ -863,6 +864,7 @@ static int dump_emit_page(struct coredump_params *cprm, struct page *page) return 1; } +#endif int dump_emit(struct coredump_params *cprm, const void *addr, int nr) { -- 2.17.1