tty: gdm724x: Fix coding style in gdm_tty.c
cover tty: gdm724x: Fix coding style in gdm_tty.c
Checkpatch.pl raises 2 warnings in gdm_tty.c. This patchset contains two patches that cleanup the code as per the Linux coding style & fix the warnings. Patches can be applied in any order.
Soumya Negi (2):
tty: gdm724x: Match alignment with open parenthesis
tty: gdm724x: Add blank line after declaration
drivers/staging/gdm724x/gdm_tty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
2.42.0
PATCH 1/2 tty: gdm724x: Match alignment with open parenthesis
Fix CHECK: Alignment should match open parenthesis Issue found by checkpatch.pl
--- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/gdm724x/gdm_tty.c +2 -2
@@ -271,8 +271,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);
Signature · 1 line
2.42.0
PATCH 2/2 tty: gdm724x: Add blank line after declaration
In reply to Soumya NegiFix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl
--- drivers/staging/gdm724x/gdm_tty.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/gdm724x/gdm_tty.c +1 -0
@@ -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,
Signature · 1 line
2.42.0
Re: [PATCH 1/2] tty: gdm724x: Match alignment with open parenthesis
In reply to Soumya NegiQuoted 13 lines · Soumya Negi
Fix CHECK: Alignment should match open parenthesis Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/gdm724x/gdm_tty.c +0
-0
drivers/staging/gdm724x/gdm_tty.c int register_lte_tty_driver(void) · line 275
Quoted 7 lines
drivers/staging/gdm724x/gdm_tty.c +2
-2@@ -271,8 +271,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 );
I prefered the original code. It was more readable.
regards,
dan carpenter
Re: [PATCH 1/2] tty: gdm724x: Match alignment with open parenthesis
Quoted 24 lines · Dan Carpenter
Quoted 13 lines · Soumya Negi
Fix CHECK: Alignment should match open parenthesis Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/gdm724x/gdm_tty.c +0
-0drivers/staging/gdm724x/gdm_tty.c int register_lte_tty_driver(void) · line 275
Quoted 7 lines
drivers/staging/gdm724x/gdm_tty.c +2
-2@@ -271,8 +271,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 );I prefered the original code. It was more readable.
Quoted 2 lines
regards,
dan carpenter
Hi Dan,
Noted. I'm curious what happens when some of the patches in a patchset are acceptable and some are not. Is everything disregarded by maintainers or are the good patches cherry-picked from the set?
Thanks,
Soumya
Re: [PATCH 1/2] tty: gdm724x: Match alignment with open parenthesis
Quoted 25 lines · Soumya Negi
Quoted 24 lines · Dan Carpenter
Quoted 13 lines · Soumya Negi
Fix CHECK: Alignment should match open parenthesis Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/gdm724x/gdm_tty.c +0
-0drivers/staging/gdm724x/gdm_tty.c int register_lte_tty_driver(void) · line 275
Quoted 7 lines
drivers/staging/gdm724x/gdm_tty.c +2
-2@@ -271,8 +271,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 );I prefered the original code. It was more readable.
Quoted 7 lines
Quoted 2 lines
regards,
dan carpenterHi Dan,
Noted. I'm curious what happens when some of the patches in a patchset are acceptable and some are not. Is everything disregarded by maintainers or are the good patches cherry-picked from the set?
Most of the time, you should just resend the series. Sometimes a maintainer will take the first few patches and then when they hit one that can't be merged they'll stop. So you should try to organize your patchsets from fixes first, then cleanups and then least controversial to most controversial. Except people might be annoyed if it looks like you're hiding a really controversial one at the end of a long series.
regards,
dan carpenter
Greg Kroah-Hartman
maintainerRe: [PATCH 2/2] tty: gdm724x: Add blank line after declaration
In reply to Soumya NegiQuoted 7 lines · Soumya Negi
Fix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 1 + 1 file changed, 1 insertion(+)
Why do you have "tty:" as the prefix for a staging driver? Shouldn't it be "staging: gdm724x: ...."?
thanks,
greg k-h
Re: [PATCH 2/2] tty: gdm724x: Add blank line after declaration
Quoted 11 lines · Greg Kroah-Hartman
Quoted 7 lines · Soumya Negi
Fix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 1 + 1 file changed, 1 insertion(+)Why do you have "tty:" as the prefix for a staging driver? Shouldn't it be "staging: gdm724x: ...."?
Hi Greg,
Thats what I thought too. But when I looked at the git history for gdm_tty.c the last few commits had "tty:". So I went with that. Should I change it to "staging:"?
Regards,
Soumya
Quoted 3 lines
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 2/2] tty: gdm724x: Add blank line after declaration
Quoted 10 lines · Soumya Negi
Quoted 9 lines · Greg Kroah-Hartman
Quoted 7 lines · Soumya Negi
Fix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 1 + 1 file changed, 1 insertion(+)
Quoted 7 lines
Quoted 2 lines
Why do you have "tty:" as the prefix for a staging driver? Shouldn't it be "staging: gdm724x: ...."?
Hi Greg,
Thats what I thought too. But when I looked at the git history for
gdm_tty.cthe last few commits had "tty:". So I went with that.
That is because those commits were tty-wide, and they changed things in multiple drivers all at once, not just for the one file.
Quoted 1 line
Should I change it to "staging:"?
Please do.
thanks,
greg k-h
Re: [PATCH 2/2] tty: gdm724x: Add blank line after declaration
Hi Greg,
Quoted 19 lines · Greg Kroah-Hartman
Quoted 10 lines · Soumya Negi
Quoted 9 lines · Greg Kroah-Hartman
Quoted 7 lines · Soumya Negi
Fix WARNING: Missing a blank line after declarations Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 1 + 1 file changed, 1 insertion(+)Quoted 7 lines
Quoted 2 lines
Why do you have "tty:" as the prefix for a staging driver? Shouldn't it be "staging: gdm724x: ...."?
Hi Greg,
Thats what I thought too. But when I looked at the git history for
gdm_tty.cthe last few commits had "tty:". So I went with that.
Quoted 6 lines
That is because those commits were tty-wide, and they changed things in multiple drivers all at once, not just for the one file.
Quoted 1 line
Should I change it to "staging:"?
Please do.
I'm sending this patch in a new thread since the other patch in the patchset(had 2 patches) was reviewed as unneeded.
Regards,
Soumya
Re: [PATCH 1/2] tty: gdm724x: Match alignment with open parenthesis
In reply to Dan CarpenterQuoted 41 lines · Dan Carpenter
Quoted 25 lines · Soumya Negi
Quoted 24 lines · Dan Carpenter
Quoted 13 lines · Soumya Negi
Fix CHECK: Alignment should match open parenthesis Issue found by checkpatch.pl
Signed-off-by Soumya Negi <[email protected]>--- drivers/staging/gdm724x/gdm_tty.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/staging/gdm724x/gdm_tty.c +0
-0drivers/staging/gdm724x/gdm_tty.c int register_lte_tty_driver(void) · line 275
Quoted 7 lines
drivers/staging/gdm724x/gdm_tty.c +2
-2@@ -271,8 +271,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 );I prefered the original code. It was more readable.
Quoted 7 lines
Quoted 2 lines
regards,
dan carpenterHi Dan,
Noted. I'm curious what happens when some of the patches in a patchset are acceptable and some are not. Is everything disregarded by maintainers or are the good patches cherry-picked from the set?
Most of the time, you should just resend the series. Sometimes a maintainer will take the first few patches and then when they hit one that can't be merged they'll stop. So you should try to organize your patchsets from fixes first, then cleanups and then least controversial to most controversial. Except people might be annoyed if it looks like you're hiding a really controversial one at the end of a long series.
Quoted 2 lines
regards,
dan carpenter
Thank you!
- Soumya