Commit 76550d3292ba1b0dd1ff0a13d78a2718eba599c7

Authored by Randy Dunlap
Committed by Wim Van Sebroeck
1 parent 42bd5d4994

watchdog: fix several MODULE_PARM_DESC strings

Fix MODULE_PARM_DESC() strings in several watchdog drivers.
Some are simple as add a parenthesis.
Others are problems from __stringify() being used on a
variable name instead of a macro name, so the variable name
is produced in the string instead of its build-time value.
In these cases, create a macro for the value so that the
module param description string is useful.

Only pc87413_wdt has been built (due to toolchains).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

Showing 6 changed files with 19 additions and 13 deletions Side-by-side Diff

drivers/watchdog/mpc8xxx_wdt.c
... ... @@ -53,7 +53,7 @@
53 53 static u16 timeout = 0xffff;
54 54 module_param(timeout, ushort, 0);
55 55 MODULE_PARM_DESC(timeout,
56   - "Watchdog timeout in ticks. (0<timeout<65536, default=65535");
  56 + "Watchdog timeout in ticks. (0<timeout<65536, default=65535)");
57 57  
58 58 static int reset = 1;
59 59 module_param(reset, bool, 0);
drivers/watchdog/pc87413_wdt.c
... ... @@ -53,8 +53,10 @@
53 53 #define WDTO 0x11 /* Watchdog timeout register */
54 54 #define WDCFG 0x12 /* Watchdog config register */
55 55  
56   -static int io = 0x2E; /* Address used on Portwell Boards */
  56 +#define IO_DEFAULT 0x2E /* Address used on Portwell Boards */
57 57  
  58 +static int io = IO_DEFAULT;
  59 +
58 60 static int timeout = DEFAULT_TIMEOUT; /* timeout value */
59 61 static unsigned long timer_enabled; /* is the timer enabled? */
60 62  
61 63  
... ... @@ -583,12 +585,13 @@
583 585 MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
584 586  
585 587 module_param(io, int, 0);
586   -MODULE_PARM_DESC(io, MODNAME " I/O port (default: " __MODULE_STRING(io) ").");
  588 +MODULE_PARM_DESC(io, MODNAME " I/O port (default: "
  589 + __MODULE_STRING(IO_DEFAULT) ").");
587 590  
588 591 module_param(timeout, int, 0);
589 592 MODULE_PARM_DESC(timeout,
590 593 "Watchdog timeout in minutes (default="
591   - __MODULE_STRING(timeout) ").");
  594 + __MODULE_STRING(DEFAULT_TIMEOUT) ").");
592 595  
593 596 module_param(nowayout, int, 0);
594 597 MODULE_PARM_DESC(nowayout,
drivers/watchdog/pnx833x_wdt.c
... ... @@ -33,6 +33,8 @@
33 33 #define PFX "pnx833x: "
34 34 #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */
35 35 #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */
  36 +#define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY)
  37 +#define PNX_TIMEOUT_VALUE 2040000000U
36 38  
37 39 /** CONFIG block */
38 40 #define PNX833X_CONFIG (0x07000U)
39 41  
40 42  
41 43  
... ... @@ -47,20 +49,21 @@
47 49 static int pnx833x_wdt_alive;
48 50  
49 51 /* Set default timeout in MHZ.*/
50   -static int pnx833x_wdt_timeout = (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY);
  52 +static int pnx833x_wdt_timeout = PNX_WATCHDOG_TIMEOUT;
51 53 module_param(pnx833x_wdt_timeout, int, 0);
52 54 MODULE_PARM_DESC(timeout, "Watchdog timeout in Mhz. (68Mhz clock), default="
53   - __MODULE_STRING(pnx833x_wdt_timeout) "(30 seconds).");
  55 + __MODULE_STRING(PNX_TIMEOUT_VALUE) "(30 seconds).");
54 56  
55 57 static int nowayout = WATCHDOG_NOWAYOUT;
56 58 module_param(nowayout, int, 0);
57 59 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
58 60 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
59 61  
60   -static int start_enabled = 1;
  62 +#define START_DEFAULT 1
  63 +static int start_enabled = START_DEFAULT;
61 64 module_param(start_enabled, int, 0);
62 65 MODULE_PARM_DESC(start_enabled, "Watchdog is started on module insertion "
63   - "(default=" __MODULE_STRING(start_enabled) ")");
  66 + "(default=" __MODULE_STRING(START_DEFAULT) ")");
64 67  
65 68 static void pnx833x_wdt_start(void)
66 69 {
drivers/watchdog/s3c2410_wdt.c
... ... @@ -63,7 +63,7 @@
63 63 module_param(soft_noboot, int, 0);
64 64 module_param(debug, int, 0);
65 65  
66   -MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. default="
  66 +MODULE_PARM_DESC(tmr_margin, "Watchdog tmr_margin in seconds. (default="
67 67 __MODULE_STRING(CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME) ")");
68 68 MODULE_PARM_DESC(tmr_atboot,
69 69 "Watchdog is started at boot time if set to 1, default="
... ... @@ -71,8 +71,8 @@
71 71 MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
72 72 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
73 73 MODULE_PARM_DESC(soft_noboot, "Watchdog action, set to 1 to ignore reboots, "
74   - "0 to reboot (default depends on ONLY_TESTING)");
75   -MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug, (default 0)");
  74 + "0 to reboot (default 0)");
  75 +MODULE_PARM_DESC(debug, "Watchdog debug, set to >1 for debug (default 0)");
76 76  
77 77 static unsigned long open_lock;
78 78 static struct device *wdt_dev; /* platform device attached to */
drivers/watchdog/shwdt.c
... ... @@ -496,7 +496,7 @@
496 496 module_param(clock_division_ratio, int, 0);
497 497 MODULE_PARM_DESC(clock_division_ratio,
498 498 "Clock division ratio. Valid ranges are from 0x5 (1.31ms) "
499   - "to 0x7 (5.25ms). (default=" __MODULE_STRING(clock_division_ratio) ")");
  499 + "to 0x7 (5.25ms). (default=" __MODULE_STRING(WTCSR_CKS_4096) ")");
500 500  
501 501 module_param(heartbeat, int, 0);
502 502 MODULE_PARM_DESC(heartbeat,
drivers/watchdog/wdt977.c
... ... @@ -63,7 +63,7 @@
63 63 static DEFINE_SPINLOCK(spinlock);
64 64  
65 65 module_param(timeout, int, 0);
66   -MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300), default="
  66 +MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds (60..15300, default="
67 67 __MODULE_STRING(DEFAULT_TIMEOUT) ")");
68 68 module_param(testmode, int, 0);
69 69 MODULE_PARM_DESC(testmode, "Watchdog testmode (1 = no reboot), default=0");