Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-17 Thread DaeSeok Youn
2016-08-17 15:25 GMT+09:00 Greg KH :
> On Wed, Aug 17, 2016 at 10:05:03AM +0900, DaeSeok Youn wrote:
>> 2016-08-16 2:05 GMT+09:00 Greg KH :
>> > On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
>> >> 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 
>> >> ---
>> >> RESEND: This patch was not merged for a long time, if there is any reason
>> >> why this patch could NOT be merged into staging tree, let me know.
>> >> There were no comment for this patch.
>> >> I cannot understand why this patch have to wait long time to merge.
>> >> And I also sent emails to mailing-lists for reminding this patch...
>> >> please let me know, what is the problem to merge this patch into staging 
>> >> tree.
>> >
>> > Please note, staging patches are at the bottom of my priority queue.
>> > Combined with a vacation, conferences, and a merge window and there are
>> > a lot of pending staging patches in my to-review queue.
>>
>> That's Ok. but I took a long time to wait for merging my patches in
>> this case. :-(
>
> You are not alone.  And what's the rush?  These are just trivial staging
> driver patches, it's not like you have the hardware for this device and
> are needing these patches to get it to work, right?
yes, you're right.

Thanks.

Regards,
Daeseok Youn.
>
> thanks,
>
> greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-17 Thread DaeSeok Youn
2016-08-17 15:25 GMT+09:00 Greg KH :
> On Wed, Aug 17, 2016 at 10:05:03AM +0900, DaeSeok Youn wrote:
>> 2016-08-16 2:05 GMT+09:00 Greg KH :
>> > On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
>> >> 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 
>> >> ---
>> >> RESEND: This patch was not merged for a long time, if there is any reason
>> >> why this patch could NOT be merged into staging tree, let me know.
>> >> There were no comment for this patch.
>> >> I cannot understand why this patch have to wait long time to merge.
>> >> And I also sent emails to mailing-lists for reminding this patch...
>> >> please let me know, what is the problem to merge this patch into staging 
>> >> tree.
>> >
>> > Please note, staging patches are at the bottom of my priority queue.
>> > Combined with a vacation, conferences, and a merge window and there are
>> > a lot of pending staging patches in my to-review queue.
>>
>> That's Ok. but I took a long time to wait for merging my patches in
>> this case. :-(
>
> You are not alone.  And what's the rush?  These are just trivial staging
> driver patches, it's not like you have the hardware for this device and
> are needing these patches to get it to work, right?
yes, you're right.

Thanks.

Regards,
Daeseok Youn.
>
> thanks,
>
> greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-17 Thread Greg KH
On Wed, Aug 17, 2016 at 10:05:03AM +0900, DaeSeok Youn wrote:
> 2016-08-16 2:05 GMT+09:00 Greg KH :
> > On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
> >> 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 
> >> ---
> >> RESEND: This patch was not merged for a long time, if there is any reason
> >> why this patch could NOT be merged into staging tree, let me know.
> >> There were no comment for this patch.
> >> I cannot understand why this patch have to wait long time to merge.
> >> And I also sent emails to mailing-lists for reminding this patch...
> >> please let me know, what is the problem to merge this patch into staging 
> >> tree.
> >
> > Please note, staging patches are at the bottom of my priority queue.
> > Combined with a vacation, conferences, and a merge window and there are
> > a lot of pending staging patches in my to-review queue.
> 
> That's Ok. but I took a long time to wait for merging my patches in
> this case. :-(

You are not alone.  And what's the rush?  These are just trivial staging
driver patches, it's not like you have the hardware for this device and
are needing these patches to get it to work, right?

thanks,

greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-17 Thread Greg KH
On Wed, Aug 17, 2016 at 10:05:03AM +0900, DaeSeok Youn wrote:
> 2016-08-16 2:05 GMT+09:00 Greg KH :
> > On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
> >> 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 
> >> ---
> >> RESEND: This patch was not merged for a long time, if there is any reason
> >> why this patch could NOT be merged into staging tree, let me know.
> >> There were no comment for this patch.
> >> I cannot understand why this patch have to wait long time to merge.
> >> And I also sent emails to mailing-lists for reminding this patch...
> >> please let me know, what is the problem to merge this patch into staging 
> >> tree.
> >
> > Please note, staging patches are at the bottom of my priority queue.
> > Combined with a vacation, conferences, and a merge window and there are
> > a lot of pending staging patches in my to-review queue.
> 
> That's Ok. but I took a long time to wait for merging my patches in
> this case. :-(

You are not alone.  And what's the rush?  These are just trivial staging
driver patches, it's not like you have the hardware for this device and
are needing these patches to get it to work, right?

thanks,

greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-16 Thread DaeSeok Youn
2016-08-16 2:05 GMT+09:00 Greg KH :
> On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
>> 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 
>> ---
>> RESEND: This patch was not merged for a long time, if there is any reason
>> why this patch could NOT be merged into staging tree, let me know.
>> There were no comment for this patch.
>> I cannot understand why this patch have to wait long time to merge.
>> And I also sent emails to mailing-lists for reminding this patch...
>> please let me know, what is the problem to merge this patch into staging 
>> tree.
>
> Please note, staging patches are at the bottom of my priority queue.
> Combined with a vacation, conferences, and a merge window and there are
> a lot of pending staging patches in my to-review queue.

That's Ok. but I took a long time to wait for merging my patches in
this case. :-(

>
> thanks for your patience.
>
> greg k-h
Thanks.

Regards,
Daeseok Youn.


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-16 Thread DaeSeok Youn
2016-08-16 2:05 GMT+09:00 Greg KH :
> On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
>> 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 
>> ---
>> RESEND: This patch was not merged for a long time, if there is any reason
>> why this patch could NOT be merged into staging tree, let me know.
>> There were no comment for this patch.
>> I cannot understand why this patch have to wait long time to merge.
>> And I also sent emails to mailing-lists for reminding this patch...
>> please let me know, what is the problem to merge this patch into staging 
>> tree.
>
> Please note, staging patches are at the bottom of my priority queue.
> Combined with a vacation, conferences, and a merge window and there are
> a lot of pending staging patches in my to-review queue.

That's Ok. but I took a long time to wait for merging my patches in
this case. :-(

>
> thanks for your patience.
>
> greg k-h
Thanks.

Regards,
Daeseok Youn.


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-15 Thread Greg KH
On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
> 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 
> ---
> RESEND: This patch was not merged for a long time, if there is any reason
> why this patch could NOT be merged into staging tree, let me know.
> There were no comment for this patch.
> I cannot understand why this patch have to wait long time to merge.
> And I also sent emails to mailing-lists for reminding this patch...
> please let me know, what is the problem to merge this patch into staging tree.

Please note, staging patches are at the bottom of my priority queue.
Combined with a vacation, conferences, and a merge window and there are
a lot of pending staging patches in my to-review queue.

thanks for your patience.

greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-08-15 Thread Greg KH
On Wed, Jul 06, 2016 at 03:11:13PM +0900, Daeseok Youn wrote:
> 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 
> ---
> RESEND: This patch was not merged for a long time, if there is any reason
> why this patch could NOT be merged into staging tree, let me know.
> There were no comment for this patch.
> I cannot understand why this patch have to wait long time to merge.
> And I also sent emails to mailing-lists for reminding this patch...
> please let me know, what is the problem to merge this patch into staging tree.

Please note, staging patches are at the bottom of my priority queue.
Combined with a vacation, conferences, and a merge window and there are
a lot of pending staging patches in my to-review queue.

thanks for your patience.

greg k-h


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-08 Thread Luis de Bethencourt
On 04/07/16 12:36, Daeseok Youn wrote:
> 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 
> ---
> This patch seems to be missed for a long time.
> I resend this patch without any updates.
> 
>  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 4eeecc9..6758859 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;
>   uintold_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_lock, flags);
> 

Hi,

Just curious. Are you confident of removing the tty->magic != TTY_MAGIC check?

>From what I've seen that one can catch potential errors. I might be wrong.

Thanks,
Luis


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-08 Thread Luis de Bethencourt
On 04/07/16 12:36, Daeseok Youn wrote:
> 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 
> ---
> This patch seems to be missed for a long time.
> I resend this patch without any updates.
> 
>  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 4eeecc9..6758859 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;
>   uintold_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_lock, flags);
> 

Hi,

Just curious. Are you confident of removing the tty->magic != TTY_MAGIC check?

>From what I've seen that one can catch potential errors. I might be wrong.

Thanks,
Luis


[PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-06 Thread Daeseok Youn
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 
---
RESEND: This patch was not merged for a long time, if there is any reason
why this patch could NOT be merged into staging tree, let me know.
There were no comment for this patch.
I cannot understand why this patch have to wait long time to merge.
And I also sent emails to mailing-lists for reminding this patch...
please let me know, what is the problem to merge this patch into staging tree.

 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 4eeecc9..6758859 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;
uintold_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_lock, flags);
-- 
1.9.1



[PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-06 Thread Daeseok Youn
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 
---
RESEND: This patch was not merged for a long time, if there is any reason
why this patch could NOT be merged into staging tree, let me know.
There were no comment for this patch.
I cannot understand why this patch have to wait long time to merge.
And I also sent emails to mailing-lists for reminding this patch...
please let me know, what is the problem to merge this patch into staging tree.

 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 4eeecc9..6758859 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;
uintold_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_lock, flags);
-- 
1.9.1



Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-04 Thread DaeSeok Youn
2016-07-04 20:36 GMT+09:00 Daeseok Youn :
> 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 
> ---
> This patch seems to be missed for a long time.
> I resend this patch without any updates.
>
>  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 4eeecc9..6758859 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;
> uintold_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_lock, flags);
> --
> 1.9.1
>
This patch will be sent again, I made a mistake while gathering my
previous patches which didn't accepted for a long time.
Sorry for noise.

Thanks.

Regards,
Jake.


Re: [PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-04 Thread DaeSeok Youn
2016-07-04 20:36 GMT+09:00 Daeseok Youn :
> 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 
> ---
> This patch seems to be missed for a long time.
> I resend this patch without any updates.
>
>  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 4eeecc9..6758859 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;
> uintold_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_lock, flags);
> --
> 1.9.1
>
This patch will be sent again, I made a mistake while gathering my
previous patches which didn't accepted for a long time.
Sorry for noise.

Thanks.

Regards,
Jake.


[PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-04 Thread Daeseok Youn
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 
---
This patch seems to be missed for a long time.
I resend this patch without any updates.

 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 4eeecc9..6758859 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;
uintold_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_lock, flags);
-- 
1.9.1



[PATCH 01/15 RESEND] staging: dgnc: remove redundant NULL checks in

2016-07-04 Thread Daeseok Youn
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 
---
This patch seems to be missed for a long time.
I resend this patch without any updates.

 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 4eeecc9..6758859 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;
uintold_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_lock, flags);
-- 
1.9.1