Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 309167b9 authored by Aishwarya Pant's avatar Aishwarya Pant Committed by Mauro Carvalho Chehab
Browse files

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: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent eab638a8
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -1153,10 +1153,8 @@ static int ap1302_probe(struct i2c_client *client,

	/* allocate device & init sub device */
	dev = devm_kzalloc(&client->dev, 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);

+1 −3
Original line number Diff line number Diff line
@@ -1385,10 +1385,8 @@ static int gc0310_probe(struct i2c_client *client,

	pr_info("%s S\n", __func__);
	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (!dev) {
		dev_err(&client->dev, "out of memory\n");
	if (!dev)
		return -ENOMEM;
	}

	mutex_init(&dev->input_lock);

+1 −3
Original line number Diff line number Diff line
@@ -1123,10 +1123,8 @@ static int gc2235_probe(struct i2c_client *client,
	unsigned int i;

	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (!dev) {
		dev_err(&client->dev, "out of memory\n");
	if (!dev)
		return -ENOMEM;
	}

	mutex_init(&dev->input_lock);

+1 −3
Original line number Diff line number Diff line
@@ -871,10 +871,8 @@ static int lm3554_probe(struct i2c_client *client,
	int ret;

	flash = kzalloc(sizeof(*flash), GFP_KERNEL);
	if (!flash) {
		dev_err(&client->dev, "out of memory\n");
	if (!flash)
		return -ENOMEM;
	}

	flash->pdata = client->dev.platform_data;

+1 −3
Original line number Diff line number Diff line
@@ -1863,10 +1863,8 @@ static int mt9m114_probe(struct i2c_client *client,

	/* Setup sensor configuration structure */
	dev = kzalloc(sizeof(*dev), GFP_KERNEL);
	if (!dev) {
		dev_err(&client->dev, "out of memory\n");
	if (!dev)
		return -ENOMEM;
	}

	v4l2_i2c_subdev_init(&dev->sd, client, &mt9m114_ops);
	pdata = client->dev.platform_data;
Loading