Skip to content

Commit

Permalink
hwmon: (core) remove redundant cast
Browse files Browse the repository at this point in the history
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: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
Rasmus Villemoes authored and Guenter Roeck committed Dec 3, 2018
1 parent 6e5c06a commit 3b443de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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));
Expand Down

0 comments on commit 3b443de

Please sign in to comment.