diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-07-02 06:22:10 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-09 11:37:45 -0400 |
commit | c3f27a26b477baf8e32848731e860618e5f48b58 (patch) | |
tree | 5d3c27308c8a44230a18441bd4a532040311ac2c /drivers/mfd/ab8500-debugfs.c | |
parent | f35563027f4555fee8a6ee5a8c775cbf0c9ad4ef (diff) |
mfd: ab8500-debugfs: Simplify invalid debugfs data checking
Noticed during a coding review, if we reorganised the checking a
little, we can rid the code of a pointless 'else'. Whilst looking
for this particular code hunk I noticed another pointless 'else',
which I've subsequently fixed in this patch.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ab8500-debugfs.c')
-rw-r--r-- | drivers/mfd/ab8500-debugfs.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index e23fcbad79d6..f7f271c16f2c 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c | |||
@@ -2503,14 +2503,14 @@ static ssize_t ab8500_gpadc_trig_timer_write(struct file *file, | |||
2503 | if (err) | 2503 | if (err) |
2504 | return err; | 2504 | return err; |
2505 | 2505 | ||
2506 | if (user_trig_timer <= 255) { | 2506 | if (user_trig_timer & ~0xFF) { |
2507 | trig_timer = (u8) user_trig_timer; | 2507 | dev_err(dev, |
2508 | } else { | 2508 | "debugfs error input: should be beetween 0 to 255\n"); |
2509 | dev_err(dev, "debugfs error input: " | ||
2510 | "should be beetween 0 to 255\n"); | ||
2511 | return -EINVAL; | 2509 | return -EINVAL; |
2512 | } | 2510 | } |
2513 | 2511 | ||
2512 | trig_timer = (u8) user_trig_timer; | ||
2513 | |||
2514 | return count; | 2514 | return count; |
2515 | } | 2515 | } |
2516 | 2516 | ||
@@ -2764,8 +2764,8 @@ static ssize_t show_irq(struct device *dev, | |||
2764 | irq_index = name - irq_first; | 2764 | irq_index = name - irq_first; |
2765 | if (irq_index >= num_irqs) | 2765 | if (irq_index >= num_irqs) |
2766 | return -EINVAL; | 2766 | return -EINVAL; |
2767 | else | 2767 | |
2768 | return sprintf(buf, "%u\n", irq_count[irq_index]); | 2768 | return sprintf(buf, "%u\n", irq_count[irq_index]); |
2769 | } | 2769 | } |
2770 | 2770 | ||
2771 | static ssize_t ab8500_subscribe_write(struct file *file, | 2771 | static ssize_t ab8500_subscribe_write(struct file *file, |