Skip to contentSkip to conversation

net: stmmac: fix warning from Sparse for socfpga

PATCH Superseded Ley Foon Tan 3 participants 7 messages Aug 26, 2014 – Aug 28, 2014

Subsystems (5)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: fix warning from Sparse for socfpga

Warning:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:41:
sparse: cast removes address space of expression drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:38:
sparse: incorrect type in assignment (different address spaces)

---
 drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
index cd613d7..c1addce 100644
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
 			return -EINVAL;
 		}
 
-		dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+		dwmac->splitter_base =
+			(void __iomem *)devm_ioremap_resource(dev,
 			&res_splitter);
 		if (!dwmac->splitter_base) {
 			dev_info(dev, "Failed to mapping emac splitter\n");
Signature · 1 line
1.8.2.1
#1 lore raw
Quoted 16 lines · Ley Foon Tan

Warning:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:41:
sparse: cast removes address space of expression drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:38:
sparse: incorrect type in assignment (different address spaces)

---
  drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +0 -0
index cd613d7..c1addce 100644

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · line 123

Quoted 6 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
  			return -EINVAL;
  		}
 
-		dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+		dwmac->splitter_base =
+			(void __iomem *)devm_ioremap_resource(dev,

I think, no casting should be done:

dwmac->splitter_base = devm_ioremap_resource(dev, ....

patch should be for net-next

peppe

Quoted 4 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +0 -0
  			&res_splitter);
  		if (!dwmac->splitter_base) {
  			dev_info(dev, "Failed to mapping emac splitter\n");
#2 lore raw
Quoted 5 lines · Giuseppe CAVALLARO
Quoted 5 lines
(quoted diff) +0 -0
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct

socfpga_dwmac *dwmac, struct device *

                        return -EINVAL;
                }
Quoted 8 lines

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · line 123

Quoted 3 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
-               dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+               dwmac->splitter_base =
+                       (void __iomem *)devm_ioremap_resource(dev,

I think, no casting should be done:

   dwmac->splitter_base = devm_ioremap_resource(dev, ....

Oh ya, since both are same type. Will send new patch.

Quoted 2 lines

patch should be for net-next

Do you mean the patch need based on net-next git?
I'm using linux-next git now.

Thanks.

Regards
Ley Foon

#3 lore raw
Quoted 14 lines · Ley Foon Tan
Quoted 12 lines · Giuseppe CAVALLARO

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · line 123

Quoted 8 lines
(quoted diff) +0 -0
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct

socfpga_dwmac *dwmac, struct device *

                         return -EINVAL;
                 }
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
-               dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+               dwmac->splitter_base =
+                       (void __iomem *)devm_ioremap_resource(dev,

I think, no casting should be done:

Quoted 2 lines
Quoted 1 line
    dwmac->splitter_base = devm_ioremap_resource(dev, ....

Oh ya, since both are same type. Will send new patch.

thx a lot

Quoted 4 lines
Quoted 3 lines

patch should be for net-next

Do you mean the patch need based on net-next git?

yes I do.

Quoted 1 line

I'm using linux-next git now.

ok, can you signal it in the subject (e.g. [PATCH (net-next)] This can help on reviewing and IIRC required by Maintainer too

Quoted 2 lines

Thanks.

welcome

BR
peppe

Quoted 4 lines

Regards
Ley Foon

#4 lore raw
Quoted 4 lines · Giuseppe CAVALLARO
Quoted 4 lines
Quoted 4 lines

patch should be for net-next

Quoted 8 lines
Quoted 1 line

Do you mean the patch need based on net-next git?

yes I do.

Quoted 1 line

I'm using linux-next git now.

ok, can you signal it in the subject (e.g. [PATCH (net-next)] This can help on reviewing and IIRC required by Maintainer too

Sure, will do it in next revision.

Thanks.

Regards
Ley Foon

maintainer
#5 lore raw
In reply to Ley Foon Tan

From: Ley Foon Tan <[email protected]>
Date: Tue, 26 Aug 2014 15:11:16 +0800

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · line 124

Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
 			return -EINVAL;
 		}
 
-		dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+		dwmac->splitter_base =
+			(void __iomem *)devm_ioremap_resource(dev,
 			&res_splitter);

Please either put this entire call on one line (it'll only be slightly over 80 columns, which is fine), or indent it properly.

And by properly I meant that the second and subsequent lines of a function call must be indented precisely to the first column after the openning parenthesis of the function call on the first line. You must use the appropriate number of TAB and SPACE characters necessary to do so.

If it is indented using only TAB characters, it is very likely that you are doing it wrong.

Thanks.

#6 lore raw
Quoted 15 lines · David Miller

From: Ley Foon Tan <[email protected]>
Date: Tue, 26 Aug 2014 15:11:16 +0800

drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device * · line 124

Quoted 8 lines
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +2 -1
@@ -119,7 +119,8 @@ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *
                      return -EINVAL;
              }
 
-             dwmac->splitter_base = (void *)devm_ioremap_resource(dev,
+             dwmac->splitter_base =
+                     (void __iomem *)devm_ioremap_resource(dev,
                      &res_splitter);

Please either put this entire call on one line (it'll only be slightly over 80 columns, which is fine), or indent it properly.

Quoted 7 lines

And by properly I meant that the second and subsequent lines of a function call must be indented precisely to the first column after the openning parenthesis of the function call on the first line. You must use the appropriate number of TAB and SPACE characters necessary to do so.

If it is indented using only TAB characters, it is very likely that you are doing it wrong.

Okay, will send in new patch to fix this.
Thanks.