diff options
author | Joe Perches <joe@perches.com> | 2020-09-16 13:40:40 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-02 13:09:10 +0200 |
commit | 973c39115cb308b6b1fe64b4f342996f3eef06d0 (patch) | |
tree | ea2fbd252ceebb4299ea0c03b42929464232adc0 /drivers/base/core.c | |
parent | aa838896d87af561a33ecefea1caa4c15a68bc47 (diff) |
drivers core: Remove strcat uses around sysfs_emit and neaten
strcat is no longer necessary for sysfs_emit and sysfs_emit_at uses.
Convert the strcat uses to sysfs_emit calls and neaten other block
uses of direct returns to use an intermediate const char *.
Signed-off-by: Joe Perches <joe@perches.com>
Link: https://lore.kernel.org/r/5d606519698ce4c8f1203a2b35797d8254c6050a.1600285923.git.joe@perches.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r-- | drivers/base/core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index b1f8762ac451..cfeb06f054d0 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -268,16 +268,16 @@ static ssize_t auto_remove_on_show(struct device *dev, struct device_attribute *attr, char *buf) { struct device_link *link = to_devlink(dev); - char *str; + const char *output; if (link->flags & DL_FLAG_AUTOREMOVE_SUPPLIER) - str = "supplier unbind"; + output = "supplier unbind"; else if (link->flags & DL_FLAG_AUTOREMOVE_CONSUMER) - str = "consumer unbind"; + output = "consumer unbind"; else - str = "never"; + output = "never"; - return sysfs_emit(buf, "%s\n", str); + return sysfs_emit(buf, "%s\n", output); } static DEVICE_ATTR_RO(auto_remove_on); |