public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x
@ 2017-02-09 20:40 Tom Rini
  2017-02-10  7:02 ` Heiko Schocher
  2017-02-17 22:56 ` [U-Boot] " Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Tom Rini @ 2017-02-09 20:40 UTC (permalink / raw)
  To: u-boot

With gcc-6.x we see:
drivers/i2c/fsl_i2c.c:86:3: warning: ?fsl_i2c_speed_map? defined but not
used [-Wunused-const-variable=]

The easy way to fix this is that since we only use fsl_i2c_speed_map at
all on __M68K__ move the existing guards around slightly.

Reported-by: Thomas Schaefer <Thomas.Schaefer@kontron.com>
Signed-off-by: Tom Rini <trini@konsulko.com>
---
 drivers/i2c/fsl_i2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
index e9fbf828f34b..a1406baa87b2 100644
--- a/drivers/i2c/fsl_i2c.c
+++ b/drivers/i2c/fsl_i2c.c
@@ -53,6 +53,7 @@ static const struct fsl_i2c_base *i2c_base[4] = {
 
 /* I2C speed map for a DFSR value of 1 */
 
+#ifdef __M68K__
 /*
  * Map I2C frequency dividers to FDR and DFSR values
  *
@@ -84,7 +85,6 @@ static const struct {
 	unsigned short divider;
 	u8 fdr;
 } fsl_i2c_speed_map[] = {
-#ifdef __M68K__
 	{20, 32}, {22, 33}, {24, 34}, {26, 35},
 	{28, 0}, {28, 36}, {30, 1}, {32, 37},
 	{34, 2}, {36, 38}, {40, 3}, {40, 39},
@@ -102,8 +102,8 @@ static const struct {
 	{1536, 61}, {1792, 62}, {1920, 27}, {2048, 63},
 	{2304, 28}, {2560, 29}, {3072, 30}, {3840, 31},
 	{-1, 31}
-#endif
 };
+#endif
 
 /**
  * Set the I2C bus speed for a given I2C device
-- 
1.9.1

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

* [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x
  2017-02-09 20:40 [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x Tom Rini
@ 2017-02-10  7:02 ` Heiko Schocher
  2017-02-11  3:21   ` Tom Rini
  2017-02-17 22:56 ` [U-Boot] " Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Heiko Schocher @ 2017-02-10  7:02 UTC (permalink / raw)
  To: u-boot

Hello Tom,

Am 09.02.2017 um 21:40 schrieb Tom Rini:
> With gcc-6.x we see:
> drivers/i2c/fsl_i2c.c:86:3: warning: ?fsl_i2c_speed_map? defined but not
> used [-Wunused-const-variable=]
>
> The easy way to fix this is that since we only use fsl_i2c_speed_map at
> all on __M68K__ move the existing guards around slightly.
>
> Reported-by: Thomas Schaefer <Thomas.Schaefer@kontron.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> ---
>   drivers/i2c/fsl_i2c.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)

Thanks!

Acked-by: Heiko Schocher <hs@denx.de>

Do you want to pick up this patch directly, or should I send an i2c pull
request?

bye,
Heiko
>
> diff --git a/drivers/i2c/fsl_i2c.c b/drivers/i2c/fsl_i2c.c
> index e9fbf828f34b..a1406baa87b2 100644
> --- a/drivers/i2c/fsl_i2c.c
> +++ b/drivers/i2c/fsl_i2c.c
> @@ -53,6 +53,7 @@ static const struct fsl_i2c_base *i2c_base[4] = {
>
>   /* I2C speed map for a DFSR value of 1 */
>
> +#ifdef __M68K__
>   /*
>    * Map I2C frequency dividers to FDR and DFSR values
>    *
> @@ -84,7 +85,6 @@ static const struct {
>   	unsigned short divider;
>   	u8 fdr;
>   } fsl_i2c_speed_map[] = {
> -#ifdef __M68K__
>   	{20, 32}, {22, 33}, {24, 34}, {26, 35},
>   	{28, 0}, {28, 36}, {30, 1}, {32, 37},
>   	{34, 2}, {36, 38}, {40, 3}, {40, 39},
> @@ -102,8 +102,8 @@ static const struct {
>   	{1536, 61}, {1792, 62}, {1920, 27}, {2048, 63},
>   	{2304, 28}, {2560, 29}, {3072, 30}, {3840, 31},
>   	{-1, 31}
> -#endif
>   };
> +#endif
>
>   /**
>    * Set the I2C bus speed for a given I2C device
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x
  2017-02-10  7:02 ` Heiko Schocher
@ 2017-02-11  3:21   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2017-02-11  3:21 UTC (permalink / raw)
  To: u-boot

On Fri, Feb 10, 2017 at 08:02:31AM +0100, Heiko Schocher wrote:
> Hello Tom,
> 
> Am 09.02.2017 um 21:40 schrieb Tom Rini:
> >With gcc-6.x we see:
> >drivers/i2c/fsl_i2c.c:86:3: warning: ?fsl_i2c_speed_map? defined but not
> >used [-Wunused-const-variable=]
> >
> >The easy way to fix this is that since we only use fsl_i2c_speed_map at
> >all on __M68K__ move the existing guards around slightly.
> >
> >Reported-by: Thomas Schaefer <Thomas.Schaefer@kontron.com>
> >Signed-off-by: Tom Rini <trini@konsulko.com>
> >---
> >  drivers/i2c/fsl_i2c.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Thanks!
> 
> Acked-by: Heiko Schocher <hs@denx.de>
> 
> Do you want to pick up this patch directly, or should I send an i2c pull
> request?

If you have other i2c things to pick up, please pick it up, otherwise
assign it to me (or York, we're going to sort out the rest of the big
gcc-6.x warnings) and it'll get picked up.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170210/ece83ff9/attachment.sig>

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

* [U-Boot] fsl_i2c.c: Fix warning on gcc-6.x
  2017-02-09 20:40 [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x Tom Rini
  2017-02-10  7:02 ` Heiko Schocher
@ 2017-02-17 22:56 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2017-02-17 22:56 UTC (permalink / raw)
  To: u-boot

On Thu, Feb 09, 2017 at 03:40:16PM -0500, Tom Rini wrote:

> With gcc-6.x we see:
> drivers/i2c/fsl_i2c.c:86:3: warning: ?fsl_i2c_speed_map? defined but not
> used [-Wunused-const-variable=]
> 
> The easy way to fix this is that since we only use fsl_i2c_speed_map at
> all on __M68K__ move the existing guards around slightly.
> 
> Reported-by: Thomas Schaefer <Thomas.Schaefer@kontron.com>
> Signed-off-by: Tom Rini <trini@konsulko.com>
> Acked-by: Heiko Schocher <hs@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170217/3e0055dc/attachment.sig>

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

end of thread, other threads:[~2017-02-17 22:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-09 20:40 [U-Boot] [PATCH] fsl_i2c.c: Fix warning on gcc-6.x Tom Rini
2017-02-10  7:02 ` Heiko Schocher
2017-02-11  3:21   ` Tom Rini
2017-02-17 22:56 ` [U-Boot] " Tom Rini

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