lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DM6PR02MB522730A32310C1CBB2971B61C1010@DM6PR02MB5227.namprd02.prod.outlook.com>
Date:   Thu, 6 Sep 2018 15:53:54 +0000
From:   Manish Narani <MNARANI@...inx.com>
To:     Borislav Petkov <bp@...en8.de>
CC:     "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        Michal Simek <michals@...inx.com>,
        "mchehab@...nel.org" <mchehab@...nel.org>,
        "leoyang.li@....com" <leoyang.li@....com>,
        "amit.kucheria@...aro.org" <amit.kucheria@...aro.org>,
        "olof@...om.net" <olof@...om.net>,
        Srinivas Goud <sgoud@...inx.com>,
        Anirudha Sarangi <anirudh@...inx.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>
Subject: RE: [PATCH v5 1/4] edac: synps: Add platform specific structures for
 ddrc controller

Hi Boris,

Thanks a lot for the review. Please see my comments inline.

> -----Original Message-----
> From: Borislav Petkov [mailto:bp@...en8.de]
> Sent: Tuesday, September 4, 2018 10:28 PM
> To: Manish Narani <MNARANI@...inx.com>
> Cc: robh+dt@...nel.org; mark.rutland@....com; Michal Simek
> <michals@...inx.com>; mchehab@...nel.org; leoyang.li@....com;
> amit.kucheria@...aro.org; olof@...om.net; Srinivas Goud <sgoud@...inx.com>;
> Anirudha Sarangi <anirudh@...inx.com>; linux-kernel@...r.kernel.org;
> devicetree@...r.kernel.org; linux-arm-kernel@...ts.infradead.org; linux-
> edac@...r.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@...inx.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