From: Jian Yu Date: Thu, 26 Jan 2023 06:54:37 +0000 (-0800) Subject: LU-16291 build: make kobj_type constant X-Git-Tag: 2.15.3-RC1~76 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=88783c0f8e05178090548960e051a624a1c6561a;p=fs%2Flustre-release.git LU-16291 build: make kobj_type constant Kernel v5.16-rc2-28-gee6d3dd4ed48: commit ee6d3dd4ed48ab24b74bab3c3977b8218518247d driver core: make kobj_type constant. This patch makes struct kobj_type constant to fix the following build failure against kernel 5.16: lustre/obdclass/obd_config.c: In function 'class_modify_config': lustre/obdclass/obd_config.c:1639:13: error: assignment discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] 1639 | typ = get_ktype(kobj); | ^ Lustre-change: https://review.whamcloud.com/49043 Lustre-commit: d1dbf26afd6676e02a2a00e635b9ad1fe14cf68e Signed-off-by: Jian Yu Change-Id: I19e0d1f4e3cf97f6871e038487cda9294ac1f67b Reviewed-by: Shaun Tancheff Reviewed-by: Andreas Dilger Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/49123 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/mgs/lproc_mgs.c b/lustre/mgs/lproc_mgs.c index 4cb65fb..3fd918a 100644 --- a/lustre/mgs/lproc_mgs.c +++ b/lustre/mgs/lproc_mgs.c @@ -260,7 +260,7 @@ int lproc_mgs_setup(struct mgs_device *mgs, const char *osd_name) { int osd_len = strlen(osd_name) - strlen("-osd"); struct obd_device *obd = mgs->mgs_obd; - struct kobj_type *bottom_type; + const struct kobj_type *bottom_type; struct obd_device *osd_obd; int rc; int i; diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 59d6baf..2697b57 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -1623,7 +1623,7 @@ EXPORT_SYMBOL(class_process_config); ssize_t class_modify_config(struct lustre_cfg *lcfg, const char *prefix, struct kobject *kobj) { - struct kobj_type *typ; + const struct kobj_type *typ; ssize_t count = 0; int i; diff --git a/lustre/ofd/ofd_dev.c b/lustre/ofd/ofd_dev.c index c9bcd40..08995cd 100644 --- a/lustre/ofd/ofd_dev.c +++ b/lustre/ofd/ofd_dev.c @@ -725,7 +725,7 @@ static void ofd_procfs_add_brw_stats_symlink(struct ofd_device *ofd) { struct obd_device *obd = ofd_obd(ofd); struct obd_device *osd_obd = ofd->ofd_osd_exp->exp_obd; - struct kobj_type *osd_type; + const struct kobj_type *osd_type; int i; osd_type = get_ktype(&ofd->ofd_osd->dd_kobj);