Skip to content

Commit

Permalink
OMAP3/4: l3: minor cleanup for parenthesis and extra spaces
Browse files Browse the repository at this point in the history
Removing extra lines, spaces and unneeded parenthesis.
Collapsing an if statement to detect the type of error.

l3_smx:
- Fixing the message printed on error.

So now: 				looks like:
"No Error Error seen..."		"No Error seen..."
"In-Band Error Error seen..."	"In-Band Error seen..."

Other messages are self explanatory, no "Error" added to them.
(E.g.: "Address Hole seen...")

Signed-off-by: Omar Ramirez Luna <omar.ramirez@ti.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
omar ramirez authored and Tony Lindgren committed May 3, 2011
1 parent 7529b70 commit 35f7b96
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 24 deletions.
17 changes: 7 additions & 10 deletions arch/arm/mach-omap2/omap_l3_noc.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)
char *source_name;

/* Get the Type of interrupt */
if (irq == l3->app_irq)
inttype = L3_APPLICATION_ERROR;
else
inttype = L3_DEBUG_ERROR;
inttype = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;

for (i = 0; i < L3_MODULES; i++) {
/*
Expand All @@ -84,10 +81,10 @@ static irqreturn_t l3_interrupt_handler(int irq, void *_l3)

err_src = j;
/* Read the stderrlog_main_source from clk domain */
std_err_main_addr = base + (*(l3_targ[i] + err_src));
std_err_main = readl(std_err_main_addr);
std_err_main_addr = base + *(l3_targ[i] + err_src);
std_err_main = readl(std_err_main_addr);

switch ((std_err_main & CUSTOM_ERROR)) {
switch (std_err_main & CUSTOM_ERROR) {
case STANDARD_ERROR:
source_name =
l3_targ_stderrlog_main_name[i][err_src];
Expand Down Expand Up @@ -143,7 +140,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
}

l3->l3_base[0] = ioremap(res->start, resource_size(res));
if (!(l3->l3_base[0])) {
if (!l3->l3_base[0]) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err0;
Expand All @@ -157,7 +154,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
}

l3->l3_base[1] = ioremap(res->start, resource_size(res));
if (!(l3->l3_base[1])) {
if (!l3->l3_base[1]) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err1;
Expand All @@ -171,7 +168,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
}

l3->l3_base[2] = ioremap(res->start, resource_size(res));
if (!(l3->l3_base[2])) {
if (!l3->l3_base[2]) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err2;
Expand Down
19 changes: 5 additions & 14 deletions arch/arm/mach-omap2/omap_l3_smx.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
u8 multi = error & L3_ERROR_LOG_MULTI;
u32 address = omap3_l3_decode_addr(error_addr);

WARN(true, "%s Error seen by %s %s at address %x\n",
WARN(true, "%s seen by %s %s at address %x\n",
omap3_l3_code_string(code),
omap3_l3_initiator_string(initid),
multi ? "Multiple Errors" : "",
Expand All @@ -167,21 +167,15 @@ static irqreturn_t omap3_l3_block_irq(struct omap3_l3 *l3,
static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
{
struct omap3_l3 *l3 = _l3;

u64 status, clear;
u64 error;
u64 error_addr;
u64 err_source = 0;
void __iomem *base;
int int_type;

irqreturn_t ret = IRQ_NONE;

if (irq == l3->app_irq)
int_type = L3_APPLICATION_ERROR;
else
int_type = L3_DEBUG_ERROR;

int_type = irq == l3->app_irq ? L3_APPLICATION_ERROR : L3_DEBUG_ERROR;
if (!int_type) {
status = omap3_l3_readll(l3->rt, L3_SI_FLAG_STATUS_0);
/*
Expand All @@ -202,17 +196,15 @@ static irqreturn_t omap3_l3_app_irq(int irq, void *_l3)
for (err_source = 0; !(status & (1 << err_source)); err_source++)
;
error = omap3_l3_readll(base, L3_ERROR_LOG);

if (error) {
error_addr = omap3_l3_readll(base, L3_ERROR_LOG_ADDR);

ret |= omap3_l3_block_irq(l3, error, error_addr);
}

/* Clear the status register */
clear = ((L3_AGENT_STATUS_CLEAR_IA << int_type) |
(L3_AGENT_STATUS_CLEAR_TA));

clear = (L3_AGENT_STATUS_CLEAR_IA << int_type) |
L3_AGENT_STATUS_CLEAR_TA;
omap3_l3_writell(base, L3_AGENT_STATUS, clear);

/* clear the error log register */
Expand Down Expand Up @@ -240,7 +232,7 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
goto err0;
}
l3->rt = ioremap(res->start, resource_size(res));
if (!(l3->rt)) {
if (!l3->rt) {
dev_err(&pdev->dev, "ioremap failed\n");
ret = -ENOMEM;
goto err0;
Expand All @@ -259,7 +251,6 @@ static int __init omap3_l3_probe(struct platform_device *pdev)
ret = request_irq(l3->app_irq, omap3_l3_app_irq,
IRQF_DISABLED | IRQF_TRIGGER_RISING,
"l3-app-irq", l3);

if (ret) {
dev_err(&pdev->dev, "couldn't request app irq\n");
goto err2;
Expand Down

0 comments on commit 35f7b96

Please sign in to comment.