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>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
aa838896d8
commit
973c39115c
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user