From d30383ee7ff7006955d09c452e60d3b1ef1a482b Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Tue, 26 Nov 2002 05:19:25 -0800 Subject: [PATCH] [PATCH] Fix some minor type problems in v850 code Fix some minor type problems in v850 code [Mostly signed/unsigned mismatches] --- arch/v850/kernel/gbus_int.c | 8 ++++---- arch/v850/kernel/nb85e_intc.c | 2 +- arch/v850/kernel/nb85e_utils.c | 6 +++--- arch/v850/kernel/rte_cb.c | 8 ++++---- arch/v850/kernel/rte_mb_a_pci.c | 2 +- arch/v850/kernel/signal.c | 7 ++++--- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/arch/v850/kernel/gbus_int.c b/arch/v850/kernel/gbus_int.c index 0b9f796455f6..a1b659ec4e43 100644 --- a/arch/v850/kernel/gbus_int.c +++ b/arch/v850/kernel/gbus_int.c @@ -183,7 +183,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits, { struct gbus_int_irq_init *init; for (init = inits; init->name; init++) { - int i; + unsigned i; struct hw_interrupt_type *hwit = hw_irq_types++; hwit->typename = init->name; @@ -200,7 +200,7 @@ void __init gbus_int_init_irq_types (struct gbus_int_irq_init *inits, /* Set the interrupt priorities. */ for (i = 0; i < init->num; i++) { - int j; + unsigned j; for (j = 0; j < NUM_USED_GINTS; j++) if (used_gint[j].priority > init->priority) break; @@ -222,7 +222,7 @@ static struct hw_interrupt_type gint_hw_itypes[NUM_USED_GINTS]; /* GBUS interrupts themselves. */ -__init struct gbus_int_irq_init gbus_irq_inits[] = { +struct gbus_int_irq_init gbus_irq_inits[] __initdata = { /* First set defaults. */ { "GBUS_INT", IRQ_GBUS_INT(0), IRQ_GBUS_INT_NUM, 1, 6}, { 0 } @@ -236,7 +236,7 @@ static struct hw_interrupt_type gbus_hw_itypes[NUM_GBUS_IRQ_INITS]; /* Initialize GBUS interrupts. */ void __init gbus_int_init_irqs (void) { - int i; + unsigned i; /* First initialize the shared gint interrupts. */ for (i = 0; i < NUM_USED_GINTS; i++) { diff --git a/arch/v850/kernel/nb85e_intc.c b/arch/v850/kernel/nb85e_intc.c index 98177c1f8c5f..daa543f5e94e 100644 --- a/arch/v850/kernel/nb85e_intc.c +++ b/arch/v850/kernel/nb85e_intc.c @@ -33,7 +33,7 @@ void __init nb85e_intc_init_irq_types (struct nb85e_intc_irq_init *inits, { struct nb85e_intc_irq_init *init; for (init = inits; init->name; init++) { - int i; + unsigned i; struct hw_interrupt_type *hwit = hw_irq_types++; hwit->typename = init->name; diff --git a/arch/v850/kernel/nb85e_utils.c b/arch/v850/kernel/nb85e_utils.c index 1e6ddcf2d104..e826cb76d177 100644 --- a/arch/v850/kernel/nb85e_utils.c +++ b/arch/v850/kernel/nb85e_utils.c @@ -2,8 +2,8 @@ * include/asm-v850/nb85e_utils.h -- Utility functions associated with * the NB85E cpu core * - * Copyright (C) 2001 NEC Corporation - * Copyright (C) 2001 Miles Bader + * Copyright (C) 2001,02 NEC Corporation + * Copyright (C) 2001,02 Miles Bader * * This file is subject to the terms and conditions of the GNU General * Public License. See the file COPYING in the main directory of this @@ -40,7 +40,7 @@ int calc_counter_params (unsigned long base_freq, /* Find the lowest clock divider setting that can represent RATE. */ for (_divlog2 = min_divlog2; _divlog2 <= max_divlog2; _divlog2++) { /* Minimum interrupt rate possible using this divider. */ - int min_int_rate + unsigned min_int_rate = (base_freq >> _divlog2) >> counter_size; if (min_int_rate <= rate) { diff --git a/arch/v850/kernel/rte_cb.c b/arch/v850/kernel/rte_cb.c index 8f35e93e6974..cea7be3eecb1 100644 --- a/arch/v850/kernel/rte_cb.c +++ b/arch/v850/kernel/rte_cb.c @@ -61,10 +61,10 @@ void __init mach_early_init (void) void __init mach_setup (char **cmdline) { /* Probe for Mother-A, and print a message if we find it. */ - *(volatile long *)MB_A_SRAM_ADDR = 0xDEADBEEF; - if (*(volatile long *)MB_A_SRAM_ADDR == 0xDEADBEEF) { - *(volatile long *)MB_A_SRAM_ADDR = 0x12345678; - if (*(volatile long *)MB_A_SRAM_ADDR == 0x12345678) + *(volatile unsigned long *)MB_A_SRAM_ADDR = 0xDEADBEEF; + if (*(volatile unsigned long *)MB_A_SRAM_ADDR == 0xDEADBEEF) { + *(volatile unsigned long *)MB_A_SRAM_ADDR = 0x12345678; + if (*(volatile unsigned long *)MB_A_SRAM_ADDR == 0x12345678) printk (KERN_INFO " NEC SolutionGear/Midas lab" " RTE-MOTHER-A motherboard\n"); diff --git a/arch/v850/kernel/rte_mb_a_pci.c b/arch/v850/kernel/rte_mb_a_pci.c index 5416a50bf070..c56b0d28bb98 100644 --- a/arch/v850/kernel/rte_mb_a_pci.c +++ b/arch/v850/kernel/rte_mb_a_pci.c @@ -239,7 +239,7 @@ static void __devinit pcibios_assign_resources (void) struct resource *r; pci_for_each_dev (dev) { - int di_num; + unsigned di_num; unsigned class = dev->class >> 8; if (class && class != PCI_CLASS_BRIDGE_HOST) { diff --git a/arch/v850/kernel/signal.c b/arch/v850/kernel/signal.c index b0a111d43fda..bab85ab908b6 100644 --- a/arch/v850/kernel/signal.c +++ b/arch/v850/kernel/signal.c @@ -512,9 +512,10 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) /* Did we come from a system call? */ if (PT_REGS_SYSCALL (regs)) { /* Restart the system call - no handlers present */ - if (regs->gpr[GPR_RVAL] == -ERESTARTNOHAND || - regs->gpr[GPR_RVAL] == -ERESTARTSYS || - regs->gpr[GPR_RVAL] == -ERESTARTNOINTR) { + if (regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOHAND || + regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTSYS || + regs->gpr[GPR_RVAL] == (v850_reg_t)-ERESTARTNOINTR) + { regs->gpr[12] = PT_REGS_SYSCALL (regs); regs->pc -= 4; /* Size of `trap 0' insn. */ } -- 2.39.5