From 12e397cdfba7e1a2dead072dba3e7bb21905f6c7 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 11 Feb 2015 12:13:14 +0800 Subject: [PATCH] staging: lustre: resolves sparse warnings using static declaration This patch resolves sparse warnings about non-declared symbol in staging/lustre/lustre/lov by adding static declaration. These warnings are like this: warning: symbol 'fiemap_calc_fm_end_offset' was not declared. Should it be static? Signed-off-by: Le Tan Signed-off-by: Greg Kroah-Hartman --- drivers/staging/lustre/lustre/lov/lov_ea.c | 8 +++---- drivers/staging/lustre/lustre/lov/lov_obd.c | 24 +++++++++---------- .../staging/lustre/lustre/lov/lov_object.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 4 ++-- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index e9ec39c5a6c2..d1b0417d5058 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -209,8 +209,8 @@ static int lsm_lmm_verify_v1(struct lov_mds_md_v1 *lmm, int lmm_bytes, return lsm_lmm_verify_common(lmm, lmm_bytes, *stripe_count); } -int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm, - struct lov_mds_md_v1 *lmm) +static int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm, + struct lov_mds_md_v1 *lmm) { struct lov_oinfo *loi; int i; @@ -287,8 +287,8 @@ static int lsm_lmm_verify_v3(struct lov_mds_md *lmmv1, int lmm_bytes, *stripe_count); } -int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm, - struct lov_mds_md *lmmv1) +static int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm, + struct lov_mds_md *lmmv1) { struct lov_mds_md_v3 *lmm; struct lov_oinfo *loi; diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 2c6c55837c7a..219852a14cc6 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -1601,9 +1601,9 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len, * \param fm_end logical end of mapping * \param start_stripe starting stripe will be returned in this */ -u64 fiemap_calc_fm_end_offset(struct ll_user_fiemap *fiemap, - struct lov_stripe_md *lsm, u64 fm_start, - u64 fm_end, int *start_stripe) +static u64 fiemap_calc_fm_end_offset(struct ll_user_fiemap *fiemap, + struct lov_stripe_md *lsm, u64 fm_start, + u64 fm_end, int *start_stripe) { u64 local_end = fiemap->fm_extents[0].fe_logical; u64 lun_start, lun_end; @@ -1658,9 +1658,9 @@ u64 fiemap_calc_fm_end_offset(struct ll_user_fiemap *fiemap, * * \retval last_stripe return the last stripe of the mapping */ -int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start, - u64 fm_end, int start_stripe, - int *stripe_count) +static int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start, + u64 fm_end, int start_stripe, + int *stripe_count) { int last_stripe; u64 obd_start, obd_end; @@ -1694,10 +1694,10 @@ int fiemap_calc_last_stripe(struct lov_stripe_md *lsm, u64 fm_start, * \param ext_count number of extents to be copied * \param current_extent where to start copying in main extent array */ -void fiemap_prepare_and_copy_exts(struct ll_user_fiemap *fiemap, - struct ll_fiemap_extent *lcl_fm_ext, - int ost_index, unsigned int ext_count, - int current_extent) +static void fiemap_prepare_and_copy_exts(struct ll_user_fiemap *fiemap, + struct ll_fiemap_extent *lcl_fm_ext, + int ost_index, unsigned int ext_count, + int current_extent) { char *to; int ext; @@ -2290,7 +2290,7 @@ out: return rc; } -struct obd_ops lov_obd_ops = { +static struct obd_ops lov_obd_ops = { .o_owner = THIS_MODULE, .o_setup = lov_setup, .o_precleanup = lov_precleanup, @@ -2324,7 +2324,7 @@ struct obd_ops lov_obd_ops = { struct kmem_cache *lov_oinfo_slab; -int __init lov_init(void) +static int __init lov_init(void) { struct lprocfs_static_vars lvars = { NULL }; int rc; diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index 4cab730ab429..d69a0354baf5 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -563,7 +563,7 @@ static const struct lov_layout_operations lov_dispatch[] = { /** * Return lov_layout_type associated with a given lsm */ -enum lov_layout_type lov_type(struct lov_stripe_md *lsm) +static enum lov_layout_type lov_type(struct lov_stripe_md *lsm) { if (lsm == NULL) return LLT_EMPTY; diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index 0e0ea60de4c8..d96163de773f 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -71,7 +71,7 @@ void lov_pool_putref(struct pool_desc *pool) } } -void lov_pool_putref_locked(struct pool_desc *pool) +static void lov_pool_putref_locked(struct pool_desc *pool) { CDEBUG(D_INFO, "pool %p\n", pool); LASSERT(atomic_read(&pool->pool_refcount) > 1); diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index 2d0706222001..174cbf5c138f 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -241,7 +241,7 @@ static int lov_tgt_seq_show(struct seq_file *p, void *v) return 0; } -struct seq_operations lov_tgt_sops = { +static const struct seq_operations lov_tgt_sops = { .start = lov_tgt_seq_start, .stop = lov_tgt_seq_stop, .next = lov_tgt_seq_next, @@ -270,7 +270,7 @@ LPROC_SEQ_FOPS_RO_TYPE(lov, kbytestotal); LPROC_SEQ_FOPS_RO_TYPE(lov, kbytesfree); LPROC_SEQ_FOPS_RO_TYPE(lov, kbytesavail); -struct lprocfs_vars lprocfs_lov_obd_vars[] = { +static struct lprocfs_vars lprocfs_lov_obd_vars[] = { { "uuid", &lov_uuid_fops, NULL, 0 }, { "stripesize", &lov_stripesize_fops, NULL }, { "stripeoffset", &lov_stripeoffset_fops, NULL }, -- 2.34.1