All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v1 1/1] net: ag71xx: fix discards 'const' qualifier warning
@ 2022-06-16 11:37 Oleksij Rempel
  2022-06-17 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Oleksij Rempel @ 2022-06-16 11:37 UTC (permalink / raw)
  To: Chris Snook, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Oleksij Rempel, kernel, linux-kernel, netdev

Current kernel will compile this driver with warnings. This patch will
fix it.

drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_fast_reset':
drivers/net/ethernet/atheros/ag71xx.c:996:31: warning: passing argument 2 of 'ag71xx_hw_set
_macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  996 |  ag71xx_hw_set_macaddr(ag, dev->dev_addr);
      |                            ~~~^~~~~~~~~~
drivers/net/ethernet/atheros/ag71xx.c:951:69: note: expected 'unsigned char *' but argument
 is of type 'const unsigned char *'
  951 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
      |                                                      ~~~~~~~~~~~~~~~^~~
drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_open':
drivers/net/ethernet/atheros/ag71xx.c:1441:32: warning: passing argument 2 of 'ag71xx_hw_se
t_macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
 1441 |  ag71xx_hw_set_macaddr(ag, ndev->dev_addr);
      |                            ~~~~^~~~~~~~~~
drivers/net/ethernet/atheros/ag71xx.c:951:69: note: expected 'unsigned char *' but argument
 is of type 'const unsigned char *'
  951 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
      |                                                      ~~~~~~~~~~~~~~~^~~

Fixes: adeef3e32146 ("net: constify netdev->dev_addr")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/ethernet/atheros/ag71xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/atheros/ag71xx.c b/drivers/net/ethernet/atheros/ag71xx.c
index cac509708e9d..1c6ea6766aa1 100644
--- a/drivers/net/ethernet/atheros/ag71xx.c
+++ b/drivers/net/ethernet/atheros/ag71xx.c
@@ -946,7 +946,7 @@ static unsigned int ag71xx_max_frame_len(unsigned int mtu)
 	return ETH_HLEN + VLAN_HLEN + mtu + ETH_FCS_LEN;
 }
 
-static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
+static void ag71xx_hw_set_macaddr(struct ag71xx *ag, const unsigned char *mac)
 {
 	u32 t;
 
-- 
2.30.2


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

* Re: [PATCH net-next v1 1/1] net: ag71xx: fix discards 'const' qualifier warning
  2022-06-16 11:37 [PATCH net-next v1 1/1] net: ag71xx: fix discards 'const' qualifier warning Oleksij Rempel
@ 2022-06-17 10:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-06-17 10:10 UTC (permalink / raw)
  To: Oleksij Rempel
  Cc: chris.snook, davem, edumazet, kuba, pabeni, kernel, linux-kernel, netdev

Hello:

This patch was applied to netdev/net-next.git (master)
by David S. Miller <davem@davemloft.net>:

On Thu, 16 Jun 2022 13:37:24 +0200 you wrote:
> Current kernel will compile this driver with warnings. This patch will
> fix it.
> 
> drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_fast_reset':
> drivers/net/ethernet/atheros/ag71xx.c:996:31: warning: passing argument 2 of 'ag71xx_hw_set
> _macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>   996 |  ag71xx_hw_set_macaddr(ag, dev->dev_addr);
>       |                            ~~~^~~~~~~~~~
> drivers/net/ethernet/atheros/ag71xx.c:951:69: note: expected 'unsigned char *' but argument
>  is of type 'const unsigned char *'
>   951 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
>       |                                                      ~~~~~~~~~~~~~~~^~~
> drivers/net/ethernet/atheros/ag71xx.c: In function 'ag71xx_open':
> drivers/net/ethernet/atheros/ag71xx.c:1441:32: warning: passing argument 2 of 'ag71xx_hw_se
> t_macaddr' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
>  1441 |  ag71xx_hw_set_macaddr(ag, ndev->dev_addr);
>       |                            ~~~~^~~~~~~~~~
> drivers/net/ethernet/atheros/ag71xx.c:951:69: note: expected 'unsigned char *' but argument
>  is of type 'const unsigned char *'
>   951 | static void ag71xx_hw_set_macaddr(struct ag71xx *ag, unsigned char *mac)
>       |                                                      ~~~~~~~~~~~~~~~^~~
> 
> [...]

Here is the summary with links:
  - [net-next,v1,1/1] net: ag71xx: fix discards 'const' qualifier warning
    https://git.kernel.org/netdev/net-next/c/225b0ed27e6a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-06-17 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16 11:37 [PATCH net-next v1 1/1] net: ag71xx: fix discards 'const' qualifier warning Oleksij Rempel
2022-06-17 10:10 ` patchwork-bot+netdevbpf

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.