Skip to contentSkip to conversation

hwmon: drop unnecessary OF name NULL checks

PATCH Applied Rob Herring 2 participants 2 messages Aug 29, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: drop unnecessary OF name NULL checks

Checking the child node names is pointless as the DT node name can never be NULL, so remove it.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
 drivers/hwmon/ibmpowernv.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/hwmon/ibmpowernv.c +0 -6
index 4935897f1527..0ccca87f5271 100644
@@ -458,9 +458,6 @@ static int populate_attr_groups(struct platform_device *pdev)
 	for_each_child_of_node(opal, np) {
 		const char *label;
 
-		if (np->name == NULL)
-			continue;
-
 		type = get_sensor_type(np);
 		if (type == MAX_SENSOR_TYPE)
 			continue;
@@ -589,9 +586,6 @@ static int create_device_attrs(struct platform_device *pdev)
 		const char *label;
 		enum sensors type;
 
-		if (np->name == NULL)
-			continue;
-
 		type = get_sensor_type(np);
 		if (type == MAX_SENSOR_TYPE)
 			continue;
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 11 lines · Rob Herring

Checking the child node names is pointless as the DT node name can never be NULL, so remove it.

Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>

Applied to hwmon-next.

Thanks,
Guenter

Quoted 31 lines
---
 drivers/hwmon/ibmpowernv.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/hwmon/ibmpowernv.c +0 -6
index 4935897f1527..0ccca87f5271 100644
@@ -458,9 +458,6 @@ static int populate_attr_groups(struct platform_device *pdev)
 	for_each_child_of_node(opal, np) {
 		const char *label;
 
-		if (np->name == NULL)
-			continue;
-
 		type = get_sensor_type(np);
 		if (type == MAX_SENSOR_TYPE)
 			continue;
@@ -589,9 +586,6 @@ static int create_device_attrs(struct platform_device *pdev)
 		const char *label;
 		enum sensors type;
 
-		if (np->name == NULL)
-			continue;
-
 		type = get_sensor_type(np);
 		if (type == MAX_SENSOR_TYPE)
 			continue;
Signature · 1 line
2.17.1