All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/2] net: dsa: mv88e6xxx: Fix a few build warnings
@ 2017-04-06 13:47 Florian Fainelli
  2017-04-06 13:47 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n Florian Fainelli
  2017-04-06 13:47 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions Florian Fainelli
  0 siblings, 2 replies; 6+ messages in thread
From: Florian Fainelli @ 2017-04-06 13:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli

Hi all,

This fixes a bunch of warnings exposed by a make W=1, no functional changes

Florian Fainelli (2):
  net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n
  net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions

 drivers/net/dsa/mv88e6xxx/chip.c    | 2 ++
 drivers/net/dsa/mv88e6xxx/global2.h | 9 +++++++++
 2 files changed, 11 insertions(+)

-- 
2.9.3

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

* [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n
  2017-04-06 13:47 [PATCH net-next 0/2] net: dsa: mv88e6xxx: Fix a few build warnings Florian Fainelli
@ 2017-04-06 13:47 ` Florian Fainelli
  2017-04-06 14:04   ` Andrew Lunn
  2017-04-06 13:47 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions Florian Fainelli
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2017-04-06 13:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli

When CONFIG_OF=n, we will see the following warning:

drivers/net/dsa/mv88e6xxx/chip.c:2834:34: warning: 'mv88e6xxx_mdio_external_match' defined but not used [-Wunused-const-variable=]
 static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 44ba8cff5631..64cbc4c04907 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2831,11 +2831,13 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
 	return 0;
 }
 
+#ifdef CONFIG_OF
 static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
 	{ .compatible = "marvell,mv88e6xxx-mdio-external",
 	  .data = (void *)true },
 	{ },
 };
+#endif
 
 static int mv88e6xxx_mdios_register(struct mv88e6xxx_chip *chip,
 				    struct device_node *np)
-- 
2.9.3

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

