diff mbox

i2c: jz4780: drop superfluous init

Message ID 1465119702-4417-1-git-send-email-wsa@the-dreams.de
State Accepted
Headers show

Commit Message

Wolfram Sang June 5, 2016, 9:41 a.m. UTC
David reported that the length for memset was incorrect (element sizes
were not taken into account). Then I saw that we are clearing kzalloced
memory, so we can simply drop this code.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---

Only compile tested, due to no HW.

 drivers/i2c/busses/i2c-jz4780.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Axel Lin June 7, 2016, 6:47 a.m. UTC | #1
2016-06-05 17:41 GMT+08:00 Wolfram Sang <wsa@the-dreams.de>:
> David reported that the length for memset was incorrect (element sizes
> were not taken into account). Then I saw that we are clearing kzalloced
> memory, so we can simply drop this code.
>
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Wolfram Sang June 9, 2016, 8:31 p.m. UTC | #2
On Sun, Jun 05, 2016 at 11:41:42AM +0200, Wolfram Sang wrote:
> David reported that the length for memset was incorrect (element sizes
> were not taken into account). Then I saw that we are clearing kzalloced
> memory, so we can simply drop this code.
> 
> Reported-by: David Binderman <dcb314@hotmail.com>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Applied to for-next, thanks!
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-jz4780.c b/drivers/i2c/busses/i2c-jz4780.c
index ba14a863b451f9..cd9872594fe2a0 100644
--- a/drivers/i2c/busses/i2c-jz4780.c
+++ b/drivers/i2c/busses/i2c-jz4780.c
@@ -791,10 +791,6 @@  static int jz4780_i2c_probe(struct platform_device *pdev)
 
 	jz4780_i2c_writew(i2c, JZ4780_I2C_INTM, 0x0);
 
-	i2c->cmd = 0;
-	memset(i2c->cmd_buf, 0, BUFSIZE);
-	memset(i2c->data_buf, 0, BUFSIZE);
-
 	i2c->irq = platform_get_irq(pdev, 0);
 	ret = devm_request_irq(&pdev->dev, i2c->irq, jz4780_i2c_irq, 0,
 			       dev_name(&pdev->dev), i2c);