[PATCH] i2c: remove casting dma_alloc
Subsystems:
freescale i2c cpm driver , i2c subsystem , i2c subsystem host drivers , the rest
STALE2583d
6 messages,
3 authors,
2019-07-05
· open the first message on its own page
From: Vasyl <redacted>
Generated by: alloc_cast.cocci
Signed-off-by: Vasyl <redacted>
---
drivers/i2c/busses/i2c-cpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 187900594e3d..1213e1932ccb 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c @@ -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 ; --
2.17.1
On Sun, Jun 23, 2019 at 11:13:53PM +0200, Vasyl Gomonovych wrote: From: Vasyl <redacted>
Generated by: alloc_cast.cocci
Signed-off-by: Vasyl <redacted>
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 hunk ---
drivers/i2c/busses/i2c-cpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 187900594e3d..1213e1932ccb 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c @@ -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 ; --
2.17.1
<div dir='auto'>Hi Wolfram,<div dir="auto"><br></div><div dir="auto">yes, I'm still here. However, I don't have the hardware anymore to test the patch.</div><div dir="auto"><br></div><div dir="auto">Thanks, Jochen </div></div><div class="gmail_extra"><br><div class="gmail_quote">Am 29.06.2019 13:34 schrieb Wolfram Sang <wsa@the-dreams.de>:<br type="attribution" /><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">On Sun, Jun 23, 2019 at 11:13:53PM +0200, Vasyl Gomonovych wrote: <br>
> From: Vasyl <gomonovych@gmail.com> <br>
> <br>
> Generated by: alloc_cast.cocci <br>
> <br>
> Signed-off-by: Vasyl <gomonovych@gmail.com> <br>
<br>
Your other patches in git history have your full name. Why not this one? <br>
<br>
@Jochen: are you still there, your ack would be very welcome. <br>
<br>
> --- <br>
> drivers/i2c/busses/i2c-cpm.c | 4 +++- <br>
> 1 file changed, 3 insertions(+), 1 deletion(-) <br>
> <br>
> diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c <br>
> index 187900594e3d..1213e1932ccb 100644 <br>
> --- a/drivers/i2c/busses/i2c-cpm.c <br>
> +++ b/drivers/i2c/busses/i2c-cpm.c <br>
> @@ -531,7 +531,9 @@ static int cpm_i2c_setup(struct cpm_i2c *cpm) <br>
> 		} <br>
> 		out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); <br>
> <br>
> -		cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); <br>
> +		cpm->txbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev, <br>
> +						 CPM_MAX_READ + 1, <br>
> +						 &cpm->txdma[i], GFP_KERNEL); <br>
> 		if (!cpm->txbuf[i]) { <br>
> 			ret = -ENOMEM; <br>
> 			goto out_muram; <br>
> -- <br>
> 2.17.1 <br>
> <br>
</p>
</blockquote></div><br></div>
Hi Jochen,
(could you send text emails, please?)
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
From: Vasyl <redacted>
Generated by: alloc_cast.cocci
Signed-off-by: Vasyl <redacted> Acked-by: Jochen Friedrich <jochen@scram.de> quoted hunk ---
drivers/i2c/busses/i2c-cpm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 187900594e3d..1213e1932ccb 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c @@ -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 ;
On Sun, Jun 23, 2019 at 11:13:53PM +0200, Vasyl Gomonovych wrote: From: Vasyl <redacted>
Generated by: alloc_cast.cocci
Signed-off-by: Vasyl <redacted>
Applied to for-next, thanks! I fixed the missing full name for you, but
please fix your setup.