* [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions
  2017-04-06 13:47 [PATCH net-next 0/2] net: dsa: mv88e6xxx: Fix a few build warnings Florian Fainelli
  2017-04-06 13:47 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n Florian Fainelli
@ 2017-04-06 13:47 ` Florian Fainelli
  2017-04-06 14:07   ` Andrew Lunn
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2017-04-06 13:47 UTC (permalink / raw)
  To: netdev; +Cc: davem, andrew, vivien.didelot, Florian Fainelli

Fixes the following warnings:

drivers/net/dsa/mv88e6xxx/global2.c:571:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c45' [-Wmissing-prototypes]
 int mv88e6xxx_g2_smi_phy_read_c45(struct mv88e6xxx_chip *chip, int addr,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/global2.c:602:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c22' [-Wmissing-prototypes]
 int mv88e6xxx_g2_smi_phy_read_c22(struct mv88e6xxx_chip *chip, int addr,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/global2.c:635:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c45' [-Wmissing-prototypes]
 int mv88e6xxx_g2_smi_phy_write_c45(struct mv88e6xxx_chip *chip, int addr,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/net/dsa/mv88e6xxx/global2.c:664:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c22' [-Wmissing-prototypes]
 int mv88e6xxx_g2_smi_phy_write_c22(struct mv88e6xxx_chip *chip, int addr,
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/dsa/mv88e6xxx/global2.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/net/dsa/mv88e6xxx/global2.h b/drivers/net/dsa/mv88e6xxx/global2.h
index 96046bb12ca1..9b790809f327 100644
--- a/drivers/net/dsa/mv88e6xxx/global2.h
+++ b/drivers/net/dsa/mv88e6xxx/global2.h
@@ -42,6 +42,15 @@ int mv88e6xxx_g2_get_eeprom16(struct mv88e6xxx_chip *chip,
 int mv88e6xxx_g2_set_eeprom16(struct mv88e6xxx_chip *chip,
 			      struct ethtool_eeprom *eeprom, u8 *data);
 
+int mv88e6xxx_g2_smi_phy_read_c45(struct mv88e6xxx_chip *chip, int addr,
+				  int reg_c45, u16 *val, bool external);
+int mv88e6xxx_g2_smi_phy_write_c45(struct mv88e6xxx_chip *chip, int addr,
+				   int reg_c45, u16 val, bool external);
+int mv88e6xxx_g2_smi_phy_read_c22(struct mv88e6xxx_chip *chip, int addr,
+				  int reg, u16 *val, bool external);
+int mv88e6xxx_g2_smi_phy_write_c22(struct mv88e6xxx_chip *chip, int addr,
+				   int reg, u16 val, bool external);
+
 int mv88e6xxx_g2_pvt_write(struct mv88e6xxx_chip *chip, int src_dev,
 			   int src_port, u16 data);
 int mv88e6xxx_g2_misc_4_bit_port(struct mv88e6xxx_chip *chip);
-- 
2.9.3

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

* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n
  2017-04-06 13:47 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n Florian Fainelli
@ 2017-04-06 14:04   ` Andrew Lunn
  2017-04-06 14:32     ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2017-04-06 14:04 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, David Miller, Florian Fainelli

On Thu, Apr 06, 2017 at 06:47:35AM -0700, Florian Fainelli wrote:
> When CONFIG_OF=n, we will see the following warning:
> 
> drivers/net/dsa/mv88e6xxx/chip.c:2834:34: warning: 'mv88e6xxx_mdio_external_match' defined but not used [-Wunused-const-variable=]
>  static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 44ba8cff5631..64cbc4c04907 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2831,11 +2831,13 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
>  	return 0;
>  }
>  
> +#ifdef CONFIG_OF
>  static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>  	{ .compatible = "marvell,mv88e6xxx-mdio-external",
>  	  .data = (void *)true },
>  	{ },
>  };
> +#endif

Hi Florian

Maybe a better fix is to make the stub of of_match_node() an inline
function, so its parameters are used. That will fix this warning
everywhere in the kernel, not just in this driver.

	   Andrew

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

* Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions
  2017-04-06 13:47 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions Florian Fainelli
@ 2017-04-06 14:07   ` Andrew Lunn
  0 siblings, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2017-04-06 14:07 UTC (permalink / raw)
  To: Florian Fainelli; +Cc: netdev, davem, vivien.didelot

On Thu, Apr 06, 2017 at 06:47:36AM -0700, Florian Fainelli wrote:
> Fixes the following warnings:
> 
> drivers/net/dsa/mv88e6xxx/global2.c:571:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c45' [-Wmissing-prototypes]
>  int mv88e6xxx_g2_smi_phy_read_c45(struct mv88e6xxx_chip *chip, int addr,
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/mv88e6xxx/global2.c:602:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_read_c22' [-Wmissing-prototypes]
>  int mv88e6xxx_g2_smi_phy_read_c22(struct mv88e6xxx_chip *chip, int addr,
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/mv88e6xxx/global2.c:635:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c45' [-Wmissing-prototypes]
>  int mv88e6xxx_g2_smi_phy_write_c45(struct mv88e6xxx_chip *chip, int addr,
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> drivers/net/dsa/mv88e6xxx/global2.c:664:5: warning: no previous prototype for 'mv88e6xxx_g2_smi_phy_write_c22' [-Wmissing-prototypes]
>  int mv88e6xxx_g2_smi_phy_write_c22(struct mv88e6xxx_chip *chip, int addr,
>      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hi Florian

These are not used outside of global2.c. So just mark them static.

      Andrew

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

* Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n
  2017-04-06 14:04   ` Andrew Lunn
@ 2017-04-06 14:32     ` Florian Fainelli
  0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2017-04-06 14:32 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: netdev, David Miller



On 04/06/2017 07:04 AM, Andrew Lunn wrote:
> On Thu, Apr 06, 2017 at 06:47:35AM -0700, Florian Fainelli wrote:
>> When CONFIG_OF=n, we will see the following warning:
>>
>> drivers/net/dsa/mv88e6xxx/chip.c:2834:34: warning: 'mv88e6xxx_mdio_external_match' defined but not used [-Wunused-const-variable=]
>>  static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>>                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>>  drivers/net/dsa/mv88e6xxx/chip.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
>> index 44ba8cff5631..64cbc4c04907 100644
>> --- a/drivers/net/dsa/mv88e6xxx/chip.c
>> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
>> @@ -2831,11 +2831,13 @@ static int mv88e6xxx_mdio_register(struct mv88e6xxx_chip *chip,
>>  	return 0;
>>  }
>>  
>> +#ifdef CONFIG_OF
>>  static const struct of_device_id mv88e6xxx_mdio_external_match[] = {
>>  	{ .compatible = "marvell,mv88e6xxx-mdio-external",
>>  	  .data = (void *)true },
>>  	{ },
>>  };
>> +#endif

Hi Andrew,

> 
> Hi Florian
> 
> Maybe a better fix is to make the stub of of_match_node() an inline
> function, so its parameters are used. That will fix this warning
> everywhere in the kernel, not just in this driver.

Good point, this is just much better.

Thanks!
-- 
Florian

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

end of thread, other threads:[~2017-04-06 14:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-06 13:47 [PATCH net-next 0/2] net: dsa: mv88e6xxx: Fix a few build warnings Florian Fainelli
2017-04-06 13:47 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Fix warning with CONFIG_OF=n Florian Fainelli
2017-04-06 14:04   ` Andrew Lunn
2017-04-06 14:32     ` Florian Fainelli
2017-04-06 13:47 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Provide prototypes for SMI read/write functions Florian Fainelli
2017-04-06 14:07   ` Andrew Lunn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.