From 309167b966b61c2aef2c268c4a0c25334d6310bd Mon Sep 17 00:00:00 2001 From: Aishwarya Pant Date: Tue, 17 Oct 2017 09:14:47 -0400 Subject: media: staging: atomisp: cleanup out of memory messages Logging of explicit out of memory messages is redundant since memory allocation failures produce a backtrace. Done with the help of the following cocci script: @@ expression ex, ret; statement s; constant char[] c; constant err; identifier f, l; @@ ex = \(kmalloc\|kmalloc_array\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\| kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\|devm_kzalloc\)(...) ... when != ex if ( ( !ex | unlikely(!ex) ) ) - { - f(..., c, ...); ( return ex; | return; | return err; | goto l; ) - } else s Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/atomisp/i2c/ov8858.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/staging/media/atomisp/i2c/ov8858.c') diff --git a/drivers/staging/media/atomisp/i2c/ov8858.c b/drivers/staging/media/atomisp/i2c/ov8858.c index 43e1638fd674..918139d3d3c0 100644 --- a/drivers/staging/media/atomisp/i2c/ov8858.c +++ b/drivers/staging/media/atomisp/i2c/ov8858.c @@ -480,8 +480,6 @@ static int ov8858_priv_int_data_init(struct v4l2_subdev *sd) if (!dev->otp_data) { dev->otp_data = devm_kzalloc(&client->dev, size, GFP_KERNEL); if (!dev->otp_data) { - dev_err(&client->dev, "%s: can't allocate memory", - __func__); r = -ENOMEM; goto error3; } @@ -2094,10 +2092,8 @@ static int ov8858_probe(struct i2c_client *client, /* allocate sensor device & init sub device */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); - if (!dev) { - dev_err(&client->dev, "%s: out of memory\n", __func__); + if (!dev) return -ENOMEM; - } mutex_init(&dev->input_lock); -- cgit