Skip to contentSkip to conversation

USB: serial: ch341: use fix-width types consistently

PATCH In review Johan Hovold 2 participants 2 messages Jan 8, 2025

Subsystems (2)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 1/1 USB: serial: ch341: use fix-width types consistently

Use Linux fix-width types consistently and drop a related unnecessary cast.

---
 drivers/usb/serial/ch341.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/usb/serial/ch341.c +3 -4
index ac74b353b26d..7cc36f84821f 100644
@@ -660,13 +660,12 @@ static int ch341_simulate_break(struct tty_struct *tty, int break_state)
 
 static int ch341_break_ctl(struct tty_struct *tty, int break_state)
 {
-	const uint16_t ch341_break_reg =
-			((uint16_t) CH341_REG_LCR << 8) | CH341_REG_BREAK;
+	const u16 ch341_break_reg = (CH341_REG_LCR << 8) | CH341_REG_BREAK;
 	struct usb_serial_port *port = tty->driver_data;
 	struct ch341_private *priv = usb_get_serial_port_data(port);
+	u16 reg_contents;
+	u8 break_reg[2];
 	int r;
-	uint16_t reg_contents;
-	uint8_t break_reg[2];
 
 	if (priv->quirks & CH341_QUIRK_SIMULATE_BREAK)
 		return ch341_simulate_break(tty, break_state);
Signature · 1 line
2.45.2
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 33 lines · Johan Hovold

Use Linux fix-width types consistently and drop a related unnecessary cast.

---
 drivers/usb/serial/ch341.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/usb/serial/ch341.c +3 -4
index ac74b353b26d..7cc36f84821f 100644
@@ -660,13 +660,12 @@ static int ch341_simulate_break(struct tty_struct *tty, int break_state)
 
 static int ch341_break_ctl(struct tty_struct *tty, int break_state)
 {
-	const uint16_t ch341_break_reg =
-			((uint16_t) CH341_REG_LCR << 8) | CH341_REG_BREAK;
+	const u16 ch341_break_reg = (CH341_REG_LCR << 8) | CH341_REG_BREAK;
 	struct usb_serial_port *port = tty->driver_data;
 	struct ch341_private *priv = usb_get_serial_port_data(port);
+	u16 reg_contents;
+	u8 break_reg[2];
 	int r;
-	uint16_t reg_contents;
-	uint8_t break_reg[2];
 
 	if (priv->quirks & CH341_QUIRK_SIMULATE_BREAK)
 		return ch341_simulate_break(tty, break_state);
Signature · 1 line
2.45.2