All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] staging: dgnc: remove redundant NULL check in
@ 2016-04-05  9:30 ` Daeseok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-04-05  9:30 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index e97faaa..200d3aa 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1536,19 +1536,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
  */
 static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
 {
-	struct channel_t *ch = NULL;
-	struct un_t *un = NULL;
-
-	if (!tty)
-		return bytes_available;
-
-	un = tty->driver_data;
-	if (!un || un->magic != DGNC_UNIT_MAGIC)
-		return bytes_available;
-
-	ch = un->un_ch;
-	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
-		return bytes_available;
+	struct un_t *un = tty->driver_data;
+	struct channel_t *ch = un->un_ch;
 
 	/*
 	 * If its not the Transparent print device, return
-- 
1.9.1

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

* [PATCH 2/2] staging: dgnc: remove redundant NULL check in
@ 2016-04-05  9:30 ` Daeseok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-04-05  9:30 UTC (permalink / raw)
  To: lidza.louina
  Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel

There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index e97faaa..200d3aa 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1536,19 +1536,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
  */
 static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
 {
-	struct channel_t *ch = NULL;
-	struct un_t *un = NULL;
-
-	if (!tty)
-		return bytes_available;
-
-	un = tty->driver_data;
-	if (!un || un->magic != DGNC_UNIT_MAGIC)
-		return bytes_available;
-
-	ch = un->un_ch;
-	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
-		return bytes_available;
+	struct un_t *un = tty->driver_data;
+	struct channel_t *ch = un->un_ch;
 
 	/*
 	 * If its not the Transparent print device, return
-- 
1.9.1


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

* [PATCH 2/2] staging: dgnc: remove redundant NULL check in
@ 2016-04-05  9:30 ` Daeseok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-04-05  9:30 UTC (permalink / raw)
  To: lidza.louina
  Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel

There were already checking NULL about channel_t / un_t
before calling dgnc_maxcps_room().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_tty.c | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_tty.c b/drivers/staging/dgnc/dgnc_tty.c
index e97faaa..200d3aa 100644
--- a/drivers/staging/dgnc/dgnc_tty.c
+++ b/drivers/staging/dgnc/dgnc_tty.c
@@ -1536,19 +1536,8 @@ static int dgnc_tty_chars_in_buffer(struct tty_struct *tty)
  */
 static int dgnc_maxcps_room(struct tty_struct *tty, int bytes_available)
 {
-	struct channel_t *ch = NULL;
-	struct un_t *un = NULL;
-
-	if (!tty)
-		return bytes_available;
-
-	un = tty->driver_data;
-	if (!un || un->magic != DGNC_UNIT_MAGIC)
-		return bytes_available;
-
-	ch = un->un_ch;
-	if (!ch || ch->magic != DGNC_CHANNEL_MAGIC)
-		return bytes_available;
+	struct un_t *un = tty->driver_data;
+	struct channel_t *ch = un->un_ch;
 
 	/*
 	 * If its not the Transparent print device, return
-- 
1.9.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [PATCH 2/2] staging: dgnc: remove redundant null check in
  2016-04-05  9:30 ` Daeseok Youn
@ 2016-05-20  9:51 ` Daeseok Youn
  -1 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-05-20  9:51 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

the "brd" was already checked for NULL before calling dgnc_do_remap().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 22257d2..1882ef5 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
  */
 static void dgnc_do_remap(struct dgnc_board *brd)
 {
-	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
-		return;
-
 	brd->re_map_membase = ioremap(brd->membase, 0x1000);
 }
 
-- 
1.9.1

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

* [PATCH 2/2] staging: dgnc: remove redundant null check in
@ 2016-05-20  9:51 ` Daeseok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: Daeseok Youn @ 2016-05-20  9:51 UTC (permalink / raw)
  To: lidza.louina
  Cc: markh, gregkh, driverdev-devel, devel, linux-kernel, kernel-janitors

the "brd" was already checked for NULL before calling dgnc_do_remap().

Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
---
 drivers/staging/dgnc/dgnc_driver.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
index 22257d2..1882ef5 100644
--- a/drivers/staging/dgnc/dgnc_driver.c
+++ b/drivers/staging/dgnc/dgnc_driver.c
@@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
  */
 static void dgnc_do_remap(struct dgnc_board *brd)
 {
-	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
-		return;
-
 	brd->re_map_membase = ioremap(brd->membase, 0x1000);
 }
 
-- 
1.9.1


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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
  2016-05-20  9:51 ` Daeseok Youn
  (?)
@ 2016-05-25 22:00   ` Luis de Bethencourt
  -1 siblings, 0 replies; 11+ messages in thread
From: Luis de Bethencourt @ 2016-05-25 22:00 UTC (permalink / raw)
  To: Daeseok Youn, lidza.louina
  Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel

On 20/05/16 10:51, Daeseok Youn wrote:
> the "brd" was already checked for NULL before calling dgnc_do_remap().
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index 22257d2..1882ef5 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>   */
>  static void dgnc_do_remap(struct dgnc_board *brd)
>  {
> -	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
> -		return;
> -
>  	brd->re_map_membase = ioremap(brd->membase, 0x1000);
>  }
>  
> 

Same comment as the 1/2 patch.

Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?

Thanks,
Luis

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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
@ 2016-05-25 22:00   ` Luis de Bethencourt
  0 siblings, 0 replies; 11+ messages in thread
From: Luis de Bethencourt @ 2016-05-25 22:00 UTC (permalink / raw)
  To: Daeseok Youn, lidza.louina
  Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel

On 20/05/16 10:51, Daeseok Youn wrote:
> the "brd" was already checked for NULL before calling dgnc_do_remap().
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index 22257d2..1882ef5 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>   */
>  static void dgnc_do_remap(struct dgnc_board *brd)
>  {
> -	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
> -		return;
> -
>  	brd->re_map_membase = ioremap(brd->membase, 0x1000);
>  }
>  
> 

Same comment as the 1/2 patch.

Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?

Thanks,
Luis

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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
@ 2016-05-25 22:00   ` Luis de Bethencourt
  0 siblings, 0 replies; 11+ messages in thread
From: Luis de Bethencourt @ 2016-05-25 22:00 UTC (permalink / raw)
  To: Daeseok Youn, lidza.louina
  Cc: devel, gregkh, driverdev-devel, kernel-janitors, linux-kernel

On 20/05/16 10:51, Daeseok Youn wrote:
> the "brd" was already checked for NULL before calling dgnc_do_remap().
> 
> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
> ---
>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>  1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
> index 22257d2..1882ef5 100644
> --- a/drivers/staging/dgnc/dgnc_driver.c
> +++ b/drivers/staging/dgnc/dgnc_driver.c
> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>   */
>  static void dgnc_do_remap(struct dgnc_board *brd)
>  {
> -	if (!brd || brd->magic != DGNC_BOARD_MAGIC)
> -		return;
> -
>  	brd->re_map_membase = ioremap(brd->membase, 0x1000);
>  }
>  
> 

Same comment as the 1/2 patch.

Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?

Thanks,
Luis
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
  2016-05-25 22:00   ` Luis de Bethencourt
  (?)
@ 2016-05-26  4:59     ` DaeSeok Youn
  -1 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-05-26  4:59 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: Lidza Louina, devel, Greg KH, driverdev-devel, kernel-janitors,
	linux-kernel

2016-05-26 7:00 GMT+09:00 Luis de Bethencourt <luisbg@osg.samsung.com>:
> On 20/05/16 10:51, Daeseok Youn wrote:
>> the "brd" was already checked for NULL before calling dgnc_do_remap().
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
>> index 22257d2..1882ef5 100644
>> --- a/drivers/staging/dgnc/dgnc_driver.c
>> +++ b/drivers/staging/dgnc/dgnc_driver.c
>> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>>   */
>>  static void dgnc_do_remap(struct dgnc_board *brd)
>>  {
>> -     if (!brd || brd->magic != DGNC_BOARD_MAGIC)
>> -             return;
>> -
>>       brd->re_map_membase = ioremap(brd->membase, 0x1000);
>>  }
>>
>>
>
> Same comment as the 1/2 patch.
I sent an e-mail from the 1/2 patch. it has same reason for this patch.

dgnc_do_remap() function is called twice only in dgnc_found_board() function.
and also DNGC_BOARD_MAGIC was assigned into "brd->magic".

So I think it doesn't need to check about DGNC_BOARD_MAGIC.

thanks
regards,
Daeseok.

>
> Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?
>
> Thanks,
> Luis

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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
@ 2016-05-26  4:59     ` DaeSeok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-05-26  4:59 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: Lidza Louina, devel, Greg KH, driverdev-devel, kernel-janitors,
	linux-kernel

2016-05-26 7:00 GMT+09:00 Luis de Bethencourt <luisbg@osg.samsung.com>:
> On 20/05/16 10:51, Daeseok Youn wrote:
>> the "brd" was already checked for NULL before calling dgnc_do_remap().
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
>> index 22257d2..1882ef5 100644
>> --- a/drivers/staging/dgnc/dgnc_driver.c
>> +++ b/drivers/staging/dgnc/dgnc_driver.c
>> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>>   */
>>  static void dgnc_do_remap(struct dgnc_board *brd)
>>  {
>> -     if (!brd || brd->magic != DGNC_BOARD_MAGIC)
>> -             return;
>> -
>>       brd->re_map_membase = ioremap(brd->membase, 0x1000);
>>  }
>>
>>
>
> Same comment as the 1/2 patch.
I sent an e-mail from the 1/2 patch. it has same reason for this patch.

dgnc_do_remap() function is called twice only in dgnc_found_board() function.
and also DNGC_BOARD_MAGIC was assigned into "brd->magic".

So I think it doesn't need to check about DGNC_BOARD_MAGIC.

thanks
regards,
Daeseok.

>
> Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?
>
> Thanks,
> Luis

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

* Re: [PATCH 2/2] staging: dgnc: remove redundant null check in
@ 2016-05-26  4:59     ` DaeSeok Youn
  0 siblings, 0 replies; 11+ messages in thread
From: DaeSeok Youn @ 2016-05-26  4:59 UTC (permalink / raw)
  To: Luis de Bethencourt
  Cc: Lidza Louina, devel, Greg KH, driverdev-devel, kernel-janitors,
	linux-kernel

2016-05-26 7:00 GMT+09:00 Luis de Bethencourt <luisbg@osg.samsung.com>:
> On 20/05/16 10:51, Daeseok Youn wrote:
>> the "brd" was already checked for NULL before calling dgnc_do_remap().
>>
>> Signed-off-by: Daeseok Youn <daeseok.youn@gmail.com>
>> ---
>>  drivers/staging/dgnc/dgnc_driver.c | 3 ---
>>  1 file changed, 3 deletions(-)
>>
>> diff --git a/drivers/staging/dgnc/dgnc_driver.c b/drivers/staging/dgnc/dgnc_driver.c
>> index 22257d2..1882ef5 100644
>> --- a/drivers/staging/dgnc/dgnc_driver.c
>> +++ b/drivers/staging/dgnc/dgnc_driver.c
>> @@ -599,9 +599,6 @@ static int dgnc_finalize_board_init(struct dgnc_board *brd)
>>   */
>>  static void dgnc_do_remap(struct dgnc_board *brd)
>>  {
>> -     if (!brd || brd->magic != DGNC_BOARD_MAGIC)
>> -             return;
>> -
>>       brd->re_map_membase = ioremap(brd->membase, 0x1000);
>>  }
>>
>>
>
> Same comment as the 1/2 patch.
I sent an e-mail from the 1/2 patch. it has same reason for this patch.

dgnc_do_remap() function is called twice only in dgnc_found_board() function.
and also DNGC_BOARD_MAGIC was assigned into "brd->magic".

So I think it doesn't need to check about DGNC_BOARD_MAGIC.

thanks
regards,
Daeseok.

>
> Do you want to keep the brd->magic != DGNC_BOARD_MAGIC check?
>
> Thanks,
> Luis

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

end of thread, other threads:[~2016-05-26  4:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20  9:51 [PATCH 2/2] staging: dgnc: remove redundant null check in Daeseok Youn
2016-05-20  9:51 ` Daeseok Youn
2016-05-25 22:00 ` Luis de Bethencourt
2016-05-25 22:00   ` Luis de Bethencourt
2016-05-25 22:00   ` Luis de Bethencourt
2016-05-26  4:59   ` DaeSeok Youn
2016-05-26  4:59     ` DaeSeok Youn
2016-05-26  4:59     ` DaeSeok Youn
  -- strict thread matches above, loose matches on Subject: below --
2016-04-05  9:30 [PATCH 2/2] staging: dgnc: remove redundant NULL " Daeseok Youn
2016-04-05  9:30 ` Daeseok Youn
2016-04-05  9:30 ` Daeseok Youn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.