diff mbox series

[1/2] USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL

Message ID 20200309095159.14163-1-anthony.mallet@laas.fr (mailing list archive)
State Superseded
Headers show
Series [1/2] USB: cdc-acm: fix close_delay and closing_wait units in TIOCSSERIAL | expand

Commit Message

Anthony Mallet March 9, 2020, 9:51 a.m. UTC
close_delay and closing_wait are specified in hundredth of a second but stored
internally in jiffies. Use the jiffies_to_msecs() and msecs_to_jiffies()
functions to convert from each other.

Signed-off-by: Anthony Mallet <anthony.mallet@laas.fr>
---
 drivers/usb/class/cdc-acm.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Greg KH March 9, 2020, 10:35 a.m. UTC | #1
On Mon, Mar 09, 2020 at 10:51:58AM +0100, Anthony Mallet wrote:
> close_delay and closing_wait are specified in hundredth of a second but stored
> internally in jiffies. Use the jiffies_to_msecs() and msecs_to_jiffies()
> functions to convert from each other.
> 
> Signed-off-by: Anthony Mallet <anthony.mallet@laas.fr>
> ---
>  drivers/usb/class/cdc-acm.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)

Is this a "v2" of this series?  If so, then can you please properly
version the patches and put below the --- line what changed from the
previous versions?

The kernel submitting patches documentation says how to do this, take a
look at that for the details, or see one of the many examples on the
mailing list archives here.

Can you please fix this up and send a v3 for both of these?

thanks,

greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 62f4fb9b362f..da619176deca 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -896,10 +896,10 @@  static int get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 
 	ss->xmit_fifo_size = acm->writesize;
 	ss->baud_base = le32_to_cpu(acm->line.dwDTERate);
-	ss->close_delay	= acm->port.close_delay / 10;
+	ss->close_delay	= jiffies_to_msecs(acm->port.close_delay) / 10;
 	ss->closing_wait = acm->port.closing_wait == ASYNC_CLOSING_WAIT_NONE ?
 				ASYNC_CLOSING_WAIT_NONE :
-				acm->port.closing_wait / 10;
+				jiffies_to_msecs(acm->port.closing_wait) / 10;
 	return 0;
 }
 
@@ -909,9 +909,10 @@  static int set_serial_info(struct tty_struct *tty, struct serial_struct *ss)
 	unsigned int closing_wait, close_delay;
 	int retval = 0;
 
-	close_delay = ss->close_delay * 10;
+	close_delay = msecs_to_jiffies(ss->close_delay * 10);
 	closing_wait = ss->closing_wait == ASYNC_CLOSING_WAIT_NONE ?
-			ASYNC_CLOSING_WAIT_NONE : ss->closing_wait * 10;
+			ASYNC_CLOSING_WAIT_NONE :
+			msecs_to_jiffies(ss->closing_wait * 10);
 
 	mutex_lock(&acm->port.mutex);