Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1154333pxb; Fri, 21 Jan 2022 11:01:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9xhwJTWeZHiWRjbdcWsktBqgqT+cfTdMV8Dp+n4escxIiIqhgkrQ2y1N3mwz2jHoNbUvO X-Received: by 2002:a63:e64a:: with SMTP id p10mr3839947pgj.331.1642791686640; Fri, 21 Jan 2022 11:01:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642791686; cv=none; d=google.com; s=arc-20160816; b=g4HJ7Mts3jKux2KMwWvfg3p0P3C1WgdZbvxxPqcydpQ57KjjPzDgebEchpC11LtLzz mU6zyM7sWyv+vAHv9vfb+UNpxYXkkORatiKWd2LJ/qG449ckMthQS/YsaDGt8zMr/oYi SRWgLiz07MqzJrtLXLxNneRxSC3wZMD0G3UEbSSuL1YmwT19tkjJn/Ua/nI62U1GLzVc K4pBxhDuNpZ2VOiU0ai1rBMbo3SoATpyqi5DWfdye0DPrI1cwcyUyDn4ZQXeCdb/BuXg Zdb/RaSngiF3p2QAX8R3oSuljDyLGrRUJGrpQOzznN8fXDbTZ1LGOMn27FDg7ywCVlVQ VNFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ai0mtCcxBfPYjg/Rd+cRPtcnrmZDCgQL5kNBaw6vXBk=; b=puwEcyue0QgA3BxJI79EEariI9p1ZouIcoR1LabC7TnDvxsArZVRCu4nenhhFG/js5 iUvbhbVCJjA6RonU3XkK1nVLVEsFxJ7CJPt14n8ny+NqZwMKftsL/NmEKSIGBZZfgqCp U1XY2TnHvarxl03TzupEqN4PW5tFSYyYQf1Utlvsab9YjJ1cHcU03WirZh17L1Wf91Dq xm/naZHdiRBGCnPn6ijo0jhp2xT6T5p3IDLwg14SZYO6Unr1JOYJFsllM/PDbjGSXsJL B6QRO0G6sXo3yjmBP8RTHHlfLbAovrxTJS9rWUu9raS+EWjn6WKwESRCQ4j4tirSHv9E +MWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=MpXAuc4J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p13si7709536pfh.140.2022.01.21.11.01.14; Fri, 21 Jan 2022 11:01:26 -0800 (PST) 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=@canonical.com header.s=20210705 header.b=MpXAuc4J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352607AbiASIwb (ORCPT + 99 others); Wed, 19 Jan 2022 03:52:31 -0500 Received: from smtp-relay-internal-0.canonical.com ([185.125.188.122]:40580 "EHLO smtp-relay-internal-0.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352603AbiASIwa (ORCPT ); Wed, 19 Jan 2022 03:52:30 -0500 Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id C0F4C4004F for ; Wed, 19 Jan 2022 08:52:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1642582348; bh=ai0mtCcxBfPYjg/Rd+cRPtcnrmZDCgQL5kNBaw6vXBk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=MpXAuc4JOEkWUtixkFTJTFfCLuRZ0eTXWaVmYanA8zon1qexqm4Z3ZP+rtfuQ2vtP 8+CEsifp8jxuMKy8pJ353A67J6lF9Xyy2XMPMj3gd0vr7ux5cWaDmNCAQCD5PYLuRf XO7u4G5Ex1qjCDCnN2sFBjysWHdK4502r2vL0uvf8+tDeguN91HL0xkN63f1Z05SCt Cdfdt6w9VEhSip1Tr5zxYKcUpBQ90DHkmY3ooG3EmKxtElKA96GufQmc9hQdFKRLHb qCbWH0Dp6BvxPM8t8jH1IAEBq3Rrov7Ps9TSlUj8eKAF++8fmHalHXTFlvgXBqhC3C nOBIURmQkTySQ== Received: by mail-ed1-f69.google.com with SMTP id j10-20020a05640211ca00b003ff0e234fdfso1696221edw.0 for ; Wed, 19 Jan 2022 00:52:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ai0mtCcxBfPYjg/Rd+cRPtcnrmZDCgQL5kNBaw6vXBk=; b=qL9u5wUp1C6f4iQlFPRfpwsqcEy1eiUrZcgRmSl4etFMferGDDdwAu048rAJbF9skc AwX81PREPY3XwjrssBJrPVVTH40F67MoaSqxcrkuXUXnoPsSMembxD6uCM5q2yCfg5yT ZhEtFXY3XoEYsNCK3OYBtNPVCcOejEGAfCICJHYP2C5fXG+RhBAKBN0rg2TYLJjtluN5 Qe0DUMGRo4PnXFyto4a9QvqSljzCyqsLcWEKiVJVhS5SRZTeQl6cZoMxhUbl/zoOdOoq fxRZgt3w9fVMe/F8b6FY+nW3Ep6HOFB6BiSNMNkUB1NZNEfHSEMyJW+hsLRuICP5td5I HoHQ== X-Gm-Message-State: AOAM531BndyU3AaSnDch1/kLRuq1Md+590RO2J0L49YePSogJ06RzoDg rBjv9GIKL1w1qn7jpQP3WhJB8aQr+BnbWdVIuuY9DMIgKbpWvJsxZJNyH6Ovd20dpMg8loQsKsI k1Z1xcg5TEB3qJEJJnpMQp1ULkt3g0xw0Nr5FV8LUptsJjT2CgjmBVS1Y9A== X-Received: by 2002:a17:906:4fcb:: with SMTP id i11mr24904280ejw.297.1642582348164; Wed, 19 Jan 2022 00:52:28 -0800 (PST) X-Received: by 2002:a17:906:4fcb:: with SMTP id i11mr24904268ejw.297.1642582347994; Wed, 19 Jan 2022 00:52:27 -0800 (PST) MIME-Version: 1.0 References: <20211206160514.2000-1-jszhang@kernel.org> <20220116133847.GE2388@MiWiFi-R3L-srv> <20220119080859.GB4977@MiWiFi-R3L-srv> In-Reply-To: <20220119080859.GB4977@MiWiFi-R3L-srv> From: Alexandre Ghiti Date: Wed, 19 Jan 2022 09:52:16 +0100 Message-ID: Subject: Re: [PATCH v2 0/5] kexec: use IS_ENABLED(CONFIG_KEXEC_CORE) instead of #ifdef To: Baoquan He Cc: Jisheng Zhang , Russell King , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, hpa@zytor.com, Eric Biederman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, kexec@lists.infradead.org, Alexandre ghiti Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Baoquan, On Wed, Jan 19, 2022 at 9:11 AM Baoquan He wrote: > > On 01/18/22 at 10:13pm, Jisheng Zhang wrote: > > On Sun, Jan 16, 2022 at 09:38:47PM +0800, Baoquan He wrote: > > > Hi Jisheng, > > > > Hi Baoquan, > > > > > > > > On 12/07/21 at 12:05am, Jisheng Zhang wrote: > > > > Replace the conditional compilation using "#ifdef CONFIG_KEXEC_CORE" > > > > by a check for "IS_ENABLED(CONFIG_KEXEC_CORE)", to simplify the code > > > > and increase compile coverage. > > > > > > I go through this patchset, You mention the benefits it brings are > > > 1) simplity the code; > > > 2) increase compile coverage; > > > > > > For benefit 1), it mainly removes the dummy function in x86, arm and > > > arm64, right? > > > > Another benefit: remove those #ifdef #else #endif usage. Recently, I > > fixed a bug due to lots of "#ifdefs": > > http://lists.infradead.org/pipermail/linux-riscv/2021-December/010607.html > > Glad to know the fix. While, sometime the ifdeffery is necessary. I am > sorry about the one in riscv and you have fixed, it's truly a bug . But, > the increasing compile coverage at below you tried to make, it may cause > issue. Please see below my comment. > > > > > > > > > For benefit 2), increasing compile coverage, could you tell more how it > > > achieves and why it matters? What if people disables CONFIG_KEXEC_CORE in > > > purpose? Please forgive my poor compiling knowledge. > > > > Just my humble opinion, let's compare the code:: > > > > #ifdef CONFIG_KEXEC_CORE > > > > code block A; > > > > #endif > > > > If KEXEC_CORE is disabled, code block A won't be compiled at all, the > > preprocessor will remove code block A; > > > > If we convert the code to: > > > > if (IS_ENABLED(CONFIG_KEXEC_CORE)) { > > code block A; > > } > > > > Even if KEXEC_CORE is disabled, code block A is still compiled. > > This is what I am worried about. Before, if CONFIG_KEXEC_CORE is > unset, those relevant codes are not compiled in. I can't see what > benefit is brought in if compiled in the unneeded code block. Do I miss > anything? > This is explained in Documentation/process/coding-style.rst "21) Conditional Compilation". Alex > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv