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


Groups > linux.kernel > #1535355

Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters
Date 2016-12-03 10:20 +0100
Message-ID <sKeEa-7HT-29@gated-at.bofh.it> (permalink)
References <sK1QC-7Z6-31@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Dec 02, 2016 at 08:13:49PM +0100, Fernando Apesteguia wrote:
> For the first lines of the patch, I opted to create a small function
> instead of breaking the the line in a weird way.
> 
> The other changes are simple ones.
> 
> Signed-off-by: Fernando Apesteguia <fernando.apesteguia@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_tty.c | 42 +++++++++++++++++++++++++----------------
>  1 file changed, 26 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
> index af4bc86..835d448 100644
> --- a/drivers/staging/dgnc/dgnc_tty.c
> +++ b/drivers/staging/dgnc/dgnc_tty.c
> @@ -102,6 +102,7 @@ static int dgnc_tty_write(struct tty_struct *tty, const unsigned char *buf,
>  static void dgnc_tty_set_termios(struct tty_struct *tty,
>  				 struct ktermios *old_termios);
>  static void dgnc_tty_send_xchar(struct tty_struct *tty, char ch);
> +static void dgnc_keep_line_low(struct channel_t *ch, const unsigned char line);
>  
>  static const struct tty_operations dgnc_tty_ops = {
>  	.open = dgnc_tty_open,
> @@ -786,6 +787,12 @@ void dgnc_check_queue_flow_control(struct channel_t *ch)
>  	}
>  }
>  
> +static void dgnc_keep_line_low(struct channel_t *ch, const unsigned char line)
> +{
> +	ch->ch_mostat &= ~(line);
> +	ch->ch_bd->bd_ops->assert_modem_signals(ch);
> +}

Your name here is odd, it is named because of what it does to the coding
style, not to the logic of what is happening in the function itself,
making it very confusing.

Yes, naming is hard, one of the hardest things in programming.

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: dgnc: Fix lines longer than 80 characters Fernando Apesteguia <fernando.apesteguia@gmail.com> - 2016-12-02 20:40 +0100
  Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters Greg KH <gregkh@linuxfoundation.org> - 2016-12-03 10:20 +0100
    Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters Greg KH <gregkh@linuxfoundation.org> - 2016-12-03 11:20 +0100
      Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters Fernando Apesteguia <fernando.apesteguia@gmail.com> - 2016-12-04 20:10 +0100
    Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters Fernando Apesteguia <fernando.apesteguia@gmail.com> - 2016-12-03 11:20 +0100
  Re: [PATCH] staging: dgnc: Fix lines longer than 80 characters Dan Carpenter <dan.carpenter@oracle.com> - 2016-12-05 22:00 +0100

csiph-web