Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp15773840rwb; Mon, 28 Nov 2022 16:08:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf7K9PZ4TddDPr671eHnZxDMEZibgUwOO/5XKaXN96UL1N0zZgBeurwi5sngiXgBmvrrt7gc X-Received: by 2002:a17:902:724c:b0:189:77c2:371d with SMTP id c12-20020a170902724c00b0018977c2371dmr12939578pll.35.1669680484556; Mon, 28 Nov 2022 16:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669680484; cv=none; d=google.com; s=arc-20160816; b=I/3a7qJvhNPTRfRP1PwC3OG1m6DQcnmA6Pqfdgb4tgDpS3WbVTqq1szSzu3BFRY8Fe h5uA4RCN0JKglqITB8CnD55XhlB1ArC3g0RME4I19uRlze04Yqw5OZuvlR7b0l+QVvN8 Q9lwhbAEXiHHbkHGS+ILY5CxoexBMASygiAnnyzhZbQKCmc4GkSGO2nPamEAvjDZGsz6 cEeiIcBJ45Kv2AYTVAXqyWIunoId2NUtp80H9ihkQ8bfnthPbA+sif8DyxhmiOcgx9Eh ie616XNdntOepjlpsbh7vSCoIEgEBIQU+ATriQ9hnFxxxc1qlGekBX4nn2vqxbZXuTOx aTfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fPVfjcgyvAsbLlEPOcdU8Bfxz3Ro7mNFhXQn3DKycTw=; b=dTxlvHnLV1L0nDapJVPDoqQ8C0qTSBEk0N3hGQbSiAB/cG6A3QCOQKG7UEK8gMCWTv LqcCwzuHkFPwT5gZJ6Hs7/Zp359R87dAhjUtIJQDBhWOjGtfpgtaTw9QF3+SECls8gG8 5vB28T6kLCwPjVn0hPpRIeLMoyMLabnXhh6FxwvVHfnU2OE4jOeyLLN2Y35yTF5u5p6g riI2QzExYnp53KaKDLkXbODC4CongbsdpcPrBpytZnK1CDjoESL222hY0gdBwafvPv7g TxP5LxF4qhRUkm/lzAFNzbYJ3c+NBjoclZ8h808mo1nZ/NxFjahOysAWEOD4+VouStOQ Iyvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FM+zDegQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m11-20020a170902f64b00b001866341b823si12212310plg.322.2022.11.28.16.07.51; Mon, 28 Nov 2022 16:08:04 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=FM+zDegQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234661AbiK1Xcs (ORCPT + 83 others); Mon, 28 Nov 2022 18:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234712AbiK1Xcl (ORCPT ); Mon, 28 Nov 2022 18:32:41 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE5BD60C1; Mon, 28 Nov 2022 15:32:40 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 71E3BB8103F; Mon, 28 Nov 2022 23:32:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1801AC433C1; Mon, 28 Nov 2022 23:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669678358; bh=nhzT3y8ECc0SM21u2kRL+g3RxzJpgEVvUa1o+ZAysIg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FM+zDegQkndaejyfC/Pw0kByEiz8hd1zlGhElcy0NsHeEm/jITQZDs+eoaBfL/YiN uQwnRCGHtz6CxzGfz8l1gMsi501ScGPcDTGYZPgCqkoewVwsAFWDtWEqhUye7OUkDz jZR9shAQ6cW+qmJ5RNGBmDje5iWBRxkzMmL5A9C97kVMdtZQx4ilbvo8LbQUAwClAL WFfYNJddlYY1l2j3Qmhs7V3h99abwYqh2CMTJdzqjwj2kMHJOaGtuCsWpyh1m1/uCS 0up4dVWOBfGM6MOvencqoCJguaAIzelAMtsaDXrPeRfAbBBZAt6lm8Mv8jdzK6SPBH +cMrbDmD7VZIA== Date: Tue, 29 Nov 2022 07:22:46 +0800 From: Jisheng Zhang To: "Ritesh Harjani (IBM)" Cc: Alexander Viro , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] coredump: fix compile warning when ELF_CORE=n while COREDUMP=y Message-ID: References: <20221128135056.325-1-jszhang@kernel.org> <20221128145956.6rgswicmtsuxxhdt@riteshh-domain> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221128145956.6rgswicmtsuxxhdt@riteshh-domain> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Mon, Nov 28, 2022 at 08:29:56PM +0530, Ritesh Harjani (IBM) wrote: > On 22/11/28 09:50PM, Jisheng Zhang wrote: > > fix below build warning when ELF_CORE=n while COREDUMP=y: > > > > fs/coredump.c:834:12: warning: ‘dump_emit_page’ defined but not used [-Wunused-function] > > 834 | static int dump_emit_page(struct coredump_params *cprm, struct > > page *page) > > | ^~~~~~~~~~~~~~ > > Fixes: 06bbaa6dc53c: "[coredump] don't use __kernel_write() on kmap_local_page()" > > > > > Signed-off-by: Jisheng Zhang > > --- > > 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 > > Instead of this ^^^, we could even move the definition of dump_emit_page() in > the same #ifdef as of dump_user_range(). Since dump_user_range() is the only > caller of dump_emit_page(). > > #ifdef CONFIG_ELF_CORE > [here] > int dump_user_range(struct coredump_params *cprm, unsigned long start, > unsigned long len) > {..} > #endif > I planed to patch like this, but I saw the final patch diffstat was a bit more. I'll send out a v2. Thanks > But I guess that's just a nitpick. Feel free to add: > > Reviewed-by: Ritesh Harjani (IBM) > > -ritesh > > > 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.37.2 > >