linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2 RESEND] staging: dgnc: remove redundant NULL checks in
@ 2016-05-10  6:44 Daeseok Youn
  2016-06-16  9:23 ` DaeSeok Youn
  0 siblings, 1 reply; 3+ messages in thread
From: Daeseok Youn @ 2016-05-10  6:44 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

The dgnc_block_til_ready() is only used in dgnc_tty_open().
The unit data(struct un_t) was stored into tty->driver_data in dgnc_tty_open().
And also tty and un were tested about NULL so these variables doesn't
need to check for NULL in dgnc_block_til_ready().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
RESEND: more explanation about this patch.
origin patch : https://lkml.org/lkml/2016/5/4/12

 drivers/staging/dgnc/dgnc_tty.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index a505775..cff34d4 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1172,17 +1172,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
 				struct channel_t *ch)
 {
 	int retval = 0;
-	struct un_t *un = NULL;
+	struct un_t *un = tty->driver_data;
 	unsigned long flags;
 	uint	old_flags = 0;
 	int	sleep_on_un_flags = 0;
 
-	if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
-	    ch->magic != DGNC_CHANNEL_MAGIC)
-		return -ENXIO;
-
-	un = tty->driver_data;
-	if (!un || un->magic != DGNC_UNIT_MAGIC)
+	if (!file)
 		return -ENXIO;
 
 	spin_lock_irqsave(&ch->ch_lock, flags);
-- 
2.8.2

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

* Re: [PATCH 1/2 RESEND] staging: dgnc: remove redundant NULL checks in
  2016-05-10  6:44 [PATCH 1/2 RESEND] staging: dgnc: remove redundant NULL checks in Daeseok Youn
@ 2016-06-16  9:23 ` DaeSeok Youn
  2016-06-21  2:15   ` DaeSeok Youn
  0 siblings, 1 reply; 3+ messages in thread
From: DaeSeok Youn @ 2016-06-16  9:23 UTC (permalink / raw)
  To: Greg KH
  Cc: Mark Hounschell, Lidza Louina, driverdev-devel, devel,
	linux-kernel, kernel-janitors

2016-05-10 15:44 GMT+09:00 Daeseok Youn <daeseok.youn@gmail.com>:
> The dgnc_block_til_ready() is only used in dgnc_tty_open().
> The unit data(struct un_t) was stored into tty->driver_data in dgnc_tty_open().
> And also tty and un were tested about NULL so these variables doesn't
> need to check for NULL in dgnc_block_til_ready().
>
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
Hello Greg,

This patch and patches from this were not merged into your tree for a one month.
Can you tell me why these are still waiting to merge?

Thanks.
regards,
Daeseok.


> RESEND: more explanation about this patch.
> origin patch : https://lkml.org/lkml/2016/5/4/12
>
>  drivers/staging/dgnc/dgnc_tty.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
> index a505775..cff34d4 100644
> --- a/drivers/staging/dgnc/dgnc_tty.c
> +++ b/drivers/staging/dgnc/dgnc_tty.c
> @@ -1172,17 +1172,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
>                                 struct channel_t *ch)
>  {
>         int retval = 0;
> -       struct un_t *un = NULL;
> +       struct un_t *un = tty->driver_data;
>         unsigned long flags;
>         uint    old_flags = 0;
>         int     sleep_on_un_flags = 0;
>
> -       if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
> -           ch->magic != DGNC_CHANNEL_MAGIC)
> -               return -ENXIO;
> -
> -       un = tty->driver_data;
> -       if (!un || un->magic != DGNC_UNIT_MAGIC)
> +       if (!file)
>                 return -ENXIO;
>
>         spin_lock_irqsave(&ch->ch_lock, flags);
> --
> 2.8.2
>

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

* Re: [PATCH 1/2 RESEND] staging: dgnc: remove redundant NULL checks in
  2016-06-16  9:23 ` DaeSeok Youn
@ 2016-06-21  2:15   ` DaeSeok Youn
  0 siblings, 0 replies; 3+ messages in thread
From: DaeSeok Youn @ 2016-06-21  2:15 UTC (permalink / raw)
  To: Greg KH
  Cc: Mark Hounschell, Lidza Louina, driverdev-devel, devel,
	linux-kernel, kernel-janitors

2016-06-16 18:23 GMT+09:00 DaeSeok Youn <daeseok.youn@gmail.com>:
> 2016-05-10 15:44 GMT+09:00 Daeseok Youn <daeseok.youn@gmail.com>:
>> The dgnc_block_til_ready() is only used in dgnc_tty_open().
>> The unit data(struct un_t) was stored into tty->driver_data in dgnc_tty_open().
>> And also tty and un were tested about NULL so these variables doesn't
>> need to check for NULL in dgnc_block_til_ready().
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
> Hello Greg,
>
> This patch and patches from this were not merged into your tree for a one month.
> Can you tell me why these are still waiting to merge?

Hello Greg,

Please have a look my comment. My patches have been waiting to merge
your staging tree for a month.
If you don't have pending patches from me, I can send those again.

Thanks.
regards,
Daeseok.
>
> Thanks.
> regards,
> Daeseok.
>
>
>> RESEND: more explanation about this patch.
>> origin patch : https://lkml.org/lkml/2016/5/4/12
>>
>>  drivers/staging/dgnc/dgnc_tty.c | 9 ++-------
>>  1 file changed, 2 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
>> index a505775..cff34d4 100644
>> --- a/drivers/staging/dgnc/dgnc_tty.c
>> +++ b/drivers/staging/dgnc/dgnc_tty.c
>> @@ -1172,17 +1172,12 @@ static int dgnc_block_til_ready(struct tty_struct *tty,
>>                                 struct channel_t *ch)
>>  {
>>         int retval = 0;
>> -       struct un_t *un = NULL;
>> +       struct un_t *un = tty->driver_data;
>>         unsigned long flags;
>>         uint    old_flags = 0;
>>         int     sleep_on_un_flags = 0;
>>
>> -       if (!tty || tty->magic != TTY_MAGIC || !file || !ch ||
>> -           ch->magic != DGNC_CHANNEL_MAGIC)
>> -               return -ENXIO;
>> -
>> -       un = tty->driver_data;
>> -       if (!un || un->magic != DGNC_UNIT_MAGIC)
>> +       if (!file)
>>                 return -ENXIO;
>>
>>         spin_lock_irqsave(&ch->ch_lock, flags);
>> --
>> 2.8.2
>>

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

end of thread, other threads:[~2016-06-21  2:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-10  6:44 [PATCH 1/2 RESEND] staging: dgnc: remove redundant NULL checks in Daeseok Youn
2016-06-16  9:23 ` DaeSeok Youn
2016-06-21  2:15   ` DaeSeok Youn

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