linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty: gdm724x: Fix coding style checkpatch warnings
@ 2023-10-13  5:14 Soumya Negi
  2023-10-13  5:20 ` Julia Lawall
  2023-10-13  8:53 ` Dan Carpenter
  0 siblings, 2 replies; 5+ messages in thread
From: Soumya Negi @ 2023-10-13  5:14 UTC (permalink / raw)
  To: Jonathan Kim, Dean ahn, Greg Kroah-Hartman
  Cc: Soumya Negi, outreachy, linux-staging, linux-kernel

Add blank line after declaration & match alignment with open parenthesis.
Issue found by checkpatch.pl

Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
---
 drivers/staging/gdm724x/gdm_tty.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
index 32b2e817ff04..0c61eaff6122 100644
--- a/drivers/staging/gdm724x/gdm_tty.c
+++ b/drivers/staging/gdm724x/gdm_tty.c
@@ -160,6 +160,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
 
 	while (remain) {
 		size_t sending_len = min_t(size_t, MUX_TX_MAX_SIZE, remain);
+
 		gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
 					(void *)(buf + sent_len),
 					sending_len,
@@ -271,8 +272,8 @@ int register_lte_tty_driver(void)
 	int ret;
 
 	for (i = 0; i < TTY_MAX_COUNT; i++) {
-		tty_driver = tty_alloc_driver(GDM_TTY_MINOR,
-				TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
+		tty_driver = tty_alloc_driver(GDM_TTY_MINOR, TTY_DRIVER_REAL_RAW |
+					      TTY_DRIVER_DYNAMIC_DEV);
 		if (IS_ERR(tty_driver))
 			return PTR_ERR(tty_driver);
 
-- 
2.42.0


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

* Re: [PATCH] tty: gdm724x: Fix coding style checkpatch warnings
  2023-10-13  5:14 [PATCH] tty: gdm724x: Fix coding style checkpatch warnings Soumya Negi
@ 2023-10-13  5:20 ` Julia Lawall
  2023-10-13  5:35   ` Soumya Negi
  2023-10-13  8:53 ` Dan Carpenter
  1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2023-10-13  5:20 UTC (permalink / raw)
  To: Soumya Negi
  Cc: Jonathan Kim, Dean ahn, Greg Kroah-Hartman, outreachy,
	linux-staging, linux-kernel



On Thu, 12 Oct 2023, Soumya Negi wrote:

> Add blank line after declaration & match alignment with open parenthesis.
> Issue found by checkpatch.pl

This seems like two completely unrelated issues.

julia

>
> Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
> ---
>  drivers/staging/gdm724x/gdm_tty.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
> index 32b2e817ff04..0c61eaff6122 100644
> --- a/drivers/staging/gdm724x/gdm_tty.c
> +++ b/drivers/staging/gdm724x/gdm_tty.c
> @@ -160,6 +160,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
>
>  	while (remain) {
>  		size_t sending_len = min_t(size_t, MUX_TX_MAX_SIZE, remain);
> +
>  		gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
>  					(void *)(buf + sent_len),
>  					sending_len,
> @@ -271,8 +272,8 @@ int register_lte_tty_driver(void)
>  	int ret;
>
>  	for (i = 0; i < TTY_MAX_COUNT; i++) {
> -		tty_driver = tty_alloc_driver(GDM_TTY_MINOR,
> -				TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
> +		tty_driver = tty_alloc_driver(GDM_TTY_MINOR, TTY_DRIVER_REAL_RAW |
> +					      TTY_DRIVER_DYNAMIC_DEV);
>  		if (IS_ERR(tty_driver))
>  			return PTR_ERR(tty_driver);
>
> --
> 2.42.0
>
>
>

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

* Re: [PATCH] tty: gdm724x: Fix coding style checkpatch warnings
  2023-10-13  5:20 ` Julia Lawall
@ 2023-10-13  5:35   ` Soumya Negi
  0 siblings, 0 replies; 5+ messages in thread
From: Soumya Negi @ 2023-10-13  5:35 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jonathan Kim, Dean ahn, Greg Kroah-Hartman, outreachy,
	linux-staging, linux-kernel

On Fri, Oct 13, 2023 at 07:20:08AM +0200, Julia Lawall wrote:
> 
> 
> On Thu, 12 Oct 2023, Soumya Negi wrote:
> 
> > Add blank line after declaration & match alignment with open parenthesis.
> > Issue found by checkpatch.pl
> 
> This seems like two completely unrelated issues.
> 
> julia

Hi Julia,

I got it. Will send two separate patches for each type of code cleanup.

- Soumya

> >
> > Signed-off-by: Soumya Negi <soumya.negi97@gmail.com>
> > ---
> >  drivers/staging/gdm724x/gdm_tty.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/staging/gdm724x/gdm_tty.c b/drivers/staging/gdm724x/gdm_tty.c
> > index 32b2e817ff04..0c61eaff6122 100644
> > --- a/drivers/staging/gdm724x/gdm_tty.c
> > +++ b/drivers/staging/gdm724x/gdm_tty.c
> > @@ -160,6 +160,7 @@ static ssize_t gdm_tty_write(struct tty_struct *tty, const u8 *buf, size_t len)
> >
> >  	while (remain) {
> >  		size_t sending_len = min_t(size_t, MUX_TX_MAX_SIZE, remain);
> > +
> >  		gdm->tty_dev->send_func(gdm->tty_dev->priv_dev,
> >  					(void *)(buf + sent_len),
> >  					sending_len,
> > @@ -271,8 +272,8 @@ int register_lte_tty_driver(void)
> >  	int ret;
> >
> >  	for (i = 0; i < TTY_MAX_COUNT; i++) {
> > -		tty_driver = tty_alloc_driver(GDM_TTY_MINOR,
> > -				TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
> > +		tty_driver = tty_alloc_driver(GDM_TTY_MINOR, TTY_DRIVER_REAL_RAW |
> > +					      TTY_DRIVER_DYNAMIC_DEV);
> >  		if (IS_ERR(tty_driver))
> >  			return PTR_ERR(tty_driver);
> >
> > --
> > 2.42.0
> >
> >
> >

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

* Re: [PATCH] tty: gdm724x: Fix coding style checkpatch warnings
  2023-10-13  5:14 [PATCH] tty: gdm724x: Fix coding style checkpatch warnings Soumya Negi
  2023-10-13  5:20 ` Julia Lawall
@ 2023-10-13  8:53 ` Dan Carpenter
  2023-10-13 21:19   ` Soumya Negi
  1 sibling, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2023-10-13  8:53 UTC (permalink / raw)
  To: Soumya Negi
  Cc: Jonathan Kim, Dean ahn, Greg Kroah-Hartman, outreachy,
	linux-staging, linux-kernel

On Thu, Oct 12, 2023 at 10:14:58PM -0700, Soumya Negi wrote:
> @@ -271,8 +272,8 @@ int register_lte_tty_driver(void)
>  	int ret;
>  
>  	for (i = 0; i < TTY_MAX_COUNT; i++) {
> -		tty_driver = tty_alloc_driver(GDM_TTY_MINOR,
> -				TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
> +		tty_driver = tty_alloc_driver(GDM_TTY_MINOR, TTY_DRIVER_REAL_RAW |
> +					      TTY_DRIVER_DYNAMIC_DEV);

Don't do this.  The code was better before. The parameter
"TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV" is one thing and
splitting it up like that makes the code less readable.  And I bet they
had to indent it like that to get under the 80 character limit.

This is an example of checkpatch giving bad advice.

regards,
dan carpenter


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

* Re: [PATCH] tty: gdm724x: Fix coding style checkpatch warnings
  2023-10-13  8:53 ` Dan Carpenter
@ 2023-10-13 21:19   ` Soumya Negi
  0 siblings, 0 replies; 5+ messages in thread
From: Soumya Negi @ 2023-10-13 21:19 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jonathan Kim, Dean ahn, Greg Kroah-Hartman, outreachy,
	linux-staging, linux-kernel

On Fri, Oct 13, 2023 at 11:53:36AM +0300, Dan Carpenter wrote:
> On Thu, Oct 12, 2023 at 10:14:58PM -0700, Soumya Negi wrote:
> > @@ -271,8 +272,8 @@ int register_lte_tty_driver(void)
> >  	int ret;
> >  
> >  	for (i = 0; i < TTY_MAX_COUNT; i++) {
> > -		tty_driver = tty_alloc_driver(GDM_TTY_MINOR,
> > -				TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
> > +		tty_driver = tty_alloc_driver(GDM_TTY_MINOR, TTY_DRIVER_REAL_RAW |
> > +					      TTY_DRIVER_DYNAMIC_DEV);
> 
> Don't do this.  The code was better before. The parameter
> "TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV" is one thing and
> splitting it up like that makes the code less readable.  And I bet they
> had to indent it like that to get under the 80 character limit.
> 
> This is an example of checkpatch giving bad advice.

Hi Dan,

Will keep this in mind for other similar checkpatch warnings.

Thanks,
Soumya

> regards,
> dan carpenter
> 

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

end of thread, other threads:[~2023-10-13 21:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-13  5:14 [PATCH] tty: gdm724x: Fix coding style checkpatch warnings Soumya Negi
2023-10-13  5:20 ` Julia Lawall
2023-10-13  5:35   ` Soumya Negi
2023-10-13  8:53 ` Dan Carpenter
2023-10-13 21:19   ` Soumya Negi

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).