Commit 232dce89 authored by Geyslan G. Bem's avatar Geyslan G. Bem Committed by Johan Hovold

USB: io_edgeport: remove redundant conditions

This patch removes redundant conditions.

 (!A || (A && B)) is the same as (!A || B).

Tested by compilation only.
Caught by cppcheck.
Signed-off-by: default avatarGeyslan G. Bem <geyslan@gmail.com>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 6f923a01
...@@ -1046,9 +1046,8 @@ static void edge_close(struct usb_serial_port *port) ...@@ -1046,9 +1046,8 @@ static void edge_close(struct usb_serial_port *port)
edge_port->closePending = true; edge_port->closePending = true;
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPChase) {
(edge_serial->epic_descriptor.Supports.IOSPChase))) {
/* flush and chase */ /* flush and chase */
edge_port->chaseResponsePending = true; edge_port->chaseResponsePending = true;
...@@ -1061,9 +1060,8 @@ static void edge_close(struct usb_serial_port *port) ...@@ -1061,9 +1060,8 @@ static void edge_close(struct usb_serial_port *port)
edge_port->chaseResponsePending = false; edge_port->chaseResponsePending = false;
} }
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPClose) {
(edge_serial->epic_descriptor.Supports.IOSPClose))) {
/* close the port */ /* close the port */
dev_dbg(&port->dev, "%s - Sending IOSP_CMD_CLOSE_PORT\n", __func__); dev_dbg(&port->dev, "%s - Sending IOSP_CMD_CLOSE_PORT\n", __func__);
send_iosp_ext_cmd(edge_port, IOSP_CMD_CLOSE_PORT, 0); send_iosp_ext_cmd(edge_port, IOSP_CMD_CLOSE_PORT, 0);
...@@ -1612,9 +1610,8 @@ static void edge_break(struct tty_struct *tty, int break_state) ...@@ -1612,9 +1610,8 @@ static void edge_break(struct tty_struct *tty, int break_state)
struct edgeport_serial *edge_serial = usb_get_serial_data(port->serial); struct edgeport_serial *edge_serial = usb_get_serial_data(port->serial);
int status; int status;
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPChase) {
(edge_serial->epic_descriptor.Supports.IOSPChase))) {
/* flush and chase */ /* flush and chase */
edge_port->chaseResponsePending = true; edge_port->chaseResponsePending = true;
...@@ -1628,9 +1625,8 @@ static void edge_break(struct tty_struct *tty, int break_state) ...@@ -1628,9 +1625,8 @@ static void edge_break(struct tty_struct *tty, int break_state)
} }
} }
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPSetClrBreak) {
(edge_serial->epic_descriptor.Supports.IOSPSetClrBreak))) {
if (break_state == -1) { if (break_state == -1) {
dev_dbg(&port->dev, "%s - Sending IOSP_CMD_SET_BREAK\n", __func__); dev_dbg(&port->dev, "%s - Sending IOSP_CMD_SET_BREAK\n", __func__);
status = send_iosp_ext_cmd(edge_port, status = send_iosp_ext_cmd(edge_port,
...@@ -2465,9 +2461,8 @@ static void change_port_settings(struct tty_struct *tty, ...@@ -2465,9 +2461,8 @@ static void change_port_settings(struct tty_struct *tty,
unsigned char stop_char = STOP_CHAR(tty); unsigned char stop_char = STOP_CHAR(tty);
unsigned char start_char = START_CHAR(tty); unsigned char start_char = START_CHAR(tty);
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPSetXChar) {
(edge_serial->epic_descriptor.Supports.IOSPSetXChar))) {
send_iosp_ext_cmd(edge_port, send_iosp_ext_cmd(edge_port,
IOSP_CMD_SET_XON_CHAR, start_char); IOSP_CMD_SET_XON_CHAR, start_char);
send_iosp_ext_cmd(edge_port, send_iosp_ext_cmd(edge_port,
...@@ -2494,13 +2489,11 @@ static void change_port_settings(struct tty_struct *tty, ...@@ -2494,13 +2489,11 @@ static void change_port_settings(struct tty_struct *tty,
} }
/* Set flow control to the configured value */ /* Set flow control to the configured value */
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPSetRxFlow)
(edge_serial->epic_descriptor.Supports.IOSPSetRxFlow)))
send_iosp_ext_cmd(edge_port, IOSP_CMD_SET_RX_FLOW, rxFlow); send_iosp_ext_cmd(edge_port, IOSP_CMD_SET_RX_FLOW, rxFlow);
if ((!edge_serial->is_epic) || if (!edge_serial->is_epic ||
((edge_serial->is_epic) && edge_serial->epic_descriptor.Supports.IOSPSetTxFlow)
(edge_serial->epic_descriptor.Supports.IOSPSetTxFlow)))
send_iosp_ext_cmd(edge_port, IOSP_CMD_SET_TX_FLOW, txFlow); send_iosp_ext_cmd(edge_port, IOSP_CMD_SET_TX_FLOW, txFlow);
......
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