Commit cdd0a379 authored by Alex Dewar's avatar Alex Dewar Committed by David S. Miller

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: 36cfd3a6 ("net: mvpp2: restructure "link status" interrupt handling")
Signed-off-by: default avatarAlex Dewar <alex.dewar90@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 45677bc6
......@@ -3070,8 +3070,7 @@ static void mvpp2_isr_handle_xlg(struct mvpp2_port *port)
val = readl(port->base + MVPP22_XLG_INT_STAT);
if (val & MVPP22_XLG_INT_STAT_LINK) {
val = readl(port->base + MVPP22_XLG_STATUS);
if (val & MVPP22_XLG_STATUS_LINK_UP)
link = true;
link = (val & MVPP22_XLG_STATUS_LINK_UP);
mvpp2_isr_handle_link(port, link);
}
}
......@@ -3087,8 +3086,7 @@ static void mvpp2_isr_handle_gmac_internal(struct mvpp2_port *port)
val = readl(port->base + MVPP22_GMAC_INT_STAT);
if (val & MVPP22_GMAC_INT_STAT_LINK) {
val = readl(port->base + MVPP2_GMAC_STATUS0);
if (val & MVPP2_GMAC_STATUS0_LINK_UP)
link = true;
link = (val & MVPP2_GMAC_STATUS0_LINK_UP);
mvpp2_isr_handle_link(port, link);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment