2014-12-19 18:21:17

by Soren Brinkmann

[permalink] [raw]
Subject: [PATCH 1/3] microblaze: intc: Don't override error codes

Just pass on error codes instead of overriding them.

Signed-off-by: Soren Brinkmann <[email protected]>
---
arch/microblaze/kernel/intc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index 15c7c12ea0e7..01ae73088578 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -148,13 +148,13 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &nr_irq);
if (ret < 0) {
pr_err("%s: unable to read xlnx,num-intr-inputs\n", __func__);
- return -EINVAL;
+ return ret;
}

ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &intr_mask);
if (ret < 0) {
pr_err("%s: unable to read xlnx,kind-of-intr\n", __func__);
- return -EINVAL;
+ return ret;
}

if (intr_mask > (u32)((1ULL << nr_irq) - 1))
--
2.2.0.1.g9ee0458


2014-12-19 18:21:22

by Soren Brinkmann

[permalink] [raw]
Subject: [PATCH 2/3] microblaze: intc: Refactor DT sanity check

Avoid funky casts and arithmetic.

Signed-off-by: Soren Brinkmann <[email protected]>
---
arch/microblaze/kernel/intc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index 01ae73088578..8965fd379570 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -157,7 +157,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
return ret;
}

- if (intr_mask > (u32)((1ULL << nr_irq) - 1))
+ if (intr_mask >> nr_irq)
pr_info(" ERROR: Mismatch in kind-of-intr param\n");

pr_info("%s: num_irq=%d, edge=0x%x\n",
--
2.2.0.1.g9ee0458

2014-12-19 18:21:32

by Soren Brinkmann

[permalink] [raw]
Subject: [PATCH 3/3] microblaze: intc: Reformat output

A message was using pr_info level output for a message including "ERROR"
which is not really a fatal error.
Remove the 'ERROR' from that message, use pr_warn loglevel and add the
function name to the output to give users a chance to find the culprit
in case the warning triggers.

Signed-off-by: Soren Brinkmann <[email protected]>
---
arch/microblaze/kernel/intc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/microblaze/kernel/intc.c b/arch/microblaze/kernel/intc.c
index 8965fd379570..719feee1e043 100644
--- a/arch/microblaze/kernel/intc.c
+++ b/arch/microblaze/kernel/intc.c
@@ -158,7 +158,7 @@ static int __init xilinx_intc_of_init(struct device_node *intc,
}

if (intr_mask >> nr_irq)
- pr_info(" ERROR: Mismatch in kind-of-intr param\n");
+ pr_warn("%s: mismatch in kind-of-intr param\n", __func__);

pr_info("%s: num_irq=%d, edge=0x%x\n",
intc->full_name, nr_irq, intr_mask);
--
2.2.0.1.g9ee0458