Skip to content

Commit

Permalink
kobject: make get_ktype() take a const pointer
Browse files Browse the repository at this point in the history
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" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20221021072310.3931690-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Oct 22, 2022
1 parent 33a0a1e commit 3d24903
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/kobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3d24903

Please sign in to comment.