From 9e04b79ce432b8be2419dc52021afb6f07b78540 Mon Sep 17 00:00:00 2001 From: Munir Contractor Date: Mon, 14 Aug 2017 22:02:08 -0700 Subject: [PATCH] Input: pcspkr - fix code style and error value in pcspkr_event This patch fixes the following issues in pcspkr: * Return -EINVAL when input arguments are not valid in pcspkr_event function instead of -1. * Replace with * Fix indentation of case blocks in switch statement * Reduce length of line 28 to less than 80 characters The style issues were discovered by checkpatch.pl script. Signed-off-by: Munir Contractor Signed-off-by: Dmitry Torokhov --- drivers/input/misc/pcspkr.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/input/misc/pcspkr.c b/drivers/input/misc/pcspkr.c index 72b1fc3ab910..56ddba21de84 100644 --- a/drivers/input/misc/pcspkr.c +++ b/drivers/input/misc/pcspkr.c @@ -18,25 +18,30 @@ #include #include #include -#include +#include MODULE_AUTHOR("Vojtech Pavlik "); MODULE_DESCRIPTION("PC Speaker beeper driver"); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:pcspkr"); -static int pcspkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) +static int pcspkr_event(struct input_dev *dev, unsigned int type, + unsigned int code, int value) { unsigned int count = 0; unsigned long flags; if (type != EV_SND) - return -1; + return -EINVAL; switch (code) { - case SND_BELL: if (value) value = 1000; - case SND_TONE: break; - default: return -1; + case SND_BELL: + if (value) + value = 1000; + case SND_TONE: + break; + default: + return -EINVAL; } if (value > 20 && value < 32767) -- 2.20.1