From 47f10ac65c2df3034ae5e943a396d86aa201667a Mon Sep 17 00:00:00 2001 From: Garming Sam Date: Wed, 9 Jul 2014 12:25:36 +1200 Subject: [PATCH] param: remove lp_get_parameter Ensure lpcfg_parm_struct, its counterpart is equivalent Change-Id: I127ce5d3cf7fe02ebf161aa011ec3b41bc32a656 Signed-off-by: Garming Sam Reviewed-by: Andrew Bartlett Reviewed-by: Michael Adam --- lib/param/loadparm.c | 10 ++++------ lib/param/s3_param.h | 1 - source3/include/proto.h | 1 - source3/param/loadparm.c | 16 ---------------- source3/param/loadparm_ctx.c | 1 - 5 files changed, 4 insertions(+), 25 deletions(-) diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 13d3425eeb7..d9159f372d8 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -730,15 +730,13 @@ int lpcfg_map_parameter(const char *pszParmName) */ struct parm_struct *lpcfg_parm_struct(struct loadparm_context *lp_ctx, const char *name) { - int parmnum; + int num = lpcfg_map_parameter(name); - if (lp_ctx->s3_fns) { - return lp_ctx->s3_fns->get_parm_struct(name); + if (num < 0) { + return NULL; } - parmnum = lpcfg_map_parameter(name); - if (parmnum == -1) return NULL; - return &parm_table[parmnum]; + return &parm_table[num]; } /** diff --git a/lib/param/s3_param.h b/lib/param/s3_param.h index b83a528ba22..6631bc64e34 100644 --- a/lib/param/s3_param.h +++ b/lib/param/s3_param.h @@ -3,7 +3,6 @@ struct loadparm_s3_helpers { - struct parm_struct * (*get_parm_struct)(const char *param_name); void * (*get_parm_ptr)(struct loadparm_service *service, struct parm_struct *parm); struct loadparm_service * (*get_service)(const char *service_name); struct loadparm_service * (*get_default_loadparm_service)(void); diff --git a/source3/include/proto.h b/source3/include/proto.h index c4d1606b93c..70fa7f74ed7 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1042,7 +1042,6 @@ void *lp_local_ptr_by_snum(int snum, struct parm_struct *parm); bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue); bool lp_set_cmdline(const char *pszParmName, const char *pszParmValue); bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal); -struct parm_struct *lp_get_parameter(const char *param_name); bool lp_snum_ok(int iService); void lp_add_one_printer(const char *name, const char *comment, const char *location, void *pdata); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 89d3fece214..dee62246551 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -2647,22 +2647,6 @@ bool dump_a_parameter(int snum, char *parm_name, FILE * f, bool isGlobal) return result; } -/*************************************************************************** - Return info about the requested parameter (given as a string). - Return NULL when the string is not a valid parameter name. -***************************************************************************/ - -struct parm_struct *lp_get_parameter(const char *param_name) -{ - int num = lpcfg_map_parameter(param_name); - - if (num < 0) { - return NULL; - } - - return &parm_table[num]; -} - #if 0 /*************************************************************************** Display the contents of a single copy structure. diff --git a/source3/param/loadparm_ctx.c b/source3/param/loadparm_ctx.c index a8539d636a0..8f1572fdaac 100644 --- a/source3/param/loadparm_ctx.c +++ b/source3/param/loadparm_ctx.c @@ -58,7 +58,6 @@ static bool lp_load_for_s4_ctx(const char *filename) static struct loadparm_s3_helpers s3_fns = { - .get_parm_struct = lp_get_parameter, .get_parm_ptr = lp_parm_ptr, .get_service = lp_service_for_s4_ctx, .get_servicebynum = lp_servicebynum_for_s4_ctx,