brcmfmac: use strreplace() in brcmf_of_probe()
PATCH 1/1 brcmfmac: use strreplace() in brcmf_of_probe()
The for loop in brcmf_of_probe() would ideally end with something like "i <= strlen(board_type)" instead of "i < board_type[i]". But fortunately, the two are equivalent.
Anyway, it's simpler to use strreplace() instead.
---
I sent something like this last year but I did something wrong and it never made it patchwork. This is basically a new patch.
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +1 -5
@@ -72,7 +72,6 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,/* Set board-type to the first string of the machine compatible prop */ root =of_find_node_by_path ("/" );if (root) { -int i;char *board_type;const char *tmp;
@@ -84,10 +83,7 @@ void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type,of_node_put (root);return ; } -for (i =0 ; i < board_type[i]; i++) { -if (board_type[i] =='/' ) - board_type[i] ='-' ; - } +strreplace (board_type,'/' ,'-' ); settings->board_type = board_type;of_node_put (root);
Signature · 1 line
2.35.1
Quoted 8 lines · Dan Carpenter
The for loop in
brcmf_of_probe()would ideally end with something like "i <=strlen(board_type)" instead of "i < board_type[i]". But fortunately, the two are equivalent.Anyway, it's simpler to use
strreplace()instead.Signed-off-by Dan Carpenter <[email protected]>Suggested-by Johannes Berg <[email protected]>
Yours,
Linus Walleij
Quoted 5 lines · Dan Carpenter
The for loop in
brcmf_of_probe()would ideally end with something like "i <=strlen(board_type)" instead of "i < board_type[i]". But fortunately, the two are equivalent.Anyway, it's simpler to use
strreplace()instead.
Quoted 8 lines
Signed-off-by Dan Carpenter <[email protected]>Suggested-by Johannes Berg <[email protected]>---
I sent something like this last year but I did something wrong and it never made it patchwork. This is basically a new patch.drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
Re: wifi: brcmfmac: use strreplace() in brcmf_of_probe()
In reply to Dan CarpenterQuoted 10 lines · Dan Carpenter
The for loop in
brcmf_of_probe()would ideally end with something like "i <=strlen(board_type)" instead of "i < board_type[i]". But fortunately, the two are equivalent.Anyway, it's simpler to use
strreplace()instead.Signed-off-by Dan Carpenter <[email protected]>Suggested-by Johannes Berg <[email protected]>Reviewed-by Linus Walleij <[email protected]>Acked-by Arend van Spriel <[email protected]>
Patch applied to wireless-next.git, thanks.
bef11f1edc40 wifi: brcmfmac: use strreplace() in brcmf_of_probe()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/YqrhsKcjEA7B2pC4@kili/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches