Skip to contentSkip to conversation

Staging: rts5208: fix check for dma mapping error

PATCH In review Haneen Mohammed 2 participants 4 messages Feb 9, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: rts5208: fix check for dma mapping error

use dma_mapping_error() instead of comparing the returned address with zero after dma_map_single().

---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_transport.c +1 -1
index f27491e..0c9549b 100644
@@ -653,7 +653,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 		return -ENXIO;
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
-	if (!addr)
+	if (dma_mapping_error(&rtsx->pci->dev, addr))
 		return -ENOMEM;
 
 	if (card == SD_CARD)
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Haneen Mohammed

use dma_mapping_error() instead of comparing the returned address with zero after dma_map_single().

However, the parentheses in &(rtsx->pci->dev) are really unpleasant. Especially since they make the call to dma_map_single different from the call to dma_mapping_error.

Maybe you could send a patch series to also get rid of them?

julia

Quoted 29 lines
---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_transport.c +1 -2
index f27491e..0c9549b 100644
@@ -653,7 +653,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 		return -ENXIO;
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
-	if (!addr)
+	if (dma_mapping_error(&rtsx->pci->dev, addr))
 		return -ENOMEM;
 
 	if (card == SD_CARD)
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160209103540.GA27735%40haneenVB.
For more options, visit https://groups.google.com/d/optout.

#2 lore raw
Quoted 9 lines · Julia Lawall
Quoted 2 lines · Haneen Mohammed

use dma_mapping_error() instead of comparing the returned address with zero after dma_map_single().

Quoted 8 lines

However, the parentheses in &(rtsx->pci->dev) are really unpleasant. Especially since they make the call to dma_map_single different from the call to dma_mapping_error.

Maybe you could send a patch series to also get rid of them?

julia

Sure. should I send it as v2? Also, I noticed in the discussion in the previous thread about keeping the acked, yet I'm not sure how to do it. could yo advise me on that please?

Thank you,
Haneen

Quoted 29 lines
Quoted 29 lines
---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_transport.c +1 -2
index f27491e..0c9549b 100644
@@ -653,7 +653,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 		return -ENXIO;
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
-	if (!addr)
+	if (dma_mapping_error(&rtsx->pci->dev, addr))
 		return -ENOMEM;
 
 	if (card == SD_CARD)
--

1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160209103540.GA27735%40haneenVB.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw
Quoted 14 lines · Haneen Mohammed
Quoted 13 lines · Julia Lawall
Quoted 2 lines · Haneen Mohammed

use dma_mapping_error() instead of comparing the returned address with zero after dma_map_single().

However, the parentheses in &(rtsx->pci->dev) are really unpleasant. Especially since they make the call to dma_map_single different from the call to dma_mapping_error.

Quoted 7 lines
Quoted 4 lines

Maybe you could send a patch series to also get rid of them?

julia

Sure. should I send it as v2? Also, I noticed in the discussion in the previous thread about keeping the acked, yet I'm not sure how to do it. could yo advise me on that please?

Yes, a v2 would be good.

For the ack, just put it under your signed off by, for the specific patch that I acked.

julia

Quoted 40 lines

Thank you,
Haneen

Quoted 22 lines
Quoted 22 lines
---
 drivers/staging/rts5208/rtsx_transport.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rts5208/rtsx_transport.c +1 -2
index f27491e..0c9549b 100644
@@ -653,7 +653,7 @@ static int rtsx_transfer_buf(struct rtsx_chip *chip, u8 card, void *buf,
 		return -ENXIO;
 
 	addr = dma_map_single(&(rtsx->pci->dev), buf, len, dma_dir);
-	if (!addr)
+	if (dma_mapping_error(&rtsx->pci->dev, addr))
 		return -ENOMEM;
 
 	if (card == SD_CARD)
--

1.9.1

Quoted 7 lines
Quoted 7 lines

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160209103540.GA27735%40haneenVB.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20160209112101.GA27970%40haneenVB.
For more options, visit https://groups.google.com/d/optout.