EDAC, synopsys: Improve code readability

Clean up the driver code. Update the debug messages for EDAC errors
reported. Increase the indentation of the macros for better readability.

Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
CC: Mauro Carvalho Chehab <mchehab@kernel.org>
CC: Michal Simek <michal.simek@xilinx.com>
CC: amit.kucheria@linaro.org
CC: devicetree@vger.kernel.org
CC: leoyang.li@nxp.com
CC: linux-arm-kernel@lists.infradead.org
CC: linux-edac <linux-edac@vger.kernel.org>
CC: manish.narani@xilinx.com
CC: mark.rutland@arm.com
CC: mchehab@kernel.org
CC: michal.simek@xilinx.com
CC: robh+dt@kernel.org
CC: sudeep.holla@arm.com
Link: http://lkml.kernel.org/r/1538667328-9465-2-git-send-email-manish.narani@xilinx.com
This commit is contained in:
Manish Narani 2018-10-04 21:05:19 +05:30 committed by Borislav Petkov
parent 651022382c
commit 1b51adc6b7
1 changed files with 52 additions and 52 deletions

View File

@ -172,7 +172,7 @@ static int synps_edac_geterror_info(void __iomem *base,
p->ceinfo.col = regval & ADDR_COL_MASK;
p->ceinfo.bank = (regval & ADDR_BANK_MASK) >> ADDR_BANK_SHIFT;
p->ceinfo.data = readl(base + CE_DATA_31_0_OFST);
edac_dbg(3, "ce bit position: %d data: %d\n", p->ceinfo.bitpos,
edac_dbg(3, "CE bit position: %d data: %d\n", p->ceinfo.bitpos,
p->ceinfo.data);
clearval = ECC_CTRL_CLR_CE_ERR;
@ -250,7 +250,7 @@ static void synps_edac_check(struct mem_ctl_info *mci)
priv->ue_cnt += priv->stat.ue_cnt;
synps_edac_handle_error(mci, &priv->stat);
edac_dbg(3, "Total error count ce %d ue %d\n",
edac_dbg(3, "Total error count CE %d UE %d\n",
priv->ce_cnt, priv->ue_cnt);
}
@ -295,9 +295,9 @@ static enum dev_type synps_edac_get_dtype(const void __iomem *base)
*/
static bool synps_edac_get_eccstate(void __iomem *base)
{
bool state = false;
enum dev_type dt;
u32 ecctype;
bool state = false;
dt = synps_edac_get_dtype(base);
if (dt == DEV_UNKNOWN)
@ -359,11 +359,11 @@ static enum mem_type synps_edac_get_mtype(const void __iomem *base)
*/
static int synps_edac_init_csrows(struct mem_ctl_info *mci)
{
struct synps_edac_priv *priv = mci->pvt_info;
struct csrow_info *csi;
struct dimm_info *dimm;
struct synps_edac_priv *priv = mci->pvt_info;
u32 size;
int row, j;
u32 size, row;
int j;
for (row = 0; row < mci->nr_csrows; row++) {
csi = mci->csrows[row];
@ -434,12 +434,12 @@ static int synps_edac_mc_init(struct mem_ctl_info *mci,
*/
static int synps_edac_mc_probe(struct platform_device *pdev)
{
struct mem_ctl_info *mci;
struct edac_mc_layer layers[2];
struct synps_edac_priv *priv;
int rc;
struct resource *res;
struct mem_ctl_info *mci;
void __iomem *baseaddr;
struct resource *res;
int rc;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
baseaddr = devm_ioremap_resource(&pdev->dev, res);