diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-21 10:46:48 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-11-22 17:34:52 +0100 |
commit | a53d1acc978321734a8fd7388f2c050a7219ab69 (patch) | |
tree | 43e078bf4a8003808966ee194fe097485c2c58aa /drivers/base | |
parent | kobject: kset_uevent_ops: make filter() callback take a const * (diff) | |
download | linux-a53d1acc978321734a8fd7388f2c050a7219ab69.tar.xz linux-a53d1acc978321734a8fd7388f2c050a7219ab69.zip |
kobject: kset_uevent_ops: make name() callback take a const *
The name() callback in struct kset_uevent_ops does not modify the
kobject passed into it, so make the pointer const to enforce this
restriction. When doing so, fix up the single existing name() callback
to have the correct signature to preserve the build.
Acked-by: Rafael J. Wysocki <rafael@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20221121094649.1556002-4-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index 005a2b092f3e..a3e14143ec0c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -2376,9 +2376,9 @@ static int dev_uevent_filter(const struct kobject *kobj) return 0; } -static const char *dev_uevent_name(struct kobject *kobj) +static const char *dev_uevent_name(const struct kobject *kobj) { - struct device *dev = kobj_to_dev(kobj); + const struct device *dev = kobj_to_dev(kobj); if (dev->bus) return dev->bus->name; |