Commit deb55e40 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Johan Hovold

USB: serial: io_edgeport: fix up switch fall-through comments

Gustavo has been working to fix up all of the switch statements that
"fall through" such that we can eventually turn on
-Wimplicit-fallthrough.  As part of that, the io_edgeport.c driver is a
bit "messy" with the parsing logic of a data packet.  Clean that logic
up a bit by unindenting one level of the logic, and properly label
/* Fall through */ to make gcc happy.
Reported-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: default avatarGustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 80ed5370
......@@ -1751,7 +1751,7 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
edge_serial->rxState = EXPECT_HDR2;
break;
}
/* otherwise, drop on through */
/* Fall through */
case EXPECT_HDR2:
edge_serial->rxHeader2 = *buffer;
++buffer;
......@@ -1790,29 +1790,20 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
edge_serial->rxHeader2, 0);
edge_serial->rxState = EXPECT_HDR1;
break;
} else {
edge_serial->rxPort =
IOSP_GET_HDR_PORT(edge_serial->rxHeader1);
edge_serial->rxBytesRemaining =
IOSP_GET_HDR_DATA_LEN(
edge_serial->rxHeader1,
edge_serial->rxHeader2);
dev_dbg(dev, "%s - Data for Port %u Len %u\n",
__func__,
edge_serial->rxPort,
edge_serial->rxBytesRemaining);
/* ASSERT(DevExt->RxPort < DevExt->NumPorts);
* ASSERT(DevExt->RxBytesRemaining <
* IOSP_MAX_DATA_LENGTH);
*/
if (bufferLength == 0) {
edge_serial->rxState = EXPECT_DATA;
break;
}
/* Else, drop through */
}
edge_serial->rxPort = IOSP_GET_HDR_PORT(edge_serial->rxHeader1);
edge_serial->rxBytesRemaining = IOSP_GET_HDR_DATA_LEN(edge_serial->rxHeader1,
edge_serial->rxHeader2);
dev_dbg(dev, "%s - Data for Port %u Len %u\n", __func__,
edge_serial->rxPort,
edge_serial->rxBytesRemaining);
if (bufferLength == 0) {
edge_serial->rxState = EXPECT_DATA;
break;
}
/* Fall through */
case EXPECT_DATA: /* Expect data */
if (bufferLength < edge_serial->rxBytesRemaining) {
rxLen = bufferLength;
......
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