Commit 3b443def authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Guenter Roeck

hwmon: (core) remove redundant cast

struct attribute::name which this local variable name is eventually
assigned to is "const char*", and so is the template parameter. We might
as well preserve the constness all the way through.
Signed-off-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 6e5c06ad
......@@ -267,7 +267,7 @@ static struct attribute *hwmon_genattr(struct device *dev,
struct device_attribute *dattr;
struct attribute *a;
umode_t mode;
char *name;
const char *name;
bool is_string = is_string_attr(type, attr);
/* The attribute is invisible if there is no template string */
......@@ -289,7 +289,7 @@ static struct attribute *hwmon_genattr(struct device *dev,
return ERR_PTR(-ENOMEM);
if (type == hwmon_chip) {
name = (char *)template;
name = template;
} else {
scnprintf(hattr->name, sizeof(hattr->name), template,
index + hwmon_attr_base(type));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment