From: Manish Narani <MNARANI@xilinx.com>
To: Borislav Petkov <bp@alien8.de>
Cc: "robh+dt@kernel.org" <robh+dt@kernel.org>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
Michal Simek <michals@xilinx.com>,
"mchehab@kernel.org" <mchehab@kernel.org>,
"leoyang.li@nxp.com" <leoyang.li@nxp.com>,
"amit.kucheria@linaro.org" <amit.kucheria@linaro.org>,
"olof@lixom.net" <olof@lixom.net>,
Srinivas Goud <sgoud@xilinx.com>,
Anirudha Sarangi <anirudh@xilinx.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>
Subject: RE: [PATCH v5 1/4] edac: synps: Add platform specific structures for ddrc controller
Date: Thu, 6 Sep 2018 15:53:54 +0000 [thread overview]
Message-ID: <DM6PR02MB522730A32310C1CBB2971B61C1010@DM6PR02MB5227.namprd02.prod.outlook.com> (raw)
In-Reply-To: <20180904165828.GM32615@zn.tnic>
Hi Boris,
Thanks a lot for the review. Please see my comments inline.
> -----Original Message-----
> From: Borislav Petkov [mailto:bp@alien8.de]
> Sent: Tuesday, September 4, 2018 10:28 PM
> To: Manish Narani <MNARANI@xilinx.com>
> Cc: robh+dt@kernel.org; mark.rutland@arm.com; Michal Simek
> <michals@xilinx.com>; mchehab@kernel.org; leoyang.li@nxp.com;
> amit.kucheria@linaro.org; olof@lixom.net; Srinivas Goud <sgoud@xilinx.com>;
> Anirudha Sarangi <anirudh@xilinx.com>; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org; linux-
> edac@vger.kernel.org
> Subject: Re: [PATCH v5 1/4] edac: synps: Add platform specific structures for
> ddrc controller
>
> On Fri, Aug 31, 2018 at 06:57:47PM +0530, Manish Narani wrote:
> > Add platform specific structures, so that we can add different IP
> > support later using quirks.
> >
> > Signed-off-by: Manish Narani <manish.narani@xilinx.com>
> > ---
> > drivers/edac/synopsys_edac.c | 78
> > +++++++++++++++++++++++++++++++++-----------
> > 1 file changed, 59 insertions(+), 19 deletions(-)
> >
> > diff --git a/drivers/edac/synopsys_edac.c
> > b/drivers/edac/synopsys_edac.c index 0c9c59e..2470d35 100644
> > --- a/drivers/edac/synopsys_edac.c
> > +++ b/drivers/edac/synopsys_edac.c
> >
> > /**
> > + * struct synps_platform_data - synps platform data structure
> > + * @edac_geterror_info: function pointer to synps edac error info
> > + * @edac_get_mtype: function pointer to synps edac mtype
> > + * @edac_get_dtype: function pointer to synps edac dtype
> > + * @edac_get_eccstate: function pointer to synps edac eccstate
> > + * @quirks: to differentiate IPs
>
> Kill all that "function pointer" fluff. Here's how I've changed it:
>
> /**
> * struct synps_platform_data - synps platform data structure
> * @edac_geterror_info: edac error info
> * @edac_get_mtype: get mtype
> * @edac_get_dtype: get dtype
> * @edac_get_eccstate: get ECC state
> * @quirks: to differentiate IPs
> */
>
> Shorter, quicker to read/scan/etc...
Okay. I will update this way throughout all the patches.
>
> > +/**
> > * synps_edac_geterror_info - Get the current ecc error info
> > - * @base: Pointer to the base address of the ddr memory controller
> > - * @p: Pointer to the synopsys ecc status structure
> > + * @priv: Pointer to DDR memory controller private instance data
> > *
> > * Determines there is any ecc error or not
>
> All sentences end with a fullstop. Check all your patches.
Okay.
>
> Also, it is not "ecc" it is "ECC". Also go over all your patches.
Okay. I updated this in (3/4), but I will update this as a separate patch in v6.
>
> > *
> > * Return: one if there is no error otherwise returns zero
> > */
> > -static int synps_edac_geterror_info(void __iomem *base,
> > - struct synps_ecc_status *p)
> > +static int synps_edac_geterror_info(struct synps_edac_priv *priv)
> > {
> > + void __iomem *base;
> > + struct synps_ecc_status *p;
> > u32 regval, clearval = 0;
>
> Please sort function local variables declaration in a reverse christmas tree
> order:
>
> <type> longest_variable_name;
> <type> shorter_var_name;
> <type> even_shorter;
> <type> i;
>
Okay.
> >
> > + if (!priv)
> > + return 1;
>
> Why are you even checking this here?
>
> synps_edac_check() is merrily dereferencing it - if anything we will explode
> there already.
Okay. I will remove this in v6.
>
> >
> > @@ -370,12 +398,12 @@ static int synps_edac_init_csrows(struct
> > mem_ctl_info *mci)
>
> That function returns 0 unconditionally. Make it a void in a prepatch.
Sure.
>
> > - if (!synps_edac_get_eccstate(baseaddr)) {
> > + p_data = of_device_get_match_data(&pdev->dev);
> > + if (!(p_data->edac_get_eccstate(baseaddr))) {
>
> Too many parentheses:
>
> if (!p_data->...
>
> is enough.
Okay.
Thanks,
Manish Narani
next prev parent reply other threads:[~2018-09-06 15:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 13:27 [PATCH v5 0/4] EDAC: Enhancements to Synopsys EDAC driver Manish Narani
2018-08-31 13:27 ` [PATCH v5 1/4] edac: synps: Add platform specific structures for ddrc controller Manish Narani
2018-09-04 16:58 ` Borislav Petkov
2018-09-06 15:53 ` Manish Narani [this message]
2018-08-31 13:27 ` [PATCH v5 2/4] dt: bindings: Document ZynqMP DDRC in Synopsys documentation Manish Narani
2018-09-04 14:16 ` Rob Herring
2018-09-06 15:21 ` Manish Narani
2018-08-31 13:27 ` [PATCH v5 3/4] edac: synopsys: Add EDAC ECC support for ZynqMP DDRC Manish Narani
2018-09-05 10:19 ` Borislav Petkov
2018-09-06 16:14 ` Manish Narani
2018-08-31 13:27 ` [PATCH v5 4/4] arm64: zynqmp: Add DDRC node Manish Narani
2018-09-05 10:20 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DM6PR02MB522730A32310C1CBB2971B61C1010@DM6PR02MB5227.namprd02.prod.outlook.com \
--to=mnarani@xilinx.com \
--cc=amit.kucheria@linaro.org \
--cc=anirudh@xilinx.com \
--cc=bp@alien8.de \
--cc=devicetree@vger.kernel.org \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=michals@xilinx.com \
--cc=olof@lixom.net \
--cc=robh+dt@kernel.org \
--cc=sgoud@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).