2021-04-07 00:19:41

by Xiaofei Tan

[permalink] [raw]
Subject: [PATCH v2 04/10] tty: tty_jobctrl: Fix coding style issues of block comments

Fix coding style issues of block comments, reported by checkpatch.pl.
Besides, do some expression optimization for the sentenses.

Signed-off-by: Xiaofei Tan <[email protected]>
---
drivers/tty/tty_jobctrl.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
index 86070f7..7003b6b 100644
--- a/drivers/tty/tty_jobctrl.c
+++ b/drivers/tty/tty_jobctrl.c
@@ -204,8 +204,10 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session)
spin_lock_irq(&p->sighand->siglock);
if (p->signal->tty == tty) {
p->signal->tty = NULL;
- /* We defer the dereferences outside fo
- the tasklist lock */
+ /*
+ * We defer the dereferences outside of
+ * the tasklist lock period
+ */
refs++;
}
if (!p->signal->leader) {
@@ -328,9 +330,11 @@ void disassociate_ctty(int on_exit)
*/
void no_tty(void)
{
- /* FIXME: Review locking here. The tty_lock never covered any race
- between a new association and proc_clear_tty but possible we need
- to protect against this anyway */
+ /*
+ * FIXME: Review locking here. The tty_lock never covered any race
+ * between a new association and proc_clear_tty but possibly we need
+ * to protect against this period anyway
+ */
struct task_struct *tsk = current;

disassociate_ctty(0);
@@ -536,7 +540,7 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _
/*
* (tty == real_tty) is a cheap way of
* testing if the tty is NOT a master pty.
- */
+ */
if (tty == real_tty && current->signal->tty != real_tty)
return -ENOTTY;

--
2.8.1


2021-04-07 18:51:05

by Jiri Slaby

[permalink] [raw]
Subject: Re: [PATCH v2 04/10] tty: tty_jobctrl: Fix coding style issues of block comments

On 06. 04. 21, 13:24, Xiaofei Tan wrote:
> Fix coding style issues of block comments, reported by checkpatch.pl.
> Besides, do some expression optimization for the sentenses.
>
> Signed-off-by: Xiaofei Tan <[email protected]>
> ---
> drivers/tty/tty_jobctrl.c | 16 ++++++++++------
> 1 file changed, 10 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
> index 86070f7..7003b6b 100644
> --- a/drivers/tty/tty_jobctrl.c
> +++ b/drivers/tty/tty_jobctrl.c
> @@ -204,8 +204,10 @@ int tty_signal_session_leader(struct tty_struct *tty, int exit_session)
> spin_lock_irq(&p->sighand->siglock);
> if (p->signal->tty == tty) {
> p->signal->tty = NULL;
> - /* We defer the dereferences outside fo
> - the tasklist lock */
> + /*
> + * We defer the dereferences outside of
> + * the tasklist lock period

:). No, I meant "period" as this punctuation mark: .

> + */
> refs++;
> }
> if (!p->signal->leader) {
> @@ -328,9 +330,11 @@ void disassociate_ctty(int on_exit)
> */
> void no_tty(void)
> {
> - /* FIXME: Review locking here. The tty_lock never covered any race
> - between a new association and proc_clear_tty but possible we need
> - to protect against this anyway */
> + /*
> + * FIXME: Review locking here. The tty_lock never covered any race
> + * between a new association and proc_clear_tty but possibly we need
> + * to protect against this period anyway

The same here.

> + */
> struct task_struct *tsk = current;
>
> disassociate_ctty(0);
> @@ -536,7 +540,7 @@ static int tiocgsid(struct tty_struct *tty, struct tty_struct *real_tty, pid_t _
> /*
> * (tty == real_tty) is a cheap way of
> * testing if the tty is NOT a master pty.
> - */
> + */
> if (tty == real_tty && current->signal->tty != real_tty)
> return -ENOTTY;
>
>


--
js
suse labs

2021-04-07 22:30:15

by Xiaofei Tan

[permalink] [raw]
Subject: Re: [PATCH v2 04/10] tty: tty_jobctrl: Fix coding style issues of block comments

Hi Jiri,

On 2021/4/7 13:26, Jiri Slaby wrote:
> On 06. 04. 21, 13:24, Xiaofei Tan wrote:
>> Fix coding style issues of block comments, reported by checkpatch.pl.
>> Besides, do some expression optimization for the sentenses.
>>
>> Signed-off-by: Xiaofei Tan <[email protected]>
>> ---
>> drivers/tty/tty_jobctrl.c | 16 ++++++++++------
>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/tty/tty_jobctrl.c b/drivers/tty/tty_jobctrl.c
>> index 86070f7..7003b6b 100644
>> --- a/drivers/tty/tty_jobctrl.c
>> +++ b/drivers/tty/tty_jobctrl.c
>> @@ -204,8 +204,10 @@ int tty_signal_session_leader(struct tty_struct
>> *tty, int exit_session)
>> spin_lock_irq(&p->sighand->siglock);
>> if (p->signal->tty == tty) {
>> p->signal->tty = NULL;
>> - /* We defer the dereferences outside fo
>> - the tasklist lock */
>> + /*
>> + * We defer the dereferences outside of
>> + * the tasklist lock period
>
> :). No, I meant "period" as this punctuation mark: .
>

Oh, my misunderstanding. I will send v3 later. thanks. :)

>> + */
>> refs++;
>> }
>> if (!p->signal->leader) {
>> @@ -328,9 +330,11 @@ void disassociate_ctty(int on_exit)
>> */
>> void no_tty(void)
>> {
>> - /* FIXME: Review locking here. The tty_lock never covered any race
>> - between a new association and proc_clear_tty but possible we need
>> - to protect against this anyway */
>> + /*
>> + * FIXME: Review locking here. The tty_lock never covered any race
>> + * between a new association and proc_clear_tty but possibly we need
>> + * to protect against this period anyway
>
> The same here.
>

Sure

>> + */
>> struct task_struct *tsk = current;
>> disassociate_ctty(0);
>> @@ -536,7 +540,7 @@ static int tiocgsid(struct tty_struct *tty, struct
>> tty_struct *real_tty, pid_t _
>> /*
>> * (tty == real_tty) is a cheap way of
>> * testing if the tty is NOT a master pty.
>> - */
>> + */
>> if (tty == real_tty && current->signal->tty != real_tty)
>> return -ENOTTY;
>>
>
>