Skip to content

Commit cdd0a37

Browse files
alexdewardavem330
authored andcommitted
net: mvpp2: ptp: Fix unused variables
In the functions mvpp2_isr_handle_xlg() and mvpp2_isr_handle_gmac_internal(), the bool variable link is assigned a true value in the case that a given bit of val is set. However, if the bit is unset, no value is assigned to link and it is then passed to mvpp2_isr_handle_link() without being initialised. Fix by assigning to link the value of the bit test. Build-tested on x86. Fixes: 36cfd3a ("net: mvpp2: restructure "link status" interrupt handling") Signed-off-by: Alex Dewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 45677bc commit cdd0a37

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3070,8 +3070,7 @@ static void mvpp2_isr_handle_xlg(struct mvpp2_port *port)
30703070
val = readl(port->base + MVPP22_XLG_INT_STAT);
30713071
if (val & MVPP22_XLG_INT_STAT_LINK) {
30723072
val = readl(port->base + MVPP22_XLG_STATUS);
3073-
if (val & MVPP22_XLG_STATUS_LINK_UP)
3074-
link = true;
3073+
link = (val & MVPP22_XLG_STATUS_LINK_UP);
30753074
mvpp2_isr_handle_link(port, link);
30763075
}
30773076
}
@@ -3087,8 +3086,7 @@ static void mvpp2_isr_handle_gmac_internal(struct mvpp2_port *port)
30873086
val = readl(port->base + MVPP22_GMAC_INT_STAT);
30883087
if (val & MVPP22_GMAC_INT_STAT_LINK) {
30893088
val = readl(port->base + MVPP2_GMAC_STATUS0);
3090-
if (val & MVPP2_GMAC_STATUS0_LINK_UP)
3091-
link = true;
3089+
link = (val & MVPP2_GMAC_STATUS0_LINK_UP);
30923090
mvpp2_isr_handle_link(port, link);
30933091
}
30943092
}

0 commit comments

Comments
 (0)