aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorAaro Koskinen <aaro.koskinen@iki.fi>2015-03-28 14:05:39 -0400
committerWim Van Sebroeck <wim@iguana.be>2015-04-22 09:28:35 -0400
commit8692cf0ad31b3654c798c23de01e4c23c4536dea (patch)
tree4187fa44bd96f8514aa21d4f8468889e86de8986 /drivers/watchdog
parent3d588c93c040c4aacca81b15a7aa9761357ecdc4 (diff)
watchdog: octeon: fix some trivial coding style issues
Fix some trivial coding style issues to reduce noise from static analyzers. Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi> Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/octeon-wdt-main.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c
index 9aa5121d7d50..728840cacc51 100644
--- a/drivers/watchdog/octeon-wdt-main.c
+++ b/drivers/watchdog/octeon-wdt-main.c
@@ -105,10 +105,10 @@ MODULE_PARM_DESC(nowayout,
105 "Watchdog cannot be stopped once started (default=" 105 "Watchdog cannot be stopped once started (default="
106 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 106 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
107 107
108static u32 __initdata nmi_stage1_insns[64]; 108static u32 nmi_stage1_insns[64] __initdata;
109/* We need one branch and therefore one relocation per target label. */ 109/* We need one branch and therefore one relocation per target label. */
110static struct uasm_label __initdata labels[5]; 110static struct uasm_label labels[5] __initdata;
111static struct uasm_reloc __initdata relocs[5]; 111static struct uasm_reloc relocs[5] __initdata;
112 112
113enum lable_id { 113enum lable_id {
114 label_enter_bootloader = 1 114 label_enter_bootloader = 1
@@ -217,7 +217,8 @@ static void __init octeon_wdt_build_stage1(void)
217 pr_debug("\t.set pop\n"); 217 pr_debug("\t.set pop\n");
218 218
219 if (len > 32) 219 if (len > 32)
220 panic("NMI stage 1 handler exceeds 32 instructions, was %d\n", len); 220 panic("NMI stage 1 handler exceeds 32 instructions, was %d\n",
221 len);
221} 222}
222 223
223static int cpu2core(int cpu) 224static int cpu2core(int cpu)
@@ -293,6 +294,7 @@ static void octeon_wdt_write_hex(u64 value, int digits)
293{ 294{
294 int d; 295 int d;
295 int v; 296 int v;
297
296 for (d = 0; d < digits; d++) { 298 for (d = 0; d < digits; d++) {
297 v = (value >> ((digits - d - 1) * 4)) & 0xf; 299 v = (value >> ((digits - d - 1) * 4)) & 0xf;
298 if (v >= 10) 300 if (v >= 10)
@@ -302,7 +304,7 @@ static void octeon_wdt_write_hex(u64 value, int digits)
302 } 304 }
303} 305}
304 306
305const char *reg_name[] = { 307static const char *reg_name[] = {
306 "$0", "at", "v0", "v1", "a0", "a1", "a2", "a3", 308 "$0", "at", "v0", "v1", "a0", "a1", "a2", "a3",
307 "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3", 309 "a4", "a5", "a6", "a7", "t0", "t1", "t2", "t3",
308 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", 310 "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7",
@@ -456,6 +458,7 @@ static int octeon_wdt_ping(struct watchdog_device __always_unused *wdog)
456 !cpumask_test_cpu(cpu, &irq_enabled_cpus)) { 458 !cpumask_test_cpu(cpu, &irq_enabled_cpus)) {
457 /* We have to enable the irq */ 459 /* We have to enable the irq */
458 int irq = OCTEON_IRQ_WDOG0 + coreid; 460 int irq = OCTEON_IRQ_WDOG0 + coreid;
461
459 enable_irq(irq); 462 enable_irq(irq);
460 cpumask_set_cpu(cpu, &irq_enabled_cpus); 463 cpumask_set_cpu(cpu, &irq_enabled_cpus);
461 } 464 }
@@ -573,7 +576,8 @@ static int __init octeon_wdt_init(void)
573 max_timeout_sec = 6; 576 max_timeout_sec = 6;
574 do { 577 do {
575 max_timeout_sec--; 578 max_timeout_sec--;
576 timeout_cnt = ((octeon_get_io_clock_rate() >> 8) * max_timeout_sec) >> 8; 579 timeout_cnt = ((octeon_get_io_clock_rate() >> 8) *
580 max_timeout_sec) >> 8;
577 } while (timeout_cnt > 65535); 581 } while (timeout_cnt > 65535);
578 582
579 BUG_ON(timeout_cnt == 0); 583 BUG_ON(timeout_cnt == 0);