All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net 0/2] net: bgmac: Couple of sparse warnings
@ 2018-04-01 17:26 Florian Fainelli
  2018-04-01 17:26 ` [PATCH net 1/2] net: bgmac: Correctly annotate register space Florian Fainelli
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Florian Fainelli @ 2018-04-01 17:26 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Scott Branden, Andrew Lunn,
	Abhishek Shah, Ray Jui, open list, jon.mason, nbd

Hi all,

This patch series fixes a couple of warnings reported by sparse, should not
cause any functional problems since bgmac is typically used on LE platforms
anyway.

Florian Fainelli (2):
  net: bgmac: Correctly annotate register space
  net: bgmac: Fix endian access in bgmac_dma_tx_ring_free()

 drivers/net/ethernet/broadcom/bgmac.c | 3 ++-
 drivers/net/ethernet/broadcom/bgmac.h | 6 +++---
 2 files changed, 5 insertions(+), 4 deletions(-)

-- 
2.14.1

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

* [PATCH net 1/2] net: bgmac: Correctly annotate register space
  2018-04-01 17:26 [PATCH net 0/2] net: bgmac: Couple of sparse warnings Florian Fainelli
@ 2018-04-01 17:26 ` Florian Fainelli
  2018-04-05  1:33     ` Sasha Levin
  2018-04-01 17:26 ` [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free() Florian Fainelli
  2018-04-02  2:21 ` [PATCH net 0/2] net: bgmac: Couple of sparse warnings David Miller
  2 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2018-04-01 17:26 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Scott Branden, Andrew Lunn,
	Abhishek Shah, Ray Jui, open list, jon.mason, nbd

All the members: base, idm_base and nicpm_base should be annotated with
__iomem since they are pointers to register space. This fixes a bunch of
sparse reported warnings.

Fixes: f6a95a24957a ("net: ethernet: bgmac: Add platform device support")
Fixes: dd5c5d037f5e ("net: ethernet: bgmac: add NS2 support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
index 4040d846da8e..40d02fec2747 100644
--- a/drivers/net/ethernet/broadcom/bgmac.h
+++ b/drivers/net/ethernet/broadcom/bgmac.h
@@ -479,9 +479,9 @@ struct bgmac_rx_header {
 struct bgmac {
 	union {
 		struct {
-			void *base;
-			void *idm_base;
-			void *nicpm_base;
+			void __iomem *base;
+			void __iomem *idm_base;
+			void __iomem *nicpm_base;
 		} plat;
 		struct {
 			struct bcma_device *core;
-- 
2.14.1

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

* [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free()
  2018-04-01 17:26 [PATCH net 0/2] net: bgmac: Couple of sparse warnings Florian Fainelli
  2018-04-01 17:26 ` [PATCH net 1/2] net: bgmac: Correctly annotate register space Florian Fainelli
@ 2018-04-01 17:26 ` Florian Fainelli
  2018-04-05  1:33     ` Sasha Levin
  2018-04-02  2:21 ` [PATCH net 0/2] net: bgmac: Couple of sparse warnings David Miller
  2 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2018-04-01 17:26 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, David S. Miller, Scott Branden, Andrew Lunn,
	Abhishek Shah, Ray Jui, open list, jon.mason, nbd

bgmac_dma_tx_ring_free() assigns the ctl1 word which is a litle endian
32-bit word without using proper accessors, fix this, and because a
length cannot be negative, use unsigned int while at it.

Fixes: 9cde94506eac ("bgmac: implement scatter/gather support")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/net/ethernet/broadcom/bgmac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c
index 8eef9fb6b1fe..ad8195b0d161 100644
--- a/drivers/net/ethernet/broadcom/bgmac.c
+++ b/drivers/net/ethernet/broadcom/bgmac.c
@@ -533,7 +533,8 @@ static void bgmac_dma_tx_ring_free(struct bgmac *bgmac,
 	int i;
 
 	for (i = 0; i < BGMAC_TX_RING_SLOTS; i++) {
-		int len = dma_desc[i].ctl1 & BGMAC_DESC_CTL1_LEN;
+		u32 ctl1 = le32_to_cpu(dma_desc[i].ctl1);
+		unsigned int len = ctl1 & BGMAC_DESC_CTL1_LEN;
 
 		slot = &ring->slots[i];
 		dev_kfree_skb(slot->skb);
-- 
2.14.1

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

* Re: [PATCH net 0/2] net: bgmac: Couple of sparse warnings
  2018-04-01 17:26 [PATCH net 0/2] net: bgmac: Couple of sparse warnings Florian Fainelli
  2018-04-01 17:26 ` [PATCH net 1/2] net: bgmac: Correctly annotate register space Florian Fainelli
  2018-04-01 17:26 ` [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free() Florian Fainelli
@ 2018-04-02  2:21 ` David Miller
  2018-04-02 17:17   ` Florian Fainelli
  2 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2018-04-02  2:21 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, scott.branden, andrew, abhishek.shah, ray.jui,
	linux-kernel, jon.mason, nbd

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Sun,  1 Apr 2018 10:26:28 -0700

> This patch series fixes a couple of warnings reported by sparse, should not
> cause any functional problems since bgmac is typically used on LE platforms
> anyway.

Series applied, thanks Florian.

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

* Re: [PATCH net 0/2] net: bgmac: Couple of sparse warnings
  2018-04-02  2:21 ` [PATCH net 0/2] net: bgmac: Couple of sparse warnings David Miller
@ 2018-04-02 17:17   ` Florian Fainelli
  2018-04-02 17:18     ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Florian Fainelli @ 2018-04-02 17:17 UTC (permalink / raw)
  To: David Miller
  Cc: netdev, scott.branden, andrew, abhishek.shah, ray.jui,
	linux-kernel, jon.mason, nbd

On 04/01/2018 07:21 PM, David Miller wrote:
> From: Florian Fainelli <f.fainelli@gmail.com>
> Date: Sun,  1 Apr 2018 10:26:28 -0700
> 
>> This patch series fixes a couple of warnings reported by sparse, should not
>> cause any functional problems since bgmac is typically used on LE platforms
>> anyway.
> 
> Series applied, thanks Florian.

I did not see this in net/master or included in your recent pull request
to Linus, not a big deal, but I just want to make sure this is not lost
somewhere ;)
-- 
Florian

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

* Re: [PATCH net 0/2] net: bgmac: Couple of sparse warnings
  2018-04-02 17:17   ` Florian Fainelli
@ 2018-04-02 17:18     ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2018-04-02 17:18 UTC (permalink / raw)
  To: f.fainelli
  Cc: netdev, scott.branden, andrew, abhishek.shah, ray.jui,
	linux-kernel, jon.mason, nbd

From: Florian Fainelli <f.fainelli@gmail.com>
Date: Mon, 2 Apr 2018 10:17:36 -0700

> On 04/01/2018 07:21 PM, David Miller wrote:
>> From: Florian Fainelli <f.fainelli@gmail.com>
>> Date: Sun,  1 Apr 2018 10:26:28 -0700
>> 
>>> This patch series fixes a couple of warnings reported by sparse, should not
>>> cause any functional problems since bgmac is typically used on LE platforms
>>> anyway.
>> 
>> Series applied, thanks Florian.
> 
> I did not see this in net/master or included in your recent pull request
> to Linus, not a big deal, but I just want to make sure this is not lost
> somewhere ;)

