Skip to contentSkip to conversation

phy: tegra: Remote self cast in tegra_xusb_port_find_lane

PATCH Superseded Nathan Chancellor 1 participant 1 message Apr 1, 2018

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: tegra: Remote self cast in tegra_xusb_port_find_lane

Clang warns about casting variables to themselves because it is rarely necessary. Removing the cast should not change anything regarding the code and silences the warning.

../drivers/phy/tegra/xusb.c:421:11: warning: explicitly assigning value of variable of type 'const struct tegra_xusb_lane_map *' to itself [-Wself-assign]

        for (map = map; map->type; map++) {
             ~~~ ^ ~~~

---
I am not entirely sure if this is the correct solution, especially since I don't have the hardware and I am not too familiar with this code. If there is a better solution, please let me know.

 drivers/phy/tegra/xusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/tegra/xusb.c +1 -1
index 63e916d4d069..11aa5902a9ac 100644
@@ -418,7 +418,7 @@ tegra_xusb_port_find_lane(struct tegra_xusb_port *port,
 {
 	struct tegra_xusb_lane *lane, *match = ERR_PTR(-ENODEV);
 
-	for (map = map; map->type; map++) {
+	for (; map->type; map++) {
 		if (port->index != map->port)
 			continue;
 
Signature · 1 line
2.16.3