From 0d2fb010279e1ac5e2c0f2c97b0ccb9ba27c4c51 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Fri, 18 Dec 2020 10:18:48 +1100 Subject: [PATCH] LU-6142 lod: remove unnecessary variables Both lprocfs_register() and dt_tunables_init() treat a NULL pointer as being equivalent to an empty array. So discard the empty arrays and use the NULL pointer. Signed-off-by: Mr NeilBrown Change-Id: I620fbf1c771ee80d2ddff0f38a87c2f08bae0e4d Reviewed-on: https://review.whamcloud.com/41766 Reviewed-by: James Simmons Reviewed-by: Arshad Hussain Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/lod/lproc_lod.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lustre/lod/lproc_lod.c b/lustre/lod/lproc_lod.c index 34c664e..20aeafa 100644 --- a/lustre/lod/lproc_lod.c +++ b/lustre/lod/lproc_lod.c @@ -1021,10 +1021,6 @@ static ssize_t mdt_hash_store(struct kobject *kobj, struct attribute *attr, } LUSTRE_RW_ATTR(mdt_hash); -static struct lprocfs_vars lprocfs_lod_obd_vars[] = { - { NULL } -}; - static const struct file_operations lod_proc_mdt_fops = { .owner = THIS_MODULE, .open = lod_mdts_seq_open, @@ -1078,7 +1074,6 @@ static struct attribute *lod_attrs[] = { */ int lod_procfs_init(struct lod_device *lod) { - struct ldebugfs_vars ldebugfs_obd_vars[] = { { NULL } }; struct obd_device *obd = lod2obd(lod); struct obd_type *type; struct kobject *lov; @@ -1086,17 +1081,16 @@ int lod_procfs_init(struct lod_device *lod) lod->lod_dt_dev.dd_ktype.default_attrs = lod_attrs; rc = dt_tunables_init(&lod->lod_dt_dev, obd->obd_type, obd->obd_name, - ldebugfs_obd_vars); + NULL); if (rc) { CERROR("%s: failed to setup DT tunables: %d\n", obd->obd_name, rc); RETURN(rc); } - obd->obd_vars = lprocfs_lod_obd_vars; obd->obd_proc_entry = lprocfs_register(obd->obd_name, obd->obd_type->typ_procroot, - obd->obd_vars, obd); + NULL, obd); if (IS_ERR(obd->obd_proc_entry)) { rc = PTR_ERR(obd->obd_proc_entry); CERROR("%s: error %d setting up lprocfs\n", -- 1.8.3.1