Skip to contentSkip to conversation

i2c: remove casting dma_alloc

PATCH Applied Vasyl Gomonovych 3 participants 6 messages Jun 23, 2019 – Jul 5, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c: remove casting dma_alloc

From: Vasyl <[email protected]>

Generated by: alloc_cast.cocci

---
 drivers/i2c/busses/i2c-cpm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-cpm.c +3 -1
index 187900594e3d..1213e1932ccb 100644
@@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
 		}
 		out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));
 
-		cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+		cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev,
+						   CPM_MAX_READ + 1,
+						   &cpm->txdma[i], GFP_KERNEL);
 		if (!cpm->txbuf[i]) {
 			ret = -ENOMEM;
 			goto out_muram;
Signature · 1 line
2.17.1
#1 lore raw
Quoted 5 lines · Vasyl Gomonovych

From: Vasyl <[email protected]>

Generated by: alloc_cast.cocci

Your other patches in git history have your full name. Why not this one?

@Jochen: are you still there, your ack would be very welcome.

Quoted 22 lines
---
 drivers/i2c/busses/i2c-cpm.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-cpm.c +3 -1
index 187900594e3d..1213e1932ccb 100644
@@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
 		}
 		out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));
 
-		cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+		cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev,
+						   CPM_MAX_READ + 1,
+						   &cpm->txdma[i], GFP_KERNEL);
 		if (!cpm->txbuf[i]) {
 			ret = -ENOMEM;
 			goto out_muram;
Signature · 1 line
2.17.1
maintainer
#2 lore raw

Hi Wolfram,
yes, I'm still here. However, I don't have the hardware anymore to test the patch. Thanks, Jochen

Quoted 5 lines · Vasyl Gomonovych

From: Vasyl <[email protected]>

Generated by:  alloc_cast.cocci

Your other patches in git history have your full name. Why not this one?

@Jochen: are you still there, your ack would be very welcome.

Quoted 22 lines

---
  drivers/i2c/busses/i2c-cpm.c | 4 +++-

  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-cpm.c +0 -0
index 187900594e3d..1213e1932ccb 100644
@@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
   		}
   		out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));

drivers/i2c/busses/i2c-cpm.c +3 -1
-		cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+		cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev,
+						   CPM_MAX_READ + 1,
+						   &cpm->txdma[i], GFP_KERNEL);

  if (!cpm->txbuf[i]) {
  ret = -ENOMEM;
  goto out_muram;

Signature · 1 line
2.17.1
#3 lore raw

Hi Jochen,

(could you send text emails, please?)

Quoted 1 line

yes, I'm still here. However, I don't have the hardware anymore to test the patch.

Thanks for answering!

And besides (not) testing, are you still open to review patches to the best of your knowledge (I neither have most of the HW). Or do you prefer to orphan the driver?

Kind regards,

Wolfram

maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Vasyl Gomonovych
Quoted 5 lines

From: Vasyl <[email protected]>

Generated by: alloc_cast.cocci

Quoted 19 lines
---
  drivers/i2c/busses/i2c-cpm.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-cpm.c +3 -1
index 187900594e3d..1213e1932ccb 100644
@@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm)
  		}
  		out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1));
 
-		cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL);
+		cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev,
+						   CPM_MAX_READ + 1,
+						   &cpm->txdma[i], GFP_KERNEL);
  		if (!cpm->txbuf[i]) {
  			ret = -ENOMEM;
  			goto out_muram;