From patchwork Tue Nov 15 04:04:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Lihua (lihua, ran)" X-Patchwork-Id: 20168 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2502518wru; Mon, 14 Nov 2022 19:47:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf7hKbIy3wwhbhMIKumw4yygQRkNDD1p954PbgEE2tGV67lLtkN8/H9pjY/vo8nCeKDKOv3z X-Received: by 2002:a17:902:e847:b0:186:8d12:f51f with SMTP id t7-20020a170902e84700b001868d12f51fmr2214459plg.129.1668484060158; Mon, 14 Nov 2022 19:47:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668484060; cv=none; d=google.com; s=arc-20160816; b=kjzgFmJA4TzzqGQbKf/STst9gtpyGZNfqxMst1pxUPD9P+sjdMjZ3ZAdStbTt4CCRE wgpfnYePRpd1/+DSMf9PsK1R2JDZVYCgKAY1V/e278qlKmR2Iz6lAQbc7kxxphLPh4Ct GQ9PNiGCVNatFchoiLYtK+ijincP6OGv3l7FTOtgfUdGTB3eQA+8lYuNB2kLeI5ea4f2 O5N8GN6VmjYD4AGP/jQlFHkJ7pukuY0F8gp9iOTXpD/1gvDajxLKW6o/9dQGBhZ3krpu WJlhkJqQ0MAvOV7kVlnNkHMLErOr6+TtoMAuGusm2uIspVXssL9XeijomdFO7ZrVA6t8 qvIg== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a656794000000b004701d6ac07bsi10617375pgr.875.2022.11.14.19.47.27; Mon, 14 Nov 2022 19:47:40 -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 + 99 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=3A_Fix_build_error_for_=E2=80=98dump=5Fe?= =?utf-8?q?mit=5Fpage=E2=80=99_defined_but_not_used?= 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749532341700873672?= X-GMAIL-MSGID: =?utf-8?q?1749532341700873672?= 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 Reviewed-by: Chaitanya Kulkarni --- 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) {