linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i2c-stm32f4: remove redundant initialization of pointer reg
@ 2018-01-16 17:44 Colin King
  2018-02-26 20:06 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-01-16 17:44 UTC (permalink / raw)
  To: Wolfram Sang, Maxime Coquelin, Alexandre Torgue, linux-i2c,
	linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The pointer reg is assigned a value that is never read, it is later
overwritten with a new value, hence the redundant initialization can
be removed.

Cleans up clang warning:
drivers/i2c/busses/i2c-stm32f4.c:352:16: warning: Value stored to 'reg'
during its initialization is never read

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/i2c/busses/i2c-stm32f4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
index 47c8d00de53f..ba600d77a3f8 100644
--- a/drivers/i2c/busses/i2c-stm32f4.c
+++ b/drivers/i2c/busses/i2c-stm32f4.c
@@ -349,7 +349,7 @@ static void stm32f4_i2c_read_msg(struct stm32f4_i2c_dev *i2c_dev)
 static void stm32f4_i2c_terminate_xfer(struct stm32f4_i2c_dev *i2c_dev)
 {
 	struct stm32f4_i2c_msg *msg = &i2c_dev->msg;
-	void __iomem *reg = i2c_dev->base + STM32F4_I2C_CR2;
+	void __iomem *reg;
 
 	stm32f4_i2c_disable_irq(i2c_dev);
 
-- 
2.15.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-stm32f4: remove redundant initialization of pointer reg
  2018-01-16 17:44 [PATCH] i2c-stm32f4: remove redundant initialization of pointer reg Colin King
@ 2018-02-26 20:06 ` Wolfram Sang
  2018-02-27  7:44   ` Alexandre Torgue
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2018-02-26 20:06 UTC (permalink / raw)
  To: Colin King
  Cc: Maxime Coquelin, Alexandre Torgue, linux-i2c, linux-arm-kernel,
	kernel-janitors, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1229 bytes --]

On Tue, Jan 16, 2018 at 05:44:04PM +0000, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The pointer reg is assigned a value that is never read, it is later
> overwritten with a new value, hence the redundant initialization can
> be removed.
> 
> Cleans up clang warning:
> drivers/i2c/busses/i2c-stm32f4.c:352:16: warning: Value stored to 'reg'
> during its initialization is never read
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Maxime? Alexandre? Are you OK with this patch?

> ---
>  drivers/i2c/busses/i2c-stm32f4.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
> index 47c8d00de53f..ba600d77a3f8 100644
> --- a/drivers/i2c/busses/i2c-stm32f4.c
> +++ b/drivers/i2c/busses/i2c-stm32f4.c
> @@ -349,7 +349,7 @@ static void stm32f4_i2c_read_msg(struct stm32f4_i2c_dev *i2c_dev)
>  static void stm32f4_i2c_terminate_xfer(struct stm32f4_i2c_dev *i2c_dev)
>  {
>  	struct stm32f4_i2c_msg *msg = &i2c_dev->msg;
> -	void __iomem *reg = i2c_dev->base + STM32F4_I2C_CR2;
> +	void __iomem *reg;
>  
>  	stm32f4_i2c_disable_irq(i2c_dev);
>  
> -- 
> 2.15.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i2c-stm32f4: remove redundant initialization of pointer reg
  2018-02-26 20:06 ` Wolfram Sang
@ 2018-02-27  7:44   ` Alexandre Torgue
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Torgue @ 2018-02-27  7:44 UTC (permalink / raw)
  To: Wolfram Sang, Colin King
  Cc: linux-arm-kernel, kernel-janitors, linux-i2c, Maxime Coquelin,
	linux-kernel

Hi,

On 02/26/2018 09:06 PM, Wolfram Sang wrote:
> On Tue, Jan 16, 2018 at 05:44:04PM +0000, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The pointer reg is assigned a value that is never read, it is later
>> overwritten with a new value, hence the redundant initialization can
>> be removed.
>>
>> Cleans up clang warning:
>> drivers/i2c/busses/i2c-stm32f4.c:352:16: warning: Value stored to 'reg'
>> during its initialization is never read
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> 
> Maxime? Alexandre? Are you OK with this patch?

Sorry for delay.

Acked-by: Alexandre TORGUE <alexandre.torgue@st.com>

regards
alex

> 
>> ---
>>   drivers/i2c/busses/i2c-stm32f4.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-stm32f4.c b/drivers/i2c/busses/i2c-stm32f4.c
>> index 47c8d00de53f..ba600d77a3f8 100644
>> --- a/drivers/i2c/busses/i2c-stm32f4.c
>> +++ b/drivers/i2c/busses/i2c-stm32f4.c
>> @@ -349,7 +349,7 @@ static void stm32f4_i2c_read_msg(struct stm32f4_i2c_dev *i2c_dev)
>>   static void stm32f4_i2c_terminate_xfer(struct stm32f4_i2c_dev *i2c_dev)
>>   {
>>   	struct stm32f4_i2c_msg *msg = &i2c_dev->msg;
>> -	void __iomem *reg = i2c_dev->base + STM32F4_I2C_CR2;
>> +	void __iomem *reg;
>>   
>>   	stm32f4_i2c_disable_irq(i2c_dev);
>>   
>> -- 
>> 2.15.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-27  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-16 17:44 [PATCH] i2c-stm32f4: remove redundant initialization of pointer reg Colin King
2018-02-26 20:06 ` Wolfram Sang
2018-02-27  7:44   ` Alexandre Torgue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).