Commit 1b51adc6 authored by Manish Narani's avatar Manish Narani Committed by Borislav Petkov

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: default avatarManish Narani <manish.narani@xilinx.com>
Signed-off-by: default avatarBorislav 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
parent 65102238
...@@ -172,7 +172,7 @@ static int synps_edac_geterror_info(void __iomem *base, ...@@ -172,7 +172,7 @@ static int synps_edac_geterror_info(void __iomem *base,
p->ceinfo.col = regval & ADDR_COL_MASK; p->ceinfo.col = regval & ADDR_COL_MASK;
p->ceinfo.bank = (regval & ADDR_BANK_MASK) >> ADDR_BANK_SHIFT; p->ceinfo.bank = (regval & ADDR_BANK_MASK) >> ADDR_BANK_SHIFT;
p->ceinfo.data = readl(base + CE_DATA_31_0_OFST); 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); p->ceinfo.data);
clearval = ECC_CTRL_CLR_CE_ERR; clearval = ECC_CTRL_CLR_CE_ERR;
...@@ -250,7 +250,7 @@ static void synps_edac_check(struct mem_ctl_info *mci) ...@@ -250,7 +250,7 @@ static void synps_edac_check(struct mem_ctl_info *mci)
priv->ue_cnt += priv->stat.ue_cnt; priv->ue_cnt += priv->stat.ue_cnt;
synps_edac_handle_error(mci, &priv->stat); 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); priv->ce_cnt, priv->ue_cnt);
} }
...@@ -295,9 +295,9 @@ static enum dev_type synps_edac_get_dtype(const void __iomem *base) ...@@ -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) static bool synps_edac_get_eccstate(void __iomem *base)
{ {
bool state = false;
enum dev_type dt; enum dev_type dt;
u32 ecctype; u32 ecctype;
bool state = false;
dt = synps_edac_get_dtype(base); dt = synps_edac_get_dtype(base);
if (dt == DEV_UNKNOWN) if (dt == DEV_UNKNOWN)
...@@ -359,11 +359,11 @@ static enum mem_type synps_edac_get_mtype(const void __iomem *base) ...@@ -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) static int synps_edac_init_csrows(struct mem_ctl_info *mci)
{ {
struct synps_edac_priv *priv = mci->pvt_info;
struct csrow_info *csi; struct csrow_info *csi;
struct dimm_info *dimm; struct dimm_info *dimm;
struct synps_edac_priv *priv = mci->pvt_info; u32 size, row;
u32 size; int j;
int row, j;
for (row = 0; row < mci->nr_csrows; row++) { for (row = 0; row < mci->nr_csrows; row++) {
csi = mci->csrows[row]; csi = mci->csrows[row];
...@@ -434,12 +434,12 @@ static int synps_edac_mc_init(struct mem_ctl_info *mci, ...@@ -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) static int synps_edac_mc_probe(struct platform_device *pdev)
{ {
struct mem_ctl_info *mci;
struct edac_mc_layer layers[2]; struct edac_mc_layer layers[2];
struct synps_edac_priv *priv; struct synps_edac_priv *priv;
int rc; struct mem_ctl_info *mci;
struct resource *res;
void __iomem *baseaddr; void __iomem *baseaddr;
struct resource *res;
int rc;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
baseaddr = devm_ioremap_resource(&pdev->dev, res); baseaddr = devm_ioremap_resource(&pdev->dev, res);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment