Skip to content

Commit

Permalink
mm: cma: make kobj_type structure constant
Browse files Browse the repository at this point in the history
Since commit ee6d3dd ("driver core: make kobj_type constant.") the
driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definition to prevent
modification at runtime.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
Cc: Wedson Almeida Filho <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
t-8ch authored and akpm00 committed Mar 28, 2023
1 parent 94c02ad commit a4a4659
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/cma_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ static struct attribute *cma_attrs[] = {
};
ATTRIBUTE_GROUPS(cma);

static struct kobj_type cma_ktype = {
static const struct kobj_type cma_ktype = {
.release = cma_kobj_release,
.sysfs_ops = &kobj_sysfs_ops,
.default_groups = cma_groups,
Expand Down

0 comments on commit a4a4659

Please sign in to comment.