Skip to contentSkip to conversation

kobject: make get_ktype() take a const pointer

PATCH New Greg Kroah-Hartman 1 participant 1 message Oct 21, 2022 Driver core

lore
Share & tools
lore

Greg Kroah-Hartman

author maintainer
#0 lore raw

PATCH 1/1 kobject: make get_ktype() take a const pointer

get_ktype() does not modify the structure passed to it, so mark the parameter as being const to allow other const structures to be passed to it in the future.

Cc "Rafael J. Wysocki" <[email protected]>
---
 include/linux/kobject.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/kobject.h +1 -1
index 57fb972fea05..fc00cee1359c 100644
@@ -198,7 +198,7 @@ static inline void kset_put(struct kset *k)
 	kobject_put(&k->kobj);
 }
 
-static inline const struct kobj_type *get_ktype(struct kobject *kobj)
+static inline const struct kobj_type *get_ktype(const struct kobject *kobj)
 {
 	return kobj->ktype;
 }
Signature · 1 line
2.38.1