[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230921135844.GJ1487598@hu-bjorande-lv.qualcomm.com>
Date: Thu, 21 Sep 2023 06:58:44 -0700
From: Bjorn Andersson <quic_bjorande@...cinc.com>
To: Manivannan Sadhasivam <mani@...nel.org>
CC: Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
Can Guo <quic_cang@...cinc.com>, <quic_nguyenb@...cinc.com>,
<quic_nitirawa@...cinc.com>, <martin.petersen@...cle.com>,
<linux-scsi@...r.kernel.org>, Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
Vinod Koul <vkoul@...nel.org>,
Kishon Vijay Abraham I <kishon@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
open list <linux-kernel@...r.kernel.org>,
"open list:ARM/QUALCOMM SUPPORT" <linux-arm-msm@...r.kernel.org>,
"open list:GENERIC PHY FRAMEWORK" <linux-phy@...ts.infradead.org>
Subject: Re: [PATCH 4/6] phy: qualcomm: phy-qcom-qmp-ufs: Move data structs
and setting tables to header
On Tue, Sep 19, 2023 at 02:15:24PM +0200, Manivannan Sadhasivam wrote:
> On Thu, Sep 14, 2023 at 03:28:59PM +0300, Dmitry Baryshkov wrote:
> > On Mon, 11 Sept 2023 at 09:01, Can Guo <quic_cang@...cinc.com> wrote:
> > >
> > > To make the code more readable, move the data structs and PHY settting
> > > tables to a header file, namely the phy-qcom-qmp-ufs.h.
> > >
> > > Signed-off-by: Can Guo <quic_cang@...cinc.com>
> > > ---
> > > drivers/phy/qualcomm/phy-qcom-qmp-ufs.c | 802 +------------------------------
> > > drivers/phy/qualcomm/phy-qcom-qmp-ufs.h | 805 ++++++++++++++++++++++++++++++++
> > > 2 files changed, 806 insertions(+), 801 deletions(-)
> > > create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-ufs.h
> >
> > Is there any reason to do so? Other than just moving stuff around, it
> > doesn't give us anything. This header will not be shared with any
> > other driver. Just moving data tables to the header (ugh, static data
> > in the header) doesn't make code more readable.
> >
>
> I think the motive here is to move the static tables to one file and have the
> rest of the code in another. Because, the static tables itself occupy 1.2k LoC
> now and it is going to grow. So let's keep them in a single file to avoid mixing
> it with rest of the driver code.
>
To me, the problem with the current layout is that we have:
* structures
* data
* structures
* implementation
So to find the second structures you need to jump somewhere in the
middle of the file. If we shift those up, it's easy to jump between the
three portions of the file.
Regards,
Bjorn
Powered by blists - more mailing lists