[U-Boot,2/2] i2c: stm32f7_i2c: fix usage of useless local variable

Message ID 1507728635-31611-3-git-send-email-patrice.chotard@st.com
State Changes Requested
Delegated to: Heiko Schocher
Headers show
Series
  • stm32f7_i2c fixes
Related show

Commit Message

Patrice CHOTARD Oct. 11, 2017, 1:30 p.m.
From: Patrice Chotard <patrice.chotard@st.com>

Remove useless local variable "s" and use directly
function's parameter "output"

Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
---
 drivers/i2c/stm32f7_i2c.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Simon Glass Oct. 22, 2017, 2:33 p.m. | #1
On 11 October 2017 at 15:30,  <patrice.chotard@st.com> wrote:
> From: Patrice Chotard <patrice.chotard@st.com>
>
> Remove useless local variable "s" and use directly
> function's parameter "output"
>
> Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
> ---
>  drivers/i2c/stm32f7_i2c.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

Patch

diff --git a/drivers/i2c/stm32f7_i2c.c b/drivers/i2c/stm32f7_i2c.c
index d519c17..610a9ef 100644
--- a/drivers/i2c/stm32f7_i2c.c
+++ b/drivers/i2c/stm32f7_i2c.c
@@ -640,7 +640,7 @@  static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
 				      struct stm32_i2c_setup *setup,
 				      struct stm32_i2c_timings *output)
 {
-	struct stm32_i2c_timings *v, *_v, s;
+	struct stm32_i2c_timings *v, *_v;
 	struct list_head solutions;
 	int ret;
 
@@ -676,16 +676,10 @@  static int stm32_i2c_compute_timing(struct stm32_i2c_priv *i2c_priv,
 	if (ret)
 		goto exit;
 
-	ret = stm32_i2c_choose_solution(setup, &solutions, &s);
+	ret = stm32_i2c_choose_solution(setup, &solutions, output);
 	if (ret)
 		goto exit;
 
-	output->presc = s.presc;
-	output->scldel = s.scldel;
-	output->sdadel = s.sdadel;
-	output->scll = s.scll;
-	output->sclh = s.sclh;
-
 	debug("%s: Presc: %i, scldel: %i, sdadel: %i, scll: %i, sclh: %i\n",
 	      __func__, output->presc,
 	      output->scldel, output->sdadel,