Skip to contentSkip to conversation

variable name is never null, so remove null check

PATCH New Colin King 1 participant 1 message Sep 6, 2016

Subsystems (2)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 variable name is never null, so remove null check

From: Colin Ian King <[email protected]>

The variable name is always assigned to a literal string in the proceeding switch statement, so it is never null and hence the null check is redundant. Remove null the check.

---
 drivers/media/usb/pvrusb2/pvrusb2-sysfs.c | 1 -
 1 file changed, 1 deletion(-)
drivers/media/usb/pvrusb2/pvrusb2-sysfs.c +0 -1
index 06fe63c..d977976 100644
@@ -116,7 +116,6 @@ static ssize_t show_type(struct device *class_dev,
 	}
 	pvr2_sysfs_trace("pvr2_sysfs(%p) show_type(cid=%d) is %s",
 			 cip->chptr, cip->ctl_id, name);
-	if (!name) return -EINVAL;
 	return scnprintf(buf, PAGE_SIZE, "%s\n", name);
 }
 
Signature · 1 line
2.9.3