summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorBartosz Golaszewski <brgl@bgdev.pl>2018-03-19 10:17:07 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-23 16:25:00 +0100
commitc4fee330f9402878e6e4c6d21f8d42e3ead37c5b (patch)
tree96b4cecd86ff9054589ed0e0befbc586be42547e /drivers/misc
parenteb27fde2731b6cb5818493b8ac18e01f427e335f (diff)
downloadop-kernel-dev-c4fee330f9402878e6e4c6d21f8d42e3ead37c5b.zip
op-kernel-dev-c4fee330f9402878e6e4c6d21f8d42e3ead37c5b.tar.gz
eeprom: at24: drop redundant variable in at24_write()
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 ef9d20f..2d8f36c 100644
--- a/drivers/misc/eeprom/at24.c
+++ b/drivers/misc/eeprom/at24.c
@@ -443,18 +443,16 @@ static int at24_write(void *priv, unsigned int off, void *val, size_t count)
gpiod_set_value_cansleep(at24->wp_gpio, 0);
while (count) {
- int status;
-
- status = at24_regmap_write(at24, buf, off, count);
- if (status < 0) {
+ ret = at24_regmap_write(at24, buf, off, count);
+ if (ret < 0) {
gpiod_set_value_cansleep(at24->wp_gpio, 1);
mutex_unlock(&at24->lock);
pm_runtime_put(dev);
- return status;
+ return ret;
}
- buf += status;
- off += status;
- count -= status;
+ buf += ret;
+ off += ret;
+ count -= ret;
}
gpiod_set_value_cansleep(at24->wp_gpio, 1);
OpenPOWER on IntegriCloud