Re: [char-misc-next 4/7] watchdog: mei_wdt: add status debugfs entry

Guenter Roeck
2015-12-20T10:40:23Z

On 12/20/2015 01:44 AM, Winkler, Tomas wrote:
>
>> On 12/17/2015 06:49 AM, Tomas Winkler wrote:
>>> Add entry for dumping current watchdog internal state
>>>
>>> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
>>> ---
>>> drivers/watchdog/mei_wdt.c | 84
>> ++++++++++++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 84 insertions(+)
>>>
>>> diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
>>> index 3c97deb70d90..a3f1c1613c32 100644
>>> --- a/drivers/watchdog/mei_wdt.c
>>> +++ b/drivers/watchdog/mei_wdt.c
>>> @@ -16,6 +16,7 @@
>>> #include <linux/slab.h>
>>> #include <linux/interrupt.h>
>>> #include <linux/watchdog.h>
>>> +#include <linux/debugfs.h>
>>>
>>> #include <linux/uuid.h>
>>> #include <linux/mei_cl_bus.h>
>>> @@ -54,6 +55,19 @@ enum mei_wdt_state {
>>> MEI_WDT_STOPPING,
>>> };
>>>
>>> +#if IS_ENABLED(CONFIG_DEBUG_FS)
>>> +static const char *mei_wdt_state_str(enum mei_wdt_state state)
>>> +{
>>> + switch (state) {
>>> + case MEI_WDT_IDLE: return "IDLE";
>>> + case MEI_WDT_START: return "START";
>>> + case MEI_WDT_RUNNING: return "RUNNING";
>>> + case MEI_WDT_STOPPING: return "STOPPING";
>>> + default: return "unknown";
>>
>> Doesn't this cause checkpatch warnings ?
> It doesn't and also checkpatch.pl is just a help tool.

I should have said "Doesn't this violate the single-statement-per-line"
coding style rule, but I guess then you'd argue that "case xxx:" is not
a statement.

Guenter