All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: dgnc: Replace CamelCase namings with underscores.
@ 2016-10-16 19:43 Pankaj Bharadiya
  2016-10-17  7:46 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Pankaj Bharadiya @ 2016-10-16 19:43 UTC (permalink / raw)
  To: gregkh, lidza.louina; +Cc: markh, driverdev-devel, devel, linux-kernel

Replace CamelCase names with underscores to comply with the standard
kernel coding style.

Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index ef9a45b..1a21902 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -45,7 +45,7 @@
 /*
  * internal variables
  */
-static unsigned char		*dgnc_TmpWriteBuf;
+static unsigned char		*dgnc_tmp_write_buf;
 
 /*
  * Default transparent print information.
@@ -69,7 +69,7 @@
  * This defines a raw port at 9600 baud, 8 data bits, no parity,
  * 1 stop bit.
  */
-static struct ktermios DgncDefaultTermios = {
+static struct ktermios dgnc_default_termios = {
 	.c_iflag =	(DEFAULT_IFLAGS),	/* iflags */
 	.c_oflag =	(DEFAULT_OFLAGS),	/* oflags */
 	.c_cflag =	(DEFAULT_CFLAGS),	/* cflags */
@@ -160,9 +160,9 @@ int dgnc_tty_preinit(void)
 	 * is only called during module load, (not in interrupt context),
 	 * and with no locks held.
 	 */
-	dgnc_TmpWriteBuf = kmalloc(WRITEBUFLEN, GFP_KERNEL);
+	dgnc_tmp_write_buf = kmalloc(WRITEBUFLEN, GFP_KERNEL);
 
-	if (!dgnc_TmpWriteBuf)
+	if (!dgnc_tmp_write_buf)
 		return -ENOMEM;
 
 	return 0;
@@ -194,7 +194,7 @@ int dgnc_tty_register(struct dgnc_board *brd)
 	brd->serial_driver->minor_start = 0;
 	brd->serial_driver->type = TTY_DRIVER_TYPE_SERIAL;
 	brd->serial_driver->subtype = SERIAL_TYPE_NORMAL;
-	brd->serial_driver->init_termios = DgncDefaultTermios;
+	brd->serial_driver->init_termios = dgnc_default_termios;
 	brd->serial_driver->driver_name = DRVSTR;
 
 	/*
@@ -233,7 +233,7 @@ int dgnc_tty_register(struct dgnc_board *brd)
 	brd->print_driver->minor_start = 0x80;
 	brd->print_driver->type = TTY_DRIVER_TYPE_SERIAL;
 	brd->print_driver->subtype = SERIAL_TYPE_NORMAL;
-	brd->print_driver->init_termios = DgncDefaultTermios;
+	brd->print_driver->init_termios = dgnc_default_termios;
 	brd->print_driver->driver_name = DRVSTR;
 
 	/*
@@ -371,8 +371,8 @@ int dgnc_tty_init(struct dgnc_board *brd)
  */
 void dgnc_tty_post_uninit(void)
 {
-	kfree(dgnc_TmpWriteBuf);
-	dgnc_TmpWriteBuf = NULL;
+	kfree(dgnc_tmp_write_buf);
+	dgnc_tmp_write_buf = NULL;
 }
 
 /*
@@ -1543,7 +1543,7 @@ static int dgnc_tty_write_room(struct tty_struct *tty)
 	int ret = 0;
 	unsigned long flags;
 
-	if (!tty || !dgnc_TmpWriteBuf)
+	if (!tty || !dgnc_tmp_write_buf)
 		return 0;
 
 	un = tty->driver_data;
@@ -1623,7 +1623,7 @@ static int dgnc_tty_write(struct tty_struct *tty,
 	ushort tmask;
 	uint remain;
 
-	if (!tty || !dgnc_TmpWriteBuf)
+	if (!tty || !dgnc_tmp_write_buf)
 		return 0;
 
 	un = tty->driver_data;
-- 
1.9.1

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

* Re: [PATCH] staging: dgnc: Replace CamelCase namings with underscores.
  2016-10-16 19:43 [PATCH] staging: dgnc: Replace CamelCase namings with underscores Pankaj Bharadiya
@ 2016-10-17  7:46 ` Greg KH
  2016-10-18  2:28   ` Pankaj Bharadiya
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2016-10-17  7:46 UTC (permalink / raw)
  To: Pankaj Bharadiya; +Cc: lidza.louina, devel, driverdev-devel, linux-kernel

On Mon, Oct 17, 2016 at 01:13:55AM +0530, Pankaj Bharadiya wrote:
> Replace CamelCase names with underscores to comply with the standard
> kernel coding style.
> 
> Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_tty.c | 20 ++++++++++----------
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
> index ef9a45b..1a21902 100644
> --- a/drivers/staging/dgnc/dgnc_tty.c
> +++ b/drivers/staging/dgnc/dgnc_tty.c
> @@ -45,7 +45,7 @@
>  /*
>   * internal variables
>   */
> -static unsigned char		*dgnc_TmpWriteBuf;
> +static unsigned char		*dgnc_tmp_write_buf;

Why not just fix the code to not have this variable at all?  It's not
correct to have it from what I can tell...

Also, you modify many different variables all at once, can you please
just modify one at a time (one per patch), to make it more obvious it is
correct?

>  /*
>   * Default transparent print information.
> @@ -69,7 +69,7 @@
>   * This defines a raw port at 9600 baud, 8 data bits, no parity,
>   * 1 stop bit.
>   */
> -static struct ktermios DgncDefaultTermios = {
> +static struct ktermios dgnc_default_termios = {

rename to "default_termios"?

No need to keep the driver name prefix on a static variable, right?

thanks,

greg k-h

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

* Re: [PATCH] staging: dgnc: Replace CamelCase namings with underscores.
  2016-10-17  7:46 ` Greg KH
@ 2016-10-18  2:28   ` Pankaj Bharadiya
  0 siblings, 0 replies; 3+ messages in thread
From: Pankaj Bharadiya @ 2016-10-18  2:28 UTC (permalink / raw)
  To: Greg KH; +Cc: Lidza Louina, devel, driverdev-devel, linux-kernel

On Mon, Oct 17, 2016 at 1:16 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Oct 17, 2016 at 01:13:55AM +0530, Pankaj Bharadiya wrote:
> > Replace CamelCase names with underscores to comply with the standard
> > kernel coding style.
> >
> > Signed-off-by: Pankaj Bharadiya <pankaj.bharadiya@gmail.com>
> > ---
> >  drivers/staging/dgnc/dgnc_tty.c | 20 ++++++++++----------
> >  1 file changed, 10 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
> > index ef9a45b..1a21902 100644
> > --- a/drivers/staging/dgnc/dgnc_tty.c
> > +++ b/drivers/staging/dgnc/dgnc_tty.c
> > @@ -45,7 +45,7 @@
> >  /*
> >   * internal variables
> >   */
> > -static unsigned char         *dgnc_TmpWriteBuf;
> > +static unsigned char         *dgnc_tmp_write_buf;
>
> Why not just fix the code to not have this variable at all?  It's not
> correct to have it from what I can tell...
>
> Also, you modify many different variables all at once, can you please
> just modify one at a time (one per patch), to make it more obvious it is
> correct?
>
> >  /*
> >   * Default transparent print information.
> > @@ -69,7 +69,7 @@
> >   * This defines a raw port at 9600 baud, 8 data bits, no parity,
> >   * 1 stop bit.
> >   */
> > -static struct ktermios DgncDefaultTermios = {
> > +static struct ktermios dgnc_default_termios = {
>
> rename to "default_termios"?
>
> No need to keep the driver name prefix on a static variable, right?
>
Hi Greg,

Thank you for your comments.
I have submitted v2 patchset. I hope that makes more sense now.

Thanks,
Pankaj

> thanks,
>
> greg k-h

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

end of thread, other threads:[~2016-10-18  2:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-16 19:43 [PATCH] staging: dgnc: Replace CamelCase namings with underscores Pankaj Bharadiya
2016-10-17  7:46 ` Greg KH
2016-10-18  2:28   ` Pankaj Bharadiya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.