From patchwork Tue Feb 19 00:09:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 10819073 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5F68D13BF for ; Tue, 19 Feb 2019 00:13:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47EDA2BDE4 for ; Tue, 19 Feb 2019 00:13:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 386C72BDEC; Tue, 19 Feb 2019 00:13:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CDCC92BDE4 for ; Tue, 19 Feb 2019 00:13:37 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 9E1174E2C76; Mon, 18 Feb 2019 16:13:37 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 5B4354E2C33 for ; Mon, 18 Feb 2019 16:13:36 -0800 (PST) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 967B6AF57; Tue, 19 Feb 2019 00:13:35 +0000 (UTC) From: NeilBrown To: James Simmons , Andreas Dilger , Oleg Drokin Date: Tue, 19 Feb 2019 11:09:05 +1100 Message-ID: <155053494593.24125.427229089746560574.stgit@noble.brown> In-Reply-To: <155053473693.24125.6976971762921761309.stgit@noble.brown> References: <155053473693.24125.6976971762921761309.stgit@noble.brown> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Subject: [lustre-devel] [PATCH 21/37] lustre: remove several MAX_STRING_SIZE defines. X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lustre Development List Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some of these are unused. One is used in a minimal way where it is easier to use an explicit number. Signed-off-by: NeilBrown Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 -- drivers/staging/lustre/lustre/llite/llite_lib.c | 6 ++---- drivers/staging/lustre/lustre/llite/lproc_llite.c | 4 ---- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 -- .../lustre/lustre/obdclass/lprocfs_status.c | 2 -- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index 74c7644d6ef8..261857e4540d 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -392,8 +392,6 @@ static int ldlm_namespace_debugfs_register(struct ldlm_namespace *ns) return 0; } -#undef MAX_STRING_SIZE - struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res) { LASSERT(res); diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index d97abbfddccf..fda6d9b07952 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -906,8 +906,6 @@ void ll_lli_init(struct ll_inode_info *lli) memset(lli->lli_jobid, 0, LUSTRE_JOBID_SIZE); } -#define MAX_STRING_SIZE 128 - int ll_fill_super(struct super_block *sb) { struct lustre_profile *lprof = NULL; @@ -916,7 +914,7 @@ int ll_fill_super(struct super_block *sb) char *dt = NULL, *md = NULL; char *profilenm = get_profile_name(sb); struct config_llog_instance *cfg; - char name[MAX_STRING_SIZE]; + char name[128]; char *ptr; int len; int err; @@ -960,7 +958,7 @@ int ll_fill_super(struct super_block *sb) len -= 7; /* Mount info */ - snprintf(name, MAX_STRING_SIZE, "%.*s-%px", len, + snprintf(name, sizeof(name), "%.*s-%px", len, lsi->lsi_lmd->lmd_profile, sb); /* Call ll_debugsfs_register_super() before lustre_process_log() diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index db2fbf1f3a50..5ed703d7bb1e 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -1187,8 +1187,6 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = { { NULL } }; -#define MAX_STRING_SIZE 128 - static struct attribute *llite_attrs[] = { &lustre_attr_blocksize.attr, &lustre_attr_stat_blocksize.attr, @@ -1434,8 +1432,6 @@ void ll_debugfs_unregister_super(struct super_block *sb) lprocfs_free_stats(&sbi->ll_stats); } -#undef MAX_STRING_SIZE - #define pct(a, b) (b ? a * 100 / b : 0) static void ll_display_extents_info(struct ll_rw_extents_info *io_extents, diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 35dff0e96bf7..138e124bd05e 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -273,8 +273,6 @@ static int lmv_init_ea_size(struct obd_export *exp, u32 easize, u32 def_easize) return rc; } -#define MAX_STRING_SIZE 128 - static int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt) { struct lmv_obd *lmv = &obd->u.lmv; diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index aed33068ff3c..a179b0d6979e 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -271,8 +271,6 @@ static int lprocfs_no_percpu_stats; module_param(lprocfs_no_percpu_stats, int, 0644); MODULE_PARM_DESC(lprocfs_no_percpu_stats, "Do not alloc percpu data for lprocfs stats"); -#define MAX_STRING_SIZE 128 - /* lprocfs API calls */ static const struct file_operations lprocfs_generic_fops = { };