Skip to contentSkip to conversation

staging: dgap: adds missing iounmap for re_map_port in dgap_release_remap()

PATCH In review Daeseok Youn 2 participants 4 messages Sep 23, 2014 – Sep 25, 2014 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 staging: dgap: adds missing iounmap for re_map_port in dgap_release_remap()

---
 drivers/staging/dgap/dgap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/dgap/dgap.c +1 -0
index 779d144..637ea8a 100644
@@ -1026,6 +1026,7 @@ static void dgap_release_remap(struct board_t *brd)
 	release_mem_region(brd->membase, 0x200000);
 	release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
 	iounmap(brd->re_map_membase);
+	iounmap(brd->re_map_port);
 }
 /*****************************************************************************
 *
Signature · 1 line
1.7.1
#1 lore raw
Quoted 10 lines · Daeseok Youn
---
 drivers/staging/dgap/dgap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/staging/dgap/dgap.c +0 -0
index 779d144..637ea8a 100644

drivers/staging/dgap/dgap.c static void dgap_release_remap(struct board_t *brd) · line 1029

Quoted 4 lines
drivers/staging/dgap/dgap.c +1 -0
@@ -1026,6 +1026,7 @@ static void dgap_release_remap(struct board_t *brd)
 	release_mem_region(brd->membase, 0x200000);
 	release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
 	iounmap(brd->re_map_membase);
+	iounmap(brd->re_map_port);

I don't think it matters, but at least aesthetically it would be better to unmap first and then release the regions. (You can do this in a different patch).

regards,
dan carpenter

#2 lore raw
Quoted 6 lines · Dan Carpenter
Quoted 5 lines · Daeseok Youn
---
 drivers/staging/dgap/dgap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 15 lines

drivers/staging/dgap/dgap.c static void dgap_release_remap(struct board_t *brd) · line 1029

Quoted 9 lines
drivers/staging/dgap/dgap.c +1 -0
index 779d144..637ea8a 100644
@@ -1026,6 +1026,7 @@ static void dgap_release_remap(struct board_t *brd)
 	release_mem_region(brd->membase, 0x200000);
 	release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
 	iounmap(brd->re_map_membase);
+	iounmap(brd->re_map_port);

I don't think it matters, but at least aesthetically it would be better to unmap first and then release the regions. (You can do this in a different patch).

Also dgap_do_remap() unwinds in the wrong order and is sucky. It should use gotos.

Also the name dgap_do_remap() isn't great. Remap is a verb not a noun so the "_do" isn't needed. Just dgap_remap() and dgap_release_remap() could be changed to dgap_unmap().

regards,
dan carpenter

#3 lore raw

Hi,

2014-09-24 18:42 GMT+09:00 Dan Carpenter <[email protected]>:

Quoted 7 lines · Dan Carpenter
Quoted 6 lines · Daeseok Youn
Quoted 5 lines
---
 drivers/staging/dgap/dgap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
drivers/staging/dgap/dgap.c +0 -0
index 779d144..637ea8a 100644
@@ -1026,6 +1026,7 @@ static void dgap_release_remap(struct board_t *brd)
    release_mem_region(brd->membase, 0x200000);
Quoted 8 lines

drivers/staging/dgap/dgap.c static void dgap_release_remap(struct board_t *brd) · line 1029

Quoted 3 lines
drivers/staging/dgap/dgap.c +1 -0
    release_mem_region(brd->membase + PCI_IO_OFFSET, 0x200000);
    iounmap(brd->re_map_membase);
+   iounmap(brd->re_map_port);

I don't think it matters, but at least aesthetically it would be better to unmap first and then release the regions. (You can do this in a different patch).

Ok. I will make another patch as your comment.

Quoted 8 lines
Quoted 1 line

Also dgap_do_remap() unwinds in the wrong order and is sucky. It should use gotos.

Also the name dgap_do_remap() isn't great. Remap is a verb not a noun so the "_do" isn't needed. Just dgap_remap() and dgap_release_remap() could be changed to dgap_unmap().

OK. rename those functions.

Thanks.

regards,
Daeseok Youn.

Quoted 4 lines

regards,
dan carpenter