Skip to contentSkip to conversation

staging: dgnc: remove redundant null check in

PATCH Superseded Daeseok Youn 2 participants 3 messages May 20, 2016 – May 26, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 staging: dgnc: remove redundant null check in

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

---
 drivers/staging/dgnc/dgnc_driver.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -3
index 22257d2..1882ef5 100644
@@ -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);
 }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 13 lines · Daeseok Youn

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

---
 drivers/staging/dgnc/dgnc_driver.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -0
index 22257d2..1882ef5 100644

drivers/staging/dgnc/dgnc_driver.c static int dgnc_finalize_board_init(struct dgnc_board *brd) · line 604

Quoted 9 lines
drivers/staging/dgnc/dgnc_driver.c +0 -3
@@ -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

#2 lore raw

2016-05-26 7:00 GMT+09:00 Luis de Bethencourt <[email protected]>:

Quoted 17 lines · Daeseok Youn
Quoted 16 lines

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

---
 drivers/staging/dgnc/dgnc_driver.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/staging/dgnc/dgnc_driver.c +0 -1
index 22257d2..1882ef5 100644
@@ -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)
Quoted 8 lines

drivers/staging/dgnc/dgnc_driver.c static int dgnc_finalize_board_init(struct dgnc_board *brd) · line 604

Quoted 6 lines
drivers/staging/dgnc/dgnc_driver.c +0 -2
-             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.

Quoted 5 lines

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

Thanks,
Luis