]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
hwmon: (core) remove redundant cast
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Fri, 26 Oct 2018 22:30:59 +0000 (00:30 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 3 Dec 2018 00:25:28 +0000 (16:25 -0800)
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>
drivers/hwmon/hwmon.c

index 84f61cec6319c8eb65ccc80553cbbdfde0542cc9..36ed50d4b276fccd40bfc88f18b019b52083bd9d 100644 (file)
@@ -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));