linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to
@ 2016-08-19  1:04 Daeseok Youn
  2016-08-21 15:55 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Daeseok Youn @ 2016-08-19  1:04 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to
  2016-08-19  1:04 [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to Daeseok Youn
@ 2016-08-21 15:55 ` Greg KH
  2016-08-22  0:42   ` DaeSeok Youn
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-08-21 15:55 UTC (permalink / raw)
  To: Daeseok Youn
  Cc: lidza.louina, devel, driverdev-devel, kernel-janitors, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to
  2016-08-21 15:55 ` Greg KH
@ 2016-08-22  0:42   ` DaeSeok Youn
  0 siblings, 0 replies; 3+ messages in thread
From: DaeSeok Youn @ 2016-08-22  0:42 UTC (permalink / raw)
  To: Greg KH
  Cc: Lidza Louina, devel, driverdev-devel, kernel-janitors, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-22  0:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-19  1:04 [PATCH 1/2] staging: dgnc: change a parameter from tty_struct to Daeseok Youn
2016-08-21 15:55 ` Greg KH
2016-08-22  0:42   ` DaeSeok Youn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).