All changes go into net-next as I prepare for a merge window pull request.

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

* Re: [PATCH net 1/2] net: bgmac: Correctly annotate register space
  2018-04-01 17:26 ` [PATCH net 1/2] net: bgmac: Correctly annotate register space Florian Fainelli
@ 2018-04-05  1:33     ` Sasha Levin
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2018-04-05  1:33 UTC (permalink / raw)
  To: Sasha Levin, Florian Fainelli, netdev; +Cc: Florian Fainelli, stable

Hi Florian Fainelli.

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag.
fixing commit: f6a95a24957a net: ethernet: bgmac: Add platform device support.

The bot has also determined it's probably a bug fixing patch. (score: 67.8237)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Failed to apply! Possible dependencies:
    dd5c5d037f5e: ("net: ethernet: bgmac: add NS2 support")
    1676aba5ef7e: ("net: ethernet: bgmac: device tree phy enablement")

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

* Re: [PATCH net 1/2] net: bgmac: Correctly annotate register space
@ 2018-04-05  1:33     ` Sasha Levin
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2018-04-05  1:33 UTC (permalink / raw)
  To: Sasha Levin, Florian Fainelli, netdev; +Cc: Florian Fainelli, stable

Hi Florian Fainelli.

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag.
fixing commit: f6a95a24957a net: ethernet: bgmac: Add platform device support.

The bot has also determined it's probably a bug fixing patch. (score: 67.8237)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Failed to apply! Possible dependencies:
    dd5c5d037f5e: ("net: ethernet: bgmac: add NS2 support")
    1676aba5ef7e: ("net: ethernet: bgmac: device tree phy enablement")


--
Thanks.
Sasha

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

* Re: [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free()
  2018-04-01 17:26 ` [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free() Florian Fainelli
@ 2018-04-05  1:33     ` Sasha Levin
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2018-04-05  1:33 UTC (permalink / raw)
  To: Sasha Levin, Florian Fainelli, netdev; +Cc: Florian Fainelli, stable

Hi Florian Fainelli.

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag.
fixing commit: 9cde94506eac bgmac: implement scatter/gather support.

The bot has also determined it's probably a bug fixing patch. (score: 45.9160)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, v4.4.126, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Build OK!
v4.4.126: Build OK!

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

* Re: [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free()
@ 2018-04-05  1:33     ` Sasha Levin
  0 siblings, 0 replies; 10+ messages in thread
From: Sasha Levin @ 2018-04-05  1:33 UTC (permalink / raw)
  To: Sasha Levin, Florian Fainelli, netdev; +Cc: Florian Fainelli, stable

Hi Florian Fainelli.

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag.
fixing commit: 9cde94506eac bgmac: implement scatter/gather support.

The bot has also determined it's probably a bug fixing patch. (score: 45.9160)

The bot has tested the following trees: v4.15.15, v4.14.32, v4.9.92, v4.4.126, 

v4.15.15: Build OK!
v4.14.32: Build OK!
v4.9.92: Build OK!
v4.4.126: Build OK!

--
Thanks.
Sasha

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

end of thread, other threads:[~2018-04-05  1:34 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-01 17:26 [PATCH net 0/2] net: bgmac: Couple of sparse warnings Florian Fainelli
2018-04-01 17:26 ` [PATCH net 1/2] net: bgmac: Correctly annotate register space Florian Fainelli
2018-04-05  1:33   ` Sasha Levin
2018-04-05  1:33     ` Sasha Levin
2018-04-01 17:26 ` [PATCH net 2/2] net: bgmac: Fix endian access in bgmac_dma_tx_ring_free() Florian Fainelli
2018-04-05  1:33   ` Sasha Levin
2018-04-05  1:33     ` Sasha Levin
2018-04-02  2:21 ` [PATCH net 0/2] net: bgmac: Couple of sparse warnings David Miller
2018-04-02 17:17   ` Florian Fainelli
2018-04-02 17:18     ` David Miller

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.