summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorBartosz Golaszewski <brgl@bgdev.pl>2018-03-19 12:17:06 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-23 18:25:00 +0300
commiteb27fde2731b6cb5818493b8ac18e01f427e335f (patch)
treeb5f9fad9ced5c6937aa675728e80a6f6fe8dfd60 /drivers/misc
parent14263b893a524e967cdb0d39d94b6ed2bb9400c5 (diff)
downloadlinux-eb27fde2731b6cb5818493b8ac18e01f427e335f.tar.xz
eeprom: at24: drop redundant variable in at24_read()
We can reuse ret instead of defining a loop-local status variable. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Tested-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/eeprom/at24.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
index fb71041971d2..ef9d20f43127 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -395,17 +395,15 @@ static int at24_read(void *priv, unsigned int off, void *val, size_t count)
mutex_lock(&at24->lock);
while (count) {
- int status;
-
- status = at24_regmap_read(at24, buf, off, count);
- if (status < 0) {
+ ret = at24_regmap_read(at24, buf, off, count);
+ if (ret < 0) {
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
- return status;
+ return ret;
}
- buf += status;
- off += status;
- count -= status;
+ buf += ret;
+ off += ret;
+ count -= ret;
}
mutex_unlock(&at24->lock);