Skip to contentSkip to conversation

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

PATCH In review aybuke ozdemir 2 participants 3 messages Feb 25, 2015 – Feb 26, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 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 | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/i2o/device.c +1 -3
index 2af2255..e47496c 100644
@@ -565,10 +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) {
-		printk(KERN_ERR "i2o: no memory for query buffer.\n");
+	if (opblk == NULL)
 		return -ENOMEM;
-	}
 
 	opblk[0] = 1;		/* operation count */
 	opblk[1] = 0;		/* pad */
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 2/2 Staging: i2o: Corrected code indentation

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 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/i2o/device.c +8 -8
index e47496c..cd6da9c 100644
@@ -260,10 +260,10 @@ 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)
-		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
-				       &i2o_dev->device.kobj, "user");
+		if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
+						&& (tmp != i2o_dev)) {
+			rc = sysfs_create_link(&tmp->device.kobj,
+						&i2o_dev->device.kobj, "user");
 		if (rc)
 			goto rmlink1;
 	}
@@ -279,10 +279,10 @@ 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)
-		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
-				       &i2o_dev->device.kobj, "parent");
+		if ((tmp->lct_data.parent_tid == i2o_dev->lct_data.tid)
+						&& (tmp != i2o_dev)) {
+			rc = sysfs_create_link(&tmp->device.kobj,
+						&i2o_dev->device.kobj, "parent");
 		if (rc)
 			goto rmlink2;
 	}
Signature · 1 line
1.9.1
maintainer
#2 lore raw

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

Quoted 17 lines · 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 | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/staging/i2o/device.c +0 -0
index e47496c..cd6da9c 100644
@@ -260,10 +260,10 @@ 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)

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

Quoted 10 lines
drivers/staging/i2o/device.c +4 -4
-	    if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
-		&& (tmp != i2o_dev)) {
-		rc = sysfs_create_link(&tmp->device.kobj,
-				       &i2o_dev->device.kobj, "user");
+		if ((tmp->lct_data.user_tid == i2o_dev->lct_data.tid)
+						&& (tmp != i2o_dev)) {
+			rc = sysfs_create_link(&tmp->device.kobj,
+						&i2o_dev->device.kobj, "user");
 		if (rc)
 			goto rmlink1;

Something is still wrong with the indentation here, sorry. Look at the { placement.

thanks,

greg k-h