From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FE27C433FE for ; Fri, 7 Jan 2022 03:58:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345949AbiAGD6D (ORCPT ); Thu, 6 Jan 2022 22:58:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230175AbiAGD6C (ORCPT ); Thu, 6 Jan 2022 22:58:02 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02A02C061245 for ; Thu, 6 Jan 2022 19:58:02 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id u13so10920871lff.12 for ; Thu, 06 Jan 2022 19:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=Ct5qh0NnIjgjBBI8xvXdVNKrKFDmuJqDQ6lk+nREa2ajHPDsDrFmIqTCK/ih45n/+i MxVvKQX4wxPd/KqFTbXeaMVUspFFe2zOFPIHwD8+X/hDyeWjkxKrw/miIwgpNC8CyAQY dWpmeQvSJ9tTMcsSrDml7yTQw1BbaBypeNN3U= 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=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=5mZoBeCCW2he84XMjopfIqrSSYMtwqwfLLH6A7FKPwnuQoyclYgksdIpqYC/GMysbO jKuuWPLOyuIe/3YwQy3ESoH754nhBt6FbajKhOlglJ+u6qEvOBMCXVt3k8DKhVViPDEL ff8my0k4YKCsXZx4NnDCsYdBl4Mbt9KGp32nEn9QY4lMPQo1XPrcfBBZgVpRsu1qOPDi YmJud45sXGRKVSMe99LYBvAW6go1AsL1OqI7BMyWpFkVC5biH43ttMdnSTjl4TMLmS1I FER2Daf4iWwHlflY1evPiwqoXoGNnPz2hhRqkwslG+VNdi+khzeAtGeoX9DmlrFdk9aQ fq0w== X-Gm-Message-State: AOAM530iRv9yqzyvnnMgNXA8UTj1p1BKdOXM/CIUMEt2OYH531TKVvRC zJcSIWggg2O1LQBrHPjoTyYJXERHUsUl/jObeJy0yA== X-Google-Smtp-Source: ABdhPJwB2LOLwXDSwFYbn94VKmzms3kaczzZBBcQQ0Iamv202Lew+ehb6NgWIJQfYAZCzjaWayYDS1PcdtAvATpbHog= X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr43356738ljp.201.1641527880239; Thu, 06 Jan 2022 19:58:00 -0800 (PST) MIME-Version: 1.0 References: <20220103145324.48008-1-angelogioacchino.delregno@collabora.com> <20220103145324.48008-2-angelogioacchino.delregno@collabora.com> <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> In-Reply-To: <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> From: Chen-Yu Tsai Date: Fri, 7 Jan 2022 11:57:49 +0800 Message-ID: Subject: Re: [PATCH 2/3] phy: mediatek: phy-mtk-mipi-dsi: Reorder and stop implicit header inclusion To: Chunfeng Yun Cc: AngeloGioacchino Del Regno , chunkuang.hu@kernel.org, p.zabel@pengutronix.de, kishon@ti.com, vkoul@kernel.org, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 6, 2022 at 4:48 PM Chunfeng Yun wrote: > > On Mon, 2022-01-03 at 15:53 +0100, AngeloGioacchino Del Regno wrote: > > All the headers for phy-mtk-mipi-{dsi,dsi-mt8173,dsi-mt8183}.c were > > included from phy-mtk-mipi-dsi.h, but this isn't optimal: in order to > > increase readability and sensibly reduce build times, the inclusions > > should be done per-file, also avoiding to include unused headers and > > should not be implicit. > > > > For this reason, move the inclusions to each file and remove unused > > ones. > > > > Signed-off-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > --- > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 +++++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 10 ++-------- > > 4 files changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > index 95a0d9a3cca7..59f028da9d3e 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_DSI_CON 0x00 > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > index 01b59527669e..6c6b192485ba 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_LANE_CON 0x000c > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 51b1b1d4ad38..6f7425b0bf5b 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > @@ -3,7 +3,14 @@ > > * Copyright (c) 2015 MediaTek Inc. > > */ > > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > inline struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw > > *hw) > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > index 8d32e9027a15..4eb5fc91e083 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > @@ -7,16 +7,10 @@ > > #ifndef _MTK_MIPI_TX_H > > #define _MTK_MIPI_TX_H > > > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > #include > > -#include > > > I don't think it's good idea to move the common headers into .c files Header files should be included directly by the file that uses facilities provided by said header file. Required ones should not be transitively included through other header files, as that introduces a subtle dependency. Also, needlessly including header files in places that aren't using them increases build time. See the 2000+ patch series from Ingo Molnar [1] increasing build performance by cleaning up header files. ChenYu [1] https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ > > struct mtk_mipitx_data { > > const u32 mppll_preserve; > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CF71BC433EF for ; Fri, 7 Jan 2022 03:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EL5Gn/PWAmkxHfKczighZu0jRfWSiNfWkC/uaf2QjFU=; b=1c0Sj6JixK6Evq myp1S2p9yN1vhXXjXg22i2OyqdLvRDa1RvybpGOphb+KMHlQKeSoO+j3pnlQnF8PzsW3BGEIvWT+S 6QOl1CiSCSqds7O5lRhkjbVMvqNB1LbVvSigQEWXjj5L0Da5+UwSAIFrT2ltleu6mAZ7VprggrTpi PeiLbLEjMKIjvFLubZCjI2Q7XIqvi91vkCUuqwF+WJRYv3Tcv6clm/jgwoC5VuMft4+ethMVy6BFI aC0q4YoDbp1CtF+SMFJvueSyxjN1IofVhES+dM1zRdtkgcukw8DDtLvv+//+hb7stx7fEUr30n0Q/ lYr9MjnSgqBABBvM75jw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOF-002Ctv-Lu; Fri, 07 Jan 2022 03:58:07 +0000 Received: from mail-lf1-x135.google.com ([2a00:1450:4864:20::135]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOB-002Crx-1r for linux-mediatek@lists.infradead.org; Fri, 07 Jan 2022 03:58:04 +0000 Received: by mail-lf1-x135.google.com with SMTP id o12so11061283lfk.1 for ; Thu, 06 Jan 2022 19:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=Ct5qh0NnIjgjBBI8xvXdVNKrKFDmuJqDQ6lk+nREa2ajHPDsDrFmIqTCK/ih45n/+i MxVvKQX4wxPd/KqFTbXeaMVUspFFe2zOFPIHwD8+X/hDyeWjkxKrw/miIwgpNC8CyAQY dWpmeQvSJ9tTMcsSrDml7yTQw1BbaBypeNN3U= 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=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=h//3NlkBhgYba/u8kbMlo0vvRuZzwWdCuZ33Q6MltcDien0jfwOe86TLTxuOpi/scJ OdlHlDZ35pLGJKM+i12rSQiy/1QewgyFOmm0GEKfGR0I0nsxpM9Ag2auqxe+vbsiw+Up MlsNb8wQqLiQqJvvyad0BLdxZIgjgNf/tMTgaIscZA/Ekh1Z7dqQkRzBhwzfuL+17YGf EpgCUJEjG9q7hpLXeFOi5yWzq9Qj73YjeCAvtb/Q4trQCvDxhdo2fZV0nMp6DpY/2wR4 sExeCF/U6kXwOJsZxpGibqIOYv6l16Q+YoVBBcLp239IbDZRYLvdCKLe5K5OWtY9YmLw Ls9Q== X-Gm-Message-State: AOAM531JgEwcy8JI+HJPFoNR8ivhLOXy9XklTI/6R62RdXkPZZ7B59Dp z7AP09CEJ0c4jwSEzdEqxzY3L6M2e/GZ2TbQsBO2og== X-Google-Smtp-Source: ABdhPJwB2LOLwXDSwFYbn94VKmzms3kaczzZBBcQQ0Iamv202Lew+ehb6NgWIJQfYAZCzjaWayYDS1PcdtAvATpbHog= X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr43356738ljp.201.1641527880239; Thu, 06 Jan 2022 19:58:00 -0800 (PST) MIME-Version: 1.0 References: <20220103145324.48008-1-angelogioacchino.delregno@collabora.com> <20220103145324.48008-2-angelogioacchino.delregno@collabora.com> <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> In-Reply-To: <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> From: Chen-Yu Tsai Date: Fri, 7 Jan 2022 11:57:49 +0800 Message-ID: Subject: Re: [PATCH 2/3] phy: mediatek: phy-mtk-mipi-dsi: Reorder and stop implicit header inclusion To: Chunfeng Yun Cc: AngeloGioacchino Del Regno , chunkuang.hu@kernel.org, p.zabel@pengutronix.de, kishon@ti.com, vkoul@kernel.org, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_195803_125812_C10AA8D6 X-CRM114-Status: GOOD ( 24.44 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On Thu, Jan 6, 2022 at 4:48 PM Chunfeng Yun wrote: > > On Mon, 2022-01-03 at 15:53 +0100, AngeloGioacchino Del Regno wrote: > > All the headers for phy-mtk-mipi-{dsi,dsi-mt8173,dsi-mt8183}.c were > > included from phy-mtk-mipi-dsi.h, but this isn't optimal: in order to > > increase readability and sensibly reduce build times, the inclusions > > should be done per-file, also avoiding to include unused headers and > > should not be implicit. > > > > For this reason, move the inclusions to each file and remove unused > > ones. > > > > Signed-off-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > --- > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 +++++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 10 ++-------- > > 4 files changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > index 95a0d9a3cca7..59f028da9d3e 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_DSI_CON 0x00 > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > index 01b59527669e..6c6b192485ba 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_LANE_CON 0x000c > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 51b1b1d4ad38..6f7425b0bf5b 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > @@ -3,7 +3,14 @@ > > * Copyright (c) 2015 MediaTek Inc. > > */ > > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > inline struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw > > *hw) > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > index 8d32e9027a15..4eb5fc91e083 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > @@ -7,16 +7,10 @@ > > #ifndef _MTK_MIPI_TX_H > > #define _MTK_MIPI_TX_H > > > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > #include > > -#include > > > I don't think it's good idea to move the common headers into .c files Header files should be included directly by the file that uses facilities provided by said header file. Required ones should not be transitively included through other header files, as that introduces a subtle dependency. Also, needlessly including header files in places that aren't using them increases build time. See the 2000+ patch series from Ingo Molnar [1] increasing build performance by cleaning up header files. ChenYu [1] https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ > > struct mtk_mipitx_data { > > const u32 mppll_preserve; > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 734C4C433EF for ; Fri, 7 Jan 2022 03:58:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5021711220C; Fri, 7 Jan 2022 03:58:03 +0000 (UTC) Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAE9611220C for ; Fri, 7 Jan 2022 03:58:01 +0000 (UTC) Received: by mail-lf1-x131.google.com with SMTP id p13so10930461lfh.13 for ; Thu, 06 Jan 2022 19:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=Ct5qh0NnIjgjBBI8xvXdVNKrKFDmuJqDQ6lk+nREa2ajHPDsDrFmIqTCK/ih45n/+i MxVvKQX4wxPd/KqFTbXeaMVUspFFe2zOFPIHwD8+X/hDyeWjkxKrw/miIwgpNC8CyAQY dWpmeQvSJ9tTMcsSrDml7yTQw1BbaBypeNN3U= 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=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=TlLAjlnOQSKvxZwUbGu7VSdDaLf+qnVh7HOtd6f/IbYm6nxZ7GPQ/Dhz8h6zlTXsKO urgxtmJOQEvffejmTYnH7PMHSQX10wyRjELOYMCJRLur7VoEzw/h8pe/1ZcgpmjUWcVS XXnJ7WHiUGKVqAMczQoqcdQz7hjzOQyup2lyV4H/ciwacWTsYiuxVFNV4yPHleBZL2lQ KJRvEIYQtA/QbjzFC4riuB0ZRrsldFzk/GpqpL21DV7fyBZtji321aKTRkhKLUqBLQgw 4QvzQS7QNqojn7NzKNd1MqNMUjNPZSe0EjGcHQSMk+okALFcgxn/+bA41CxDZVumUufe NMgA== X-Gm-Message-State: AOAM532IGiCIF7Mi2Lt7ONSaMOBUcqoOyq8VqncM26f7mz0xdHEiAs9P +ldbhhzQOdOIiZ2VIlqM3qUbMO9fJUZ02fB0+vIB7A== X-Google-Smtp-Source: ABdhPJwB2LOLwXDSwFYbn94VKmzms3kaczzZBBcQQ0Iamv202Lew+ehb6NgWIJQfYAZCzjaWayYDS1PcdtAvATpbHog= X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr43356738ljp.201.1641527880239; Thu, 06 Jan 2022 19:58:00 -0800 (PST) MIME-Version: 1.0 References: <20220103145324.48008-1-angelogioacchino.delregno@collabora.com> <20220103145324.48008-2-angelogioacchino.delregno@collabora.com> <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> In-Reply-To: <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> From: Chen-Yu Tsai Date: Fri, 7 Jan 2022 11:57:49 +0800 Message-ID: Subject: Re: [PATCH 2/3] phy: mediatek: phy-mtk-mipi-dsi: Reorder and stop implicit header inclusion To: Chunfeng Yun Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: chunkuang.hu@kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, kishon@ti.com, linux-phy@lists.infradead.org, vkoul@kernel.org, linux-mediatek@lists.infradead.org, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org, AngeloGioacchino Del Regno Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Jan 6, 2022 at 4:48 PM Chunfeng Yun wrote: > > On Mon, 2022-01-03 at 15:53 +0100, AngeloGioacchino Del Regno wrote: > > All the headers for phy-mtk-mipi-{dsi,dsi-mt8173,dsi-mt8183}.c were > > included from phy-mtk-mipi-dsi.h, but this isn't optimal: in order to > > increase readability and sensibly reduce build times, the inclusions > > should be done per-file, also avoiding to include unused headers and > > should not be implicit. > > > > For this reason, move the inclusions to each file and remove unused > > ones. > > > > Signed-off-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > --- > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 +++++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 10 ++-------- > > 4 files changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > index 95a0d9a3cca7..59f028da9d3e 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_DSI_CON 0x00 > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > index 01b59527669e..6c6b192485ba 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_LANE_CON 0x000c > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 51b1b1d4ad38..6f7425b0bf5b 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > @@ -3,7 +3,14 @@ > > * Copyright (c) 2015 MediaTek Inc. > > */ > > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > inline struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw > > *hw) > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > index 8d32e9027a15..4eb5fc91e083 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > @@ -7,16 +7,10 @@ > > #ifndef _MTK_MIPI_TX_H > > #define _MTK_MIPI_TX_H > > > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > #include > > -#include > > > I don't think it's good idea to move the common headers into .c files Header files should be included directly by the file that uses facilities provided by said header file. Required ones should not be transitively included through other header files, as that introduces a subtle dependency. Also, needlessly including header files in places that aren't using them increases build time. See the 2000+ patch series from Ingo Molnar [1] increasing build performance by cleaning up header files. ChenYu [1] https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ > > struct mtk_mipitx_data { > > const u32 mppll_preserve; > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B707AC433F5 for ; Fri, 7 Jan 2022 03:58:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HueJZL9UF7Xai3unrbHNFNdIKwSl45iPsCdanmGp6Ok=; b=eALfnW35SbpBvL WLyYHnnN7YNT3ZlXOmyan7CM8ASnXHO+O0M3g2y7pQlTBveRLPy0wokC4Us29JDhwKCVWIZEfaSRm dBKDz9Zb0fd8PPtLHIGvldBIkNR/XQf9vl5ZP0chp3ODexvs9NHWienLM/VeDBVXhv7H9VYkfInzH 8oEB55nYrwcIR6yzZK2vMymUNs2XkHeZxN808p6spoBZ6KbFD/o/leIbVU8e3Hk8CsHwCLHmLfJre Ux+3RL6/C4jPeTWI6EkU3uYqKUUL8dj6X+wu3Q8hq0ucKlWfyJLldB5uTAgSyfw9rG2lGVYZUZpE/ +oaffPmcckaOk/CXuFvg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOE-002Cts-2u; Fri, 07 Jan 2022 03:58:06 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOB-002Crw-1b for linux-phy@lists.infradead.org; Fri, 07 Jan 2022 03:58:04 +0000 Received: by mail-lf1-x12e.google.com with SMTP id i31so10926103lfv.10 for ; Thu, 06 Jan 2022 19:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=Ct5qh0NnIjgjBBI8xvXdVNKrKFDmuJqDQ6lk+nREa2ajHPDsDrFmIqTCK/ih45n/+i MxVvKQX4wxPd/KqFTbXeaMVUspFFe2zOFPIHwD8+X/hDyeWjkxKrw/miIwgpNC8CyAQY dWpmeQvSJ9tTMcsSrDml7yTQw1BbaBypeNN3U= 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=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=f8HJwh81a2tj7kzfF6Pvzuh112pVVMsxLqL7ipzJePveyc0vmnryF8Pvr1qNpuSsJ0 dntuwUylq7ntLDvY9ztXQ9L1pltyKe2MQoEX82L/KsYiOCsHTO0OhJc/DGNDXdb0iKiH 6SWsF91SwUSwpGryhVLu6kfbEmxvqGmGBR+LIj2qQn1vtpTD2DI10UNk3qZI/cBks0Xt LxgVwkIvG88P+UK7Juk6FadCCFDlQ4XcFYolgJWmDbkTIXD6IP3SdGfgGvAKAi6T5KTL wHYnHmsYkDmwPGwGnwroOpKUttFEF0VQzWZAk8G37hIPJaSAN/5J6Z7vLRcXXcoHXFO0 lAwQ== X-Gm-Message-State: AOAM532Ab21zu6YiDou77KAx4/v4uUgLUHOLtUhsVP5dEAvpQ1w8THmV Iu219+fMMpMFfHNqVb8PwGBZvFpMNiVwCSQDI2NJTg== X-Google-Smtp-Source: ABdhPJwB2LOLwXDSwFYbn94VKmzms3kaczzZBBcQQ0Iamv202Lew+ehb6NgWIJQfYAZCzjaWayYDS1PcdtAvATpbHog= X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr43356738ljp.201.1641527880239; Thu, 06 Jan 2022 19:58:00 -0800 (PST) MIME-Version: 1.0 References: <20220103145324.48008-1-angelogioacchino.delregno@collabora.com> <20220103145324.48008-2-angelogioacchino.delregno@collabora.com> <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> In-Reply-To: <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> From: Chen-Yu Tsai Date: Fri, 7 Jan 2022 11:57:49 +0800 Message-ID: Subject: Re: [PATCH 2/3] phy: mediatek: phy-mtk-mipi-dsi: Reorder and stop implicit header inclusion To: Chunfeng Yun Cc: AngeloGioacchino Del Regno , chunkuang.hu@kernel.org, p.zabel@pengutronix.de, kishon@ti.com, vkoul@kernel.org, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_195803_125805_EBEC011E X-CRM114-Status: GOOD ( 24.24 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org On Thu, Jan 6, 2022 at 4:48 PM Chunfeng Yun wrote: > > On Mon, 2022-01-03 at 15:53 +0100, AngeloGioacchino Del Regno wrote: > > All the headers for phy-mtk-mipi-{dsi,dsi-mt8173,dsi-mt8183}.c were > > included from phy-mtk-mipi-dsi.h, but this isn't optimal: in order to > > increase readability and sensibly reduce build times, the inclusions > > should be done per-file, also avoiding to include unused headers and > > should not be implicit. > > > > For this reason, move the inclusions to each file and remove unused > > ones. > > > > Signed-off-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > --- > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 +++++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 10 ++-------- > > 4 files changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > index 95a0d9a3cca7..59f028da9d3e 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_DSI_CON 0x00 > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > index 01b59527669e..6c6b192485ba 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_LANE_CON 0x000c > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 51b1b1d4ad38..6f7425b0bf5b 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > @@ -3,7 +3,14 @@ > > * Copyright (c) 2015 MediaTek Inc. > > */ > > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > inline struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw > > *hw) > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > index 8d32e9027a15..4eb5fc91e083 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > @@ -7,16 +7,10 @@ > > #ifndef _MTK_MIPI_TX_H > > #define _MTK_MIPI_TX_H > > > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > #include > > -#include > > > I don't think it's good idea to move the common headers into .c files Header files should be included directly by the file that uses facilities provided by said header file. Required ones should not be transitively included through other header files, as that introduces a subtle dependency. Also, needlessly including header files in places that aren't using them increases build time. See the 2000+ patch series from Ingo Molnar [1] increasing build performance by cleaning up header files. ChenYu [1] https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ > > struct mtk_mipitx_data { > > const u32 mppll_preserve; > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek -- linux-phy mailing list linux-phy@lists.infradead.org https://lists.infradead.org/mailman/listinfo/linux-phy From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC381C433EF for ; Fri, 7 Jan 2022 03:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=EVEyFQjRsP/ND9yFUU5P8eIKYvyVWWa9wCTr+LeXtTU=; b=iB9b8jRkEhrfQ5 3Yq9B4BeyEXKlvIM8o9hV3XggISDuTn0Cxravx+H0fO0SV3R6uIgtRelWLEWgpEag9iIz2qURmfi1 IifzfqT6m7PGHnjvcDrb9NmqJWqcQUm3xA+zcS9nVFHfg+utkeanJ/aaNaXNl2HMQJ+ri4iaGx72/ vc2B+DJk2zPXd4gR8nZhTIKRvOc635wviFq9koqJw5eGeWCqlTD7VDmJ4FomeJPvmTtvSmrJ8xdZw Q4O6TmJC2dTqVmZ79rVgZdO5l0HNSuIKGbZYAnKwjMFSed4vDHALS5zsUW148Paq2uyMR+vIgoCLl Tw0XVzgzi0G4Nw0E/1EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOH-002Cuf-9k; Fri, 07 Jan 2022 03:58:09 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5gOB-002Cry-1H for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 03:58:06 +0000 Received: by mail-lf1-x12d.google.com with SMTP id r4so10982739lfe.7 for ; Thu, 06 Jan 2022 19:58:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=Ct5qh0NnIjgjBBI8xvXdVNKrKFDmuJqDQ6lk+nREa2ajHPDsDrFmIqTCK/ih45n/+i MxVvKQX4wxPd/KqFTbXeaMVUspFFe2zOFPIHwD8+X/hDyeWjkxKrw/miIwgpNC8CyAQY dWpmeQvSJ9tTMcsSrDml7yTQw1BbaBypeNN3U= 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=xKNMJyJbEEL5q9peHIeW1VWZHuVFJtpU7pIceN/pwjU=; b=6K+vaB3nflN14IQza+pOyIPj204MutgS3jw/W8z9Rlw4Vt4l02DCHtVdBDpGtD6jSO Gmwxp4e5UkNKGV89VrdKM5feVwvEuXahSDWXOMqaIx02uFpO6GCgcCLvxBmzr80X3Cmk tL3KvZRtbI6quddQasr70FLOoeMwQRx0a5AC71uREvOH6cR0yK3iH+hFD7118QJk3yHB 3cmZTDOjMYXECE/ynKWXaVuvBFM53pLgxUknizX6/6itfTpcSmp1RX0sVE0iGdZj3Pmd kqg984Kt+j3xnCUyZlAfKSqMTzCs9YZ1LEufC1A+p8wX7AJ/X9qpdrGwSp5S5AlTkpqV CvCQ== X-Gm-Message-State: AOAM531plk7qK8WxdEjM86WqjbKRfMfyH2DqrQ6aP2kmWzi0Icd1Z1Sr sbBLiZEmOV407VDvTHdT9h6e8rYrRLnq03V1Jxm4Rg== X-Google-Smtp-Source: ABdhPJwB2LOLwXDSwFYbn94VKmzms3kaczzZBBcQQ0Iamv202Lew+ehb6NgWIJQfYAZCzjaWayYDS1PcdtAvATpbHog= X-Received: by 2002:a2e:b8cd:: with SMTP id s13mr43356738ljp.201.1641527880239; Thu, 06 Jan 2022 19:58:00 -0800 (PST) MIME-Version: 1.0 References: <20220103145324.48008-1-angelogioacchino.delregno@collabora.com> <20220103145324.48008-2-angelogioacchino.delregno@collabora.com> <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> In-Reply-To: <509b82079256ffaa0d844ae5a79a436fced16f3f.camel@mediatek.com> From: Chen-Yu Tsai Date: Fri, 7 Jan 2022 11:57:49 +0800 Message-ID: Subject: Re: [PATCH 2/3] phy: mediatek: phy-mtk-mipi-dsi: Reorder and stop implicit header inclusion To: Chunfeng Yun Cc: AngeloGioacchino Del Regno , chunkuang.hu@kernel.org, p.zabel@pengutronix.de, kishon@ti.com, vkoul@kernel.org, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_195803_126578_0918534C X-CRM114-Status: GOOD ( 25.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Jan 6, 2022 at 4:48 PM Chunfeng Yun wrote: > > On Mon, 2022-01-03 at 15:53 +0100, AngeloGioacchino Del Regno wrote: > > All the headers for phy-mtk-mipi-{dsi,dsi-mt8173,dsi-mt8183}.c were > > included from phy-mtk-mipi-dsi.h, but this isn't optimal: in order to > > increase readability and sensibly reduce build times, the inclusions > > should be done per-file, also avoiding to include unused headers and > > should not be implicit. > > > > For this reason, move the inclusions to each file and remove unused > > ones. > > > > Signed-off-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > --- > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c | 4 ++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.c | 7 +++++++ > > drivers/phy/mediatek/phy-mtk-mipi-dsi.h | 10 ++-------- > > 4 files changed, 17 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > index 95a0d9a3cca7..59f028da9d3e 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8173.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_DSI_CON 0x00 > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > index 01b59527669e..6c6b192485ba 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi-mt8183.c > > @@ -4,7 +4,11 @@ > > * Author: jitao.shi > > */ > > > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > #define MIPITX_LANE_CON 0x000c > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > index 51b1b1d4ad38..6f7425b0bf5b 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.c > > @@ -3,7 +3,14 @@ > > * Copyright (c) 2015 MediaTek Inc. > > */ > > > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > #include > > +#include > > #include "phy-mtk-mipi-dsi.h" > > > > inline struct mtk_mipi_tx *mtk_mipi_tx_from_clk_hw(struct clk_hw > > *hw) > > diff --git a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > index 8d32e9027a15..4eb5fc91e083 100644 > > --- a/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > +++ b/drivers/phy/mediatek/phy-mtk-mipi-dsi.h > > @@ -7,16 +7,10 @@ > > #ifndef _MTK_MIPI_TX_H > > #define _MTK_MIPI_TX_H > > > > -#include > > #include > > -#include > > -#include > > -#include > > -#include > > -#include > > -#include > > +#include > > +#include > > #include > > -#include > > > I don't think it's good idea to move the common headers into .c files Header files should be included directly by the file that uses facilities provided by said header file. Required ones should not be transitively included through other header files, as that introduces a subtle dependency. Also, needlessly including header files in places that aren't using them increases build time. See the 2000+ patch series from Ingo Molnar [1] increasing build performance by cleaning up header files. ChenYu [1] https://lwn.net/ml/linux-kernel/YdIfz+LMewetSaEB@gmail.com/ > > struct mtk_mipitx_data { > > const u32 mppll_preserve; > _______________________________________________ > Linux-mediatek mailing list > Linux-mediatek@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-mediatek _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel