Skip to contentSkip to conversation

kernel/params.c: remove confusing cast

PATCH In review Rasmus Villemoes 2 participants 2 messages Oct 1, 2015 – Oct 2, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/params.c: remove confusing cast

Both sides of the assignment are const char*, so this cast is unnecessary and confusing.

---
 kernel/params.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/params.c +1 -1
index b6554aa71094..0b433fdb45eb 100644
@@ -709,7 +709,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
 		mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store;
 	else
 		mk->mp->attrs[mk->mp->num].mattr.store = NULL;
-	mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name;
+	mk->mp->attrs[mk->mp->num].mattr.attr.name = name;
 	mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm;
 	mk->mp->num++;
 
Signature · 1 line
2.1.3
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Rasmus Villemoes

Both sides of the assignment are const char*, so this cast is unnecessary and confusing.

Thanks,
Rusty.

Quoted 18 lines
 kernel/params.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/params.c +1 -1
index b6554aa71094..0b433fdb45eb 100644
@@ -709,7 +709,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
 		mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store;
 	else
 		mk->mp->attrs[mk->mp->num].mattr.store = NULL;
-	mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name;
+	mk->mp->attrs[mk->mp->num].mattr.attr.name = name;
 	mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm;
 	mk->mp->num++;
 
Signature · 1 line
2.1.3