Skip to contentSkip to conversation

Staging: i2o: Remove unnecessary 'out of memory' message

PATCH Superseded aybuke ozdemir 3 participants 8 messages Feb 25, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Staging: i2o: Remove unnecessary 'out of memory' message

This patch removes unnecessay out of memory message fixing the following checkpach.pl warning in device.c

---
 drivers/staging/i2o/device.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/i2o/device.c +0 -1
index 2af2255..162a887 100644
@@ -566,7 +566,6 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group,
 
 	opblk = kmalloc(size, GFP_KERNEL);
 	if (opblk == NULL) {
-		printk(KERN_ERR "i2o: no memory for query buffer.\n");
 		return -ENOMEM;
 	}
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 Staging: i2o: Remove unnecessary braces

Brackets were removed from the expression that containing single statement. Removed following checkpatch.pl warnings:
WARNING: braces {} are not necessary for single statement blocks

---
 drivers/staging/i2o/device.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/i2o/device.c +1 -2
index 162a887..e47496c 100644
@@ -565,9 +565,8 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group,
 		size += 4 - size % 4;
 
 	opblk = kmalloc(size, GFP_KERNEL);
-	if (opblk == NULL) {
+	if (opblk == NULL)
 		return -ENOMEM;
-	}
 
 	opblk[0] = 1;		/* operation count */
 	opblk[1] = 0;		/* pad */
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/3 Staging: i2o: Corrected code indentation

In reply to aybuke ozdemir

WARNING: suspect code indent for conditional statements(8,12) spaces are converting to tabs suspect code indent is deleted. That was found by running checkpatch.pl

---
 drivers/staging/i2o/device.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/i2o/device.c +4 -4
index e47496c..d643043 100644
@@ -260,9 +260,9 @@ static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
 
 	/* create user entries referring to this device */
 	list_for_each_entry(tmp, &c->devices, list)
-	    if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
+		if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
 		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
+			rc = sysfs_create_link(&tmp->device.kobj,
 				       &i2o_dev->device.kobj, "user");
 		if (rc)
 			goto rmlink1;
@@ -279,9 +279,9 @@ static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
 
 	/* create parent entries referring to this device */
 	list_for_each_entry(tmp, &c->devices, list)
-	    if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
+		if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
 		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
+			rc = sysfs_create_link(&tmp->device.kobj,
 				       &i2o_dev->device.kobj, "parent");
 		if (rc)
 			goto rmlink2;
Signature · 1 line
1.9.1
#3 lore raw

Re: [Outreachy kernel] [PATCH 3/3] Staging: i2o: Corrected code indentation

drivers/staging/i2o/device.c static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry) · line 264

Quoted 4 lines
drivers/staging/i2o/device.c +1 -1
 	list_for_each_entry(tmp, &c->devices, list)
-	    if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
+		if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
 		&& (tmp != i2o_dev)) {

The line above should not be left aligned with the if.

drivers/staging/i2o/device.c static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry) · line 266

Quoted 3 lines
drivers/staging/i2o/device.c +1 -1
-		rc = sysfs_create_link(&tmp->device.kobj,
+			rc = sysfs_create_link(&tmp->device.kobj,
 				       &i2o_dev->device.kobj, "user");

Maybe it is possible to push the second line of the call to the right a bit more to align with the start of the argument on the line before.

The same comments apply below.

julia

Quoted 24 lines
drivers/staging/i2o/device.c +2 -2
 		if (rc)
 			goto rmlink1;
@@ -279,9 +279,9 @@ static int i2o_device_add(struct i2o_controller *c, i2o_lct_entry *entry)
 
 	/* create parent entries referring to this device */
 	list_for_each_entry(tmp, &c->devices, list)
-	    if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
+		if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
 		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
+			rc = sysfs_create_link(&tmp->device.kobj,
 				       &i2o_dev->device.kobj, "parent");
 		if (rc)
 			goto rmlink2;
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424902222-10105-3-git-send-email-aybuke.147%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
#4 lore raw
In reply to aybuke ozdemir
Quoted 1 line · aybuke ozdemir

This patch removes unnecessay out of memory message fixing the following

unnecessary

Quoted 12 lines

checkpach.pl warning in device.c

---
 drivers/staging/i2o/device.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/i2o/device.c +0 -0
index 2af2255..162a887 100644

drivers/staging/i2o/device.c int i2o_parm_table_get(struct i2o_device *dev, int oper, int group, · line 570

Quoted 6 lines
drivers/staging/i2o/device.c +0 -1
@@ -566,7 +566,6 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group,
 
 	opblk = kmalloc(size, GFP_KERNEL);
 	if (opblk == NULL) {
-		printk(KERN_ERR "i2o: no memory for query buffer.\n");
 		return -ENOMEM;
 	}

Now you don't need the braces. Your change should not introduce new checkpatch errors.

julia

Quoted 10 lines
Signature · 8 lines
1.9.1

-- 
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1424902222-10105-1-git-send-email-aybuke.147%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
maintainer
#5 lore raw
In reply to aybuke ozdemir
Quoted 22 lines · aybuke ozdemir

This patch removes unnecessay out of memory message fixing the following checkpach.pl warning in device.c

---
 drivers/staging/i2o/device.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/i2o/device.c +0 -1
index 2af2255..162a887 100644
@@ -566,7 +566,6 @@ int i2o_parm_table_get(struct i2o_device *dev, int oper, int group,
 
 	opblk = kmalloc(size, GFP_KERNEL);
 	if (opblk == NULL) {
-		printk(KERN_ERR "i2o: no memory for query buffer.\n");
 		return -ENOMEM;
 	}
 
Signature · 1 line
1.9.1

I'll take these, but please stay away from the i2o drivers, they are going to be removed from the kernel soon and are not worth the cleanup.

thanks,

greg k-h

#6 lore raw
Quoted 2 lines

I'll take these, but please stay away from the i2o drivers, they are going to be removed from the kernel soon and are not worth the cleanup.

Aybuke,

There is a list of directories to avoid in:

http://kernelnewbies.org/Outreachyfirstpatch

In the section Find a driver to clean up. Concretely,

i2o
line6
media/parport
media/tlg2300
media/vino

julia

#7 lore raw

I am sorry, I'm clean now. Thanks :)

2015-02-26 1:03 GMT+02:00 Julia Lawall <[email protected]>:

Quoted 19 lines
Quoted 2 lines

I'll take these, but please stay away from the i2o drivers, they are going to be removed from the kernel soon and are not worth the cleanup.

Aybuke,

There is a list of directories to avoid in:

http://kernelnewbies.org/Outreachyfirstpatch

In the section Find a driver to clean up. Concretely,

i2o
line6
media/parport
media/tlg2300
media/vino

julia

Signature · 2 lines
Aybüke Özdemir
http://www.aybukeozdemir.com