From a0fdf96c7345328f534f55c86010f637728bea42 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 15 Dec 2010 10:27:51 +0000 Subject: [PATCH] Converted function-local constant definitions from #defines into enums. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3065 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 64 ++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index ad8d7cf2e..2bc3d0efe 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -152,13 +152,14 @@ static int scst_write_trace(const char *buf, size_t length, unsigned long level = 0, oldlevel; char *buffer, *p, *e; const struct scst_trace_log *t; - -#define SCST_TRACE_ACTION_ALL 1 -#define SCST_TRACE_ACTION_NONE 2 -#define SCST_TRACE_ACTION_DEFAULT 3 -#define SCST_TRACE_ACTION_ADD 4 -#define SCST_TRACE_ACTION_DEL 5 -#define SCST_TRACE_ACTION_VALUE 6 + enum { + SCST_TRACE_ACTION_ALL = 1, + SCST_TRACE_ACTION_NONE = 2, + SCST_TRACE_ACTION_DEFAULT = 3, + SCST_TRACE_ACTION_ADD = 4, + SCST_TRACE_ACTION_DEL = 5, + SCST_TRACE_ACTION_VALUE = 6, + }; TRACE_ENTRY(); @@ -290,13 +291,6 @@ out_free: out: TRACE_EXIT_RES(res); return res; - -#undef SCST_TRACE_ACTION_ALL -#undef SCST_TRACE_ACTION_NONE -#undef SCST_TRACE_ACTION_DEFAULT -#undef SCST_TRACE_ACTION_ADD -#undef SCST_TRACE_ACTION_DEL -#undef SCST_TRACE_ACTION_VALUE } #endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */ @@ -2842,11 +2836,12 @@ static int __scst_process_luns_mgmt_store(char *buffer, unsigned int virt_lun; struct scst_acg_dev *acg_dev = NULL, *acg_dev_tmp; struct scst_device *d, *dev = NULL; - -#define SCST_LUN_ACTION_ADD 1 -#define SCST_LUN_ACTION_DEL 2 -#define SCST_LUN_ACTION_REPLACE 3 -#define SCST_LUN_ACTION_CLEAR 4 + enum { + SCST_LUN_ACTION_ADD = 1, + SCST_LUN_ACTION_DEL = 2, + SCST_LUN_ACTION_REPLACE = 3, + SCST_LUN_ACTION_CLEAR = 4, + }; TRACE_ENTRY(); @@ -3068,11 +3063,6 @@ out_resume: out: TRACE_EXIT_RES(res); return res; - -#undef SCST_LUN_ACTION_ADD -#undef SCST_LUN_ACTION_DEL -#undef SCST_LUN_ACTION_REPLACE -#undef SCST_LUN_ACTION_CLEAR } static int scst_luns_mgmt_store_work_fn(struct scst_sysfs_work_item *work) @@ -3769,9 +3759,10 @@ static int scst_process_ini_group_mgmt_store(char *buffer, int res, action; char *p, *e = NULL; struct scst_acg *a, *acg = NULL; - -#define SCST_INI_GROUP_ACTION_CREATE 1 -#define SCST_INI_GROUP_ACTION_DEL 2 + enum { + SCST_INI_GROUP_ACTION_CREATE = 1, + SCST_INI_GROUP_ACTION_DEL = 2, + }; TRACE_ENTRY(); @@ -3866,9 +3857,6 @@ out_resume: out: TRACE_EXIT_RES(res); return res; - -#undef SCST_LUN_ACTION_CREATE -#undef SCST_LUN_ACTION_DEL } static int scst_ini_group_mgmt_store_work_fn(struct scst_sysfs_work_item *work) @@ -4138,11 +4126,12 @@ static int scst_process_acg_ini_mgmt_store(char *buffer, char *name = NULL, *group = NULL; struct scst_acg *acg_dest = NULL; struct scst_acn *acn = NULL, *acn_tmp; - -#define SCST_ACG_ACTION_INI_ADD 1 -#define SCST_ACG_ACTION_INI_DEL 2 -#define SCST_ACG_ACTION_INI_CLEAR 3 -#define SCST_ACG_ACTION_INI_MOVE 4 + enum { + SCST_ACG_ACTION_INI_ADD = 1, + SCST_ACG_ACTION_INI_DEL = 2, + SCST_ACG_ACTION_INI_CLEAR = 3, + SCST_ACG_ACTION_INI_MOVE = 4, + }; TRACE_ENTRY(); @@ -4316,11 +4305,6 @@ out_resume: out: TRACE_EXIT_RES(res); return res; - -#undef SCST_ACG_ACTION_INI_ADD -#undef SCST_ACG_ACTION_INI_DEL -#undef SCST_ACG_ACTION_INI_CLEAR -#undef SCST_ACG_ACTION_INI_MOVE } static int scst_acg_ini_mgmt_store_work_fn(struct scst_sysfs_work_item *work)