Skip to contentSkip to conversation

USB: serial: iuu_phoenix: remove redundant assignment of DIV to itself

PATCH In review Colin King 3 participants 4 messages Nov 20, 2017 – Nov 27, 2017

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 USB: serial: iuu_phoenix: remove redundant assignment of DIV to itself

From: Colin Ian King <[email protected]>

The assignment of DIV to itself is redundant and can be removed.

---
 drivers/usb/serial/iuu_phoenix.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/serial/iuu_phoenix.c +0 -1
index 397a8012ffa3..62c91e360baf 100644
@@ -472,7 +472,6 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
 				}
 	}
 	P2 = ((P - PO) / 2) - 4;
-	DIV = DIV;
 	PUMP = 0x04;
 	PBmsb = (P2 >> 8 & 0x03);
 	PBlsb = P2 & 0xFF;
Signature · 1 line
2.14.1
#1 lore raw

Am 20.11.2017 18:40, schrieb Colin King:

Quoted 14 lines

From: Colin Ian King <[email protected]>

The assignment of DIV to itself is redundant and can be removed.

---
 drivers/usb/serial/iuu_phoenix.c | 1 -
 1 file changed, 1 deletion(-)
drivers/usb/serial/iuu_phoenix.c +0 -0
index 397a8012ffa3..62c91e360baf 100644

drivers/usb/serial/iuu_phoenix.c static int iuu_clk(struct usb_serial_port *port, int dwFrq) · line 477

Quoted 7 lines
drivers/usb/serial/iuu_phoenix.c +0 -1
@@ -472,7 +472,6 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
 				}
 	}
 	P2 = ((P - PO) / 2) - 4;
-	DIV = DIV;
 	PUMP = 0x04;
 	PBmsb = (P2 >> 8 & 0x03);
 	PBlsb = P2 & 0xFF;

These all all-upper-case stuff makes me a bit nervous. Normally this is reserved for #define ( I assume that the programmer refers to the original documentation) a point to change ?

btw: i noticed int frq = (int)dwFrq; since dwFrq is already an in, the cast is useless.

just ym 2 cents,

re,
wh

maintainer
#2 lore raw
Quoted 10 lines · walter harms

Am 20.11.2017 18:40, schrieb Colin King:

Quoted 9 lines

From: Colin Ian King <[email protected]>

The assignment of DIV to itself is redundant and can be removed.

---
 drivers/usb/serial/iuu_phoenix.c | 1 -
 1 file changed, 1 deletion(-)
Quoted 16 lines

drivers/usb/serial/iuu_phoenix.c static int iuu_clk(struct usb_serial_port *port, int dwFrq) · line 477

Quoted 12 lines
drivers/usb/serial/iuu_phoenix.c +0 -1
index 397a8012ffa3..62c91e360baf 100644
@@ -472,7 +472,6 @@ static int iuu_clk(struct usb_serial_port *port, int dwFrq)
 				}
 	}
 	P2 = ((P - PO) / 2) - 4;
-	DIV = DIV;
 	PUMP = 0x04;
 	PBmsb = (P2 >> 8 & 0x03);
 	PBlsb = P2 & 0xFF;

These all all-upper-case stuff makes me a bit nervous. Normally this is reserved for #define ( I assume that the programmer refers to the original documentation) a point to change ?

Yeah, this isn't pretty and appears to have been copied directly from the iuutool userspace tool (mentioned in the header).

Quoted 2 lines

btw: i noticed int frq = (int)dwFrq; since dwFrq is already an in, the cast is useless.

Indeed. Also present in original code.

This driver went in marked as "experimental", but the dependency on CONFIG_EXPERIMENTAL was later dropped. These days something like this would have need to be cleaned up (e.g. in staging) before getting merged.

Johan