aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/sh/kernel/cpu/irq/intc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/sh/kernel/cpu/irq/intc.c b/arch/sh/kernel/cpu/irq/intc.c
index 8c70e201bde0..94536d358fe1 100644
--- a/arch/sh/kernel/cpu/irq/intc.c
+++ b/arch/sh/kernel/cpu/irq/intc.c
@@ -464,9 +464,10 @@ static unsigned int __init intc_prio_data(struct intc_desc *desc,
464 } 464 }
465 465
466 fn += (pr->reg_width >> 3) - 1; 466 fn += (pr->reg_width >> 3) - 1;
467 bit = pr->reg_width - ((j + 1) * pr->field_width);
468 467
469 BUG_ON(bit < 0); 468 BUG_ON((j + 1) * pr->field_width > pr->reg_width);
469
470 bit = pr->reg_width - ((j + 1) * pr->field_width);
470 471
471 return _INTC_MK(fn, mode, 472 return _INTC_MK(fn, mode,
472 intc_get_reg(d, reg_e), 473 intc_get_reg(d, reg_e),
@@ -531,9 +532,10 @@ static unsigned int __init intc_sense_data(struct intc_desc *desc,
531 532
532 fn = REG_FN_MODIFY_BASE; 533 fn = REG_FN_MODIFY_BASE;
533 fn += (sr->reg_width >> 3) - 1; 534 fn += (sr->reg_width >> 3) - 1;
534 bit = sr->reg_width - ((j + 1) * sr->field_width);
535 535
536 BUG_ON(bit < 0); 536 BUG_ON((j + 1) * sr->field_width > sr->reg_width);
537
538 bit = sr->reg_width - ((j + 1) * sr->field_width);
537 539
538 return _INTC_MK(fn, 0, intc_get_reg(d, sr->reg), 540 return _INTC_MK(fn, 0, intc_get_reg(d, sr->reg),
539 0, sr->field_width, bit); 541 0, sr->field_width, bit);