public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] i2c: i2c-stm32f7: make structure stm32f7_setup static
@ 2017-09-16 11:33 Colin King
  2017-09-16 19:33 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2017-09-16 11:33 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 structure stm32f7_setup is local to the source and does not need
to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'stm32f7_setup' was not declared. Should it be static?

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

diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
index 47c67b0ca896..a9cb78de22e0 100644
--- a/drivers/i2c/busses/i2c-stm32f7.c
+++ b/drivers/i2c/busses/i2c-stm32f7.c
@@ -265,7 +265,7 @@ static struct stm32f7_i2c_spec i2c_specs[] = {
 	},
 };
 
-struct stm32f7_i2c_setup stm32f7_setup = {
+static struct stm32f7_i2c_setup stm32f7_setup = {
 	.rise_time = STM32F7_I2C_RISE_TIME_DEFAULT,
 	.fall_time = STM32F7_I2C_FALL_TIME_DEFAULT,
 	.dnf = STM32F7_I2C_DNF_DEFAULT,
-- 
2.14.1


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

* Re: [PATCH] i2c: i2c-stm32f7: make structure stm32f7_setup static
  2017-09-16 11:33 [PATCH] i2c: i2c-stm32f7: make structure stm32f7_setup static Colin King
@ 2017-09-16 19:33 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2017-09-16 19:33 UTC (permalink / raw)
  To: Colin King, Wolfram Sang, Maxime Coquelin, Alexandre Torgue,
	linux-i2c, linux-arm-kernel
  Cc: kernel-janitors, linux-kernel

On Sat, 2017-09-16 at 12:33 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> The structure stm32f7_setup is local to the source and does not need
> to be in global scope, so make it static.
> 
> Cleans up sparse warning:
> symbol 'stm32f7_setup' was not declared. Should it be static?
[]
> diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c
[]
> @@ -265,7 +265,7 @@ static struct stm32f7_i2c_spec i2c_specs[] = {
>  	},
>  };
>  
> -struct stm32f7_i2c_setup stm32f7_setup = {
> +static struct stm32f7_i2c_setup stm32f7_setup = {

better to use static const

>  	.rise_time = STM32F7_I2C_RISE_TIME_DEFAULT,
>  	.fall_time = STM32F7_I2C_FALL_TIME_DEFAULT,
>  	.dnf = STM32F7_I2C_DNF_DEFAULT,

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

end of thread, other threads:[~2017-09-16 19:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-16 11:33 [PATCH] i2c: i2c-stm32f7: make structure stm32f7_setup static Colin King
2017-09-16 19:33 ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox