diff options
author | Lee Jones <lee.jones@linaro.org> | 2014-07-02 11:22:10 +0100 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2014-07-09 16:37:45 +0100 |
commit | c3f27a26b477baf8e32848731e860618e5f48b58 (patch) | |
tree | 5d3c27308c8a44230a18441bd4a532040311ac2c /drivers | |
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')
-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, if (err) return err; - if (user_trig_timer <= 255) { - trig_timer = (u8) user_trig_timer; - } else { - dev_err(dev, "debugfs error input: " - "should be beetween 0 to 255\n"); + if (user_trig_timer & ~0xFF) { + dev_err(dev, + "debugfs error input: should be beetween 0 to 255\n"); return -EINVAL; } + trig_timer = (u8) user_trig_timer; + return count; } @@ -2764,8 +2764,8 @@ static ssize_t show_irq(struct device *dev, irq_index = name - irq_first; if (irq_index >= num_irqs) return -EINVAL; - else - return sprintf(buf, "%u\n", irq_count[irq_index]); + + return sprintf(buf, "%u\n", irq_count[irq_index]); } static ssize_t ab8500_subscribe_write(struct file *file, |