* [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup
@ 2025-04-14 20:28 Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 1/6] USB: serial: ftdi_sio: Remove space before comma Dominik Karol Piątkowski
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
This series fixes spotted code style issues in ftdi_sio driver.
v2: Split the patch into smaller patches
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
Dominik Karol Piątkowski (6):
USB: serial: ftdi_sio: Remove space before comma
USB: serial: ftdi_sio: Add missing blank line after declarations
USB: serial: ftdi_sio: Remove superfluous space before statements
USB: serial: ftdi_sio: Fix indentation made with spaces
USB: serial: ftdi_sio: Fix misaligned block comment
USB: serial: ftdi_sio: Remove space before tabs
drivers/usb/serial/ftdi_sio.c | 16 ++++++++++------
drivers/usb/serial/ftdi_sio.h | 2 +-
drivers/usb/serial/ftdi_sio_ids.h | 4 ++--
3 files changed, 13 insertions(+), 9 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 1/6] USB: serial: ftdi_sio: Remove space before comma
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 2/6] USB: serial: ftdi_sio: Add missing blank line after declarations Dominik Karol Piątkowski
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
Remove the space before comma in id_table_combined to align with code
style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 9b34e23b7091..b02dbe4ec1e4 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -190,7 +190,7 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_232RL_PID) },
- { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) ,
+ { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID),
.driver_info = (kernel_ulong_t)&ftdi_8u2232c_quirk },
{ USB_DEVICE(FTDI_VID, FTDI_4232H_PID) },
{ USB_DEVICE(FTDI_VID, FTDI_232H_PID) },
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 2/6] USB: serial: ftdi_sio: Add missing blank line after declarations
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 1/6] USB: serial: ftdi_sio: Remove space before comma Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 3/6] USB: serial: ftdi_sio: Remove superfluous space before statements Dominik Karol Piątkowski
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
Add missing blank lines after declarations to align with code style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index b02dbe4ec1e4..f52bab3a3bfd 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1143,6 +1143,7 @@ static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
unsigned short int divisor;
/* divisor shifted 3 bits to the left */
int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud);
+
if ((divisor3 & 0x7) == 7)
divisor3++; /* round x.7/8 up to x+1 */
divisor = divisor3 >> 3;
@@ -1169,6 +1170,7 @@ static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
u32 divisor;
/* divisor shifted 3 bits to the left */
int divisor3 = DIV_ROUND_CLOSEST(base, 2 * baud);
+
divisor = divisor3 >> 3;
divisor |= (u32)divfrac[divisor3 & 0x7] << 14;
/* Deal with special cases for highest baud rates. */
@@ -1657,6 +1659,7 @@ static ssize_t latency_timer_show(struct device *dev,
{
struct usb_serial_port *port = to_usb_serial_port(dev);
struct ftdi_private *priv = usb_get_serial_port_data(port);
+
if (priv->flags & ASYNC_LOW_LATENCY)
return sprintf(buf, "1\n");
else
@@ -2194,6 +2197,7 @@ static int ftdi_probe(struct usb_serial *serial, const struct usb_device_id *id)
if (quirk && quirk->probe) {
int ret = quirk->probe(serial);
+
if (ret != 0)
return ret;
}
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 3/6] USB: serial: ftdi_sio: Remove superfluous space before statements
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 1/6] USB: serial: ftdi_sio: Remove space before comma Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 2/6] USB: serial: ftdi_sio: Add missing blank line after declarations Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 4/6] USB: serial: ftdi_sio: Fix indentation made with spaces Dominik Karol Piątkowski
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
Remove superfluous space between indenting tabs and statements to align
with code style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index f52bab3a3bfd..c2b9b8edcc8e 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1161,7 +1161,7 @@ static unsigned short int ftdi_232am_baud_base_to_divisor(int baud, int base)
static unsigned short int ftdi_232am_baud_to_divisor(int baud)
{
- return ftdi_232am_baud_base_to_divisor(baud, 48000000);
+ return ftdi_232am_baud_base_to_divisor(baud, 48000000);
}
static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
@@ -1183,7 +1183,7 @@ static u32 ftdi_232bm_baud_base_to_divisor(int baud, int base)
static u32 ftdi_232bm_baud_to_divisor(int baud)
{
- return ftdi_232bm_baud_base_to_divisor(baud, 48000000);
+ return ftdi_232bm_baud_base_to_divisor(baud, 48000000);
}
static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
@@ -1213,7 +1213,7 @@ static u32 ftdi_2232h_baud_base_to_divisor(int baud, int base)
static u32 ftdi_2232h_baud_to_divisor(int baud)
{
- return ftdi_2232h_baud_base_to_divisor(baud, 120000000);
+ return ftdi_2232h_baud_base_to_divisor(baud, 120000000);
}
#define set_mctrl(port, set) update_mctrl((port), (set), 0)
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 4/6] USB: serial: ftdi_sio: Fix indentation made with spaces
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
` (2 preceding siblings ...)
2025-04-14 20:28 ` [PATCH v2 RESEND 3/6] USB: serial: ftdi_sio: Remove superfluous space before statements Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 5/6] USB: serial: ftdi_sio: Fix misaligned block comment Dominik Karol Piątkowski
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
Fix indentation that was made with spaces instead of tabs to align with
code style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index c2b9b8edcc8e..60d24152e385 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -2625,8 +2625,8 @@ static bool ftdi_tx_empty(struct usb_serial_port *port)
* WARNING: set_termios calls this with old_termios in kernel space
*/
static void ftdi_set_termios(struct tty_struct *tty,
- struct usb_serial_port *port,
- const struct ktermios *old_termios)
+ struct usb_serial_port *port,
+ const struct ktermios *old_termios)
{
struct usb_device *dev = port->serial->dev;
struct device *ddev = &port->dev;
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 5/6] USB: serial: ftdi_sio: Fix misaligned block comment
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
` (3 preceding siblings ...)
2025-04-14 20:28 ` [PATCH v2 RESEND 4/6] USB: serial: ftdi_sio: Fix indentation made with spaces Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 6/6] USB: serial: ftdi_sio: Remove space before tabs Dominik Karol Piątkowski
2025-05-19 12:26 ` [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Johan Hovold
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
One of the block comments was misaligned. Fix it to align with code
style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h
index 55ea61264f91..d671d2194c64 100644
--- a/drivers/usb/serial/ftdi_sio.h
+++ b/drivers/usb/serial/ftdi_sio.h
@@ -95,7 +95,7 @@
*
* The Purge RX and TX buffer commands affect nothing except the buffers
*
- */
+ */
/* FTDI_SIO_SET_BAUDRATE */
#define FTDI_SIO_SET_BAUDRATE_REQUEST_TYPE 0x40
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 RESEND 6/6] USB: serial: ftdi_sio: Remove space before tabs
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
` (4 preceding siblings ...)
2025-04-14 20:28 ` [PATCH v2 RESEND 5/6] USB: serial: ftdi_sio: Fix misaligned block comment Dominik Karol Piątkowski
@ 2025-04-14 20:28 ` Dominik Karol Piątkowski
2025-05-19 12:26 ` [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Johan Hovold
6 siblings, 0 replies; 8+ messages in thread
From: Dominik Karol Piątkowski @ 2025-04-14 20:28 UTC (permalink / raw)
To: Johan Hovold, Greg Kroah-Hartman
Cc: linux-usb, linux-kernel, Dominik Karol Piątkowski
Remove superfluous space before tabs in defines to align with code
style.
Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
---
v2: Split the patch into smaller patches
drivers/usb/serial/ftdi_sio_ids.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 52be47d684ea..3d9f6ed97783 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -1022,7 +1022,7 @@
* Kondo Kagaku Co.Ltd.
* http://www.kondo-robot.com/EN
*/
-#define KONDO_VID 0x165c
+#define KONDO_VID 0x165c
#define KONDO_USB_SERIAL_PID 0x0002
/*
@@ -1446,7 +1446,7 @@
/*
* Accesio USB Data Acquisition products (http://www.accesio.com/)
*/
-#define ACCESIO_COM4SM_PID 0xD578
+#define ACCESIO_COM4SM_PID 0xD578
/* www.sciencescope.co.uk educational dataloggers */
#define FTDI_SCIENCESCOPE_LOGBOOKML_PID 0xFF18
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
` (5 preceding siblings ...)
2025-04-14 20:28 ` [PATCH v2 RESEND 6/6] USB: serial: ftdi_sio: Remove space before tabs Dominik Karol Piątkowski
@ 2025-05-19 12:26 ` Johan Hovold
6 siblings, 0 replies; 8+ messages in thread
From: Johan Hovold @ 2025-05-19 12:26 UTC (permalink / raw)
To: Dominik Karol Piątkowski; +Cc: Greg Kroah-Hartman, linux-usb, linux-kernel
On Mon, Apr 14, 2025 at 08:28:10PM +0000, Dominik Karol Piątkowski wrote:
> This series fixes spotted code style issues in ftdi_sio driver.
> Dominik Karol Piątkowski (6):
> USB: serial: ftdi_sio: Remove space before comma
> USB: serial: ftdi_sio: Add missing blank line after declarations
> USB: serial: ftdi_sio: Remove superfluous space before statements
> USB: serial: ftdi_sio: Fix indentation made with spaces
> USB: serial: ftdi_sio: Fix misaligned block comment
> USB: serial: ftdi_sio: Remove space before tabs
You should not be running checkpatch.pl (as you've clearly done here) on
code that's already in the kernel.
The exception is drivers/staging where patches like these are welcome so
that new contributers can practise on creating patches.
Johan
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-05-19 12:26 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-14 20:28 [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 1/6] USB: serial: ftdi_sio: Remove space before comma Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 2/6] USB: serial: ftdi_sio: Add missing blank line after declarations Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 3/6] USB: serial: ftdi_sio: Remove superfluous space before statements Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 4/6] USB: serial: ftdi_sio: Fix indentation made with spaces Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 5/6] USB: serial: ftdi_sio: Fix misaligned block comment Dominik Karol Piątkowski
2025-04-14 20:28 ` [PATCH v2 RESEND 6/6] USB: serial: ftdi_sio: Remove space before tabs Dominik Karol Piątkowski
2025-05-19 12:26 ` [PATCH v2 RESEND 0/6] USB: serial: ftdi_sio: Code style cleanup Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®