diff mbox series

drm/gma500: remove redundant ret variable

Message ID 20220112082524.667552-1-chi.minghao@zte.com.cn (mailing list archive)
State New, archived
Headers show
Series drm/gma500: remove redundant ret variable | expand

Commit Message

CGEL Jan. 12, 2022, 8:25 a.m. UTC
From: Minghao Chi <chi.minghao@zte.com.cn>

Return value directly instead of taking this in another redundant
variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>
---
 drivers/gpu/drm/gma500/cdv_intel_dp.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

Comments

Patrik Jakobsson Jan. 12, 2022, 8:51 a.m. UTC | #1
On Wed, Jan 12, 2022 at 9:25 AM <cgel.zte@gmail.com> wrote:
>
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Return value directly instead of taking this in another redundant
> variable.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com>

Thanks for the patch. I'll apply this to drm-misc-next

-Patrik

> ---
>  drivers/gpu/drm/gma500/cdv_intel_dp.c | 12 +++---------
>  1 file changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> index ba6ad1466374..74e67679714e 100644
> --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
> +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
> @@ -82,7 +82,6 @@ i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
>  {
>         struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
>         int mode = MODE_I2C_START;
> -       int ret;
>
>         if (reading)
>                 mode |= MODE_I2C_READ;
> @@ -90,8 +89,7 @@ i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
>                 mode |= MODE_I2C_WRITE;
>         algo_data->address = address;
>         algo_data->running = true;
> -       ret = i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
> -       return ret;
> +       return i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
>  }
>
>  /*
> @@ -122,13 +120,11 @@ static int
>  i2c_algo_dp_aux_put_byte(struct i2c_adapter *adapter, u8 byte)
>  {
>         struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
> -       int ret;
>
>         if (!algo_data->running)
>                 return -EIO;
>
> -       ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
> -       return ret;
> +       return i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
>  }
>
>  /*
> @@ -139,13 +135,11 @@ static int
>  i2c_algo_dp_aux_get_byte(struct i2c_adapter *adapter, u8 *byte_ret)
>  {
>         struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
> -       int ret;
>
>         if (!algo_data->running)
>                 return -EIO;
>
> -       ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_READ, 0, byte_ret);
> -       return ret;
> +       return i2c_algo_dp_aux_transaction(adapter, MODE_I2C_READ, 0, byte_ret);
>  }
>
>  static int
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c
index ba6ad1466374..74e67679714e 100644
--- a/drivers/gpu/drm/gma500/cdv_intel_dp.c
+++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c
@@ -82,7 +82,6 @@  i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
 {
 	struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
 	int mode = MODE_I2C_START;
-	int ret;
 
 	if (reading)
 		mode |= MODE_I2C_READ;
@@ -90,8 +89,7 @@  i2c_algo_dp_aux_address(struct i2c_adapter *adapter, u16 address, bool reading)
 		mode |= MODE_I2C_WRITE;
 	algo_data->address = address;
 	algo_data->running = true;
-	ret = i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
-	return ret;
+	return i2c_algo_dp_aux_transaction(adapter, mode, 0, NULL);
 }
 
 /*
@@ -122,13 +120,11 @@  static int
 i2c_algo_dp_aux_put_byte(struct i2c_adapter *adapter, u8 byte)
 {
 	struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
-	int ret;
 
 	if (!algo_data->running)
 		return -EIO;
 
-	ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
-	return ret;
+	return i2c_algo_dp_aux_transaction(adapter, MODE_I2C_WRITE, byte, NULL);
 }
 
 /*
@@ -139,13 +135,11 @@  static int
 i2c_algo_dp_aux_get_byte(struct i2c_adapter *adapter, u8 *byte_ret)
 {
 	struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data;
-	int ret;
 
 	if (!algo_data->running)
 		return -EIO;
 
-	ret = i2c_algo_dp_aux_transaction(adapter, MODE_I2C_READ, 0, byte_ret);
-	return ret;
+	return i2c_algo_dp_aux_transaction(adapter, MODE_I2C_READ, 0, byte_ret);
 }
 
 static int