Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1465727 > unrolled thread

[PATCH 1/2] staging: dgnc: change a parameter from tty_struct to

Started byDaeseok Youn <daeseok.youn@gmail.com>
First post2016-08-19 03:10 +0200
Last post2016-08-22 02:50 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to Daeseok Youn <daeseok.youn@gmail.com> - 2016-08-19 03:10 +0200
    Re: [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to Greg KH <gregkh@linuxfoundation.org> - 2016-08-21 23:30 +0200
      Re: [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to DaeSeok Youn <daeseok.youn@gmail.com> - 2016-08-22 02:50 +0200

#1465727 — [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to

FromDaeseok Youn <daeseok.youn@gmail.com>
Date2016-08-19 03:10 +0200
Subject[PATCH 1/2] staging: dgnc: change a parameter from tty_struct to
Message-ID<s7GtR-7go-79@gated-at.bofh.it>
The dgnc_maxcps_room() function must be called only for print device.
The if-statement for checking print device checks before calling
maxcps_room() and also this function doesn't need to have any
data except channel_t.

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index e4c6c3f..31b18e6 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1492,18 +1492,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
  * returns the new bytes_available.  This only affects printer
  * output.
  */
-static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
+static int dgnc_maxcps_room(struct channel_t *ch, int bytes_available)
 {
-	struct un_t *un = tty->driver_data;
-	struct channel_t *ch = un->un_ch;
-
-	/*
-	 * If its not the Transparent print device, return
-	 * the full data amount.
-	 */
-	if (un->un_type != DGNC_PRINT)
-		return bytes_available;
-
 	if (ch->ch_digi.digi_maxcps > 0 && ch->ch_digi.digi_bufsize > 0) {
 		int cps_limit = 0;
 		unsigned long current_time = jiffies;
@@ -1567,7 +1557,8 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
 		ret += WQUEUESIZE;
 
 	/* Limit printer to maxcps */
-	ret = dgnc_maxcps_room(tty, ret);
+	if (un->un_type != DGNC_PRINT)
+		ret = dgnc_maxcps_room(ch, ret);
 
 	/*
 	 * If we are printer device, leave space for
@@ -1659,7 +1650,8 @@ static int dgnc_tty_write(struct tty_struct *tty,
 	 * Limit printer output to maxcps overall, with bursts allowed
 	 * up to bufsize characters.
 	 */
-	bufcount = dgnc_maxcps_room(tty, bufcount);
+	if (un->un_type != DGNC_PRINT)
+		bufcount = dgnc_maxcps_room(ch, bufcount);
 
 	/*
 	 * Take minimum of what the user wants to send, and the
-- 
1.9.1

[toc] | [next] | [standalone]


#1467266

FromGreg KH <gregkh@linuxfoundation.org>
Date2016-08-21 23:30 +0200
Message-ID<s8ItA-5Ge-25@gated-at.bofh.it>
In reply to#1465727
On Fri, Aug 19, 2016 at 10:04:52AM +0900, Daeseok Youn wrote:
> The dgnc_maxcps_room() function must be called only for print device.
> The if-statement for checking print device checks before calling
> maxcps_room() and also this function doesn't need to have any
> data except channel_t.
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_tty.c | 18 +++++-------------
>  1 file changed, 5 insertions(+), 13 deletions(-)

Your subject line doesn't make much sense, does it?

:(

Please fix up and resend.

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1467296

FromDaeSeok Youn <daeseok.youn@gmail.com>
Date2016-08-22 02:50 +0200
Message-ID<s8LB7-7vB-1@gated-at.bofh.it>
In reply to#1467266
2016-08-22 0:55 GMT+09:00 Greg KH <gregkh@linuxfoundation.org>:
> On Fri, Aug 19, 2016 at 10:04:52AM +0900, Daeseok Youn wrote:
>> The dgnc_maxcps_room() function must be called only for print device.
>> The if-statement for checking print device checks before calling
>> maxcps_room() and also this function doesn't need to have any
>> data except channel_t.
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_tty.c | 18 +++++-------------
>>  1 file changed, 5 insertions(+), 13 deletions(-)
>
> Your subject line doesn't make much sense, does it?
I will update it and resend.

Thanks.
Regards,
Daeseok Youn.
>
> :(
>
> Please fix up and resend.
>
> thanks,
>
> greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web