net: stmmac: fix warning from Sparse for socfpga
Subsystems (5)
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
@@ -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
Quoted 16 lines · Ley Foon Tan
Warning:
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:41:
sparse: cast removes address space of expressiondrivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c:122:38:
sparse: incorrect type in assignment (different address spaces)Signed-off-by Ley Foon Tan <[email protected]>--- 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
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" );
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
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
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
David Miller
maintainerFrom: 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.
Quoted 15 lines · David Miller
From: Ley Foon Tan <[email protected]>
Date: Tue, 26 Aug 2014 15:11:16 +0800drivers/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.