[stgt] [PATCH] rename macro str_to_val to str_to_int

Alexander Nezhinsky alexandern at mellanox.com
Thu Nov 24 13:51:15 CET 2011


The name str_to_val of a macro in util.h has been used in iscsi/param.h
as the structure field iscsi_key_ops::val_to_str.
To avoid possible conflicts str_to_val macro is renamed to str_to_int.

Signed-off-by: Alexander Nezhinsky <alexandern at mellanox.com>
---
 usr/tgtadm.c |   12 ++++++------
 usr/tgtd.c   |    6 +++---
 usr/util.h   |    2 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/usr/tgtadm.c b/usr/tgtadm.c
index b6e2b99..41e9e99 100644
--- a/usr/tgtadm.c
+++ b/usr/tgtadm.c
@@ -494,22 +494,22 @@ int main(int argc, char **argv)
 			mode = str_to_mode(optarg);
 			break;
 		case 't':
-			rc = str_to_val(optarg, tid, 0, INT_MAX);
+			rc = str_to_int(optarg, tid, 0, INT_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
 		case 's':
-			rc = str_to_val(optarg, sid, 0, ULLONG_MAX);
+			rc = str_to_int(optarg, sid, 0, ULLONG_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
 		case 'c':
-			rc = str_to_val(optarg, cid, 0, UINT_MAX);
+			rc = str_to_int(optarg, cid, 0, UINT_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
 		case 'l':
-			rc = str_to_val(optarg, lun, 0, ULLONG_MAX);
+			rc = str_to_int(optarg, lun, 0, ULLONG_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
@@ -547,7 +547,7 @@ int main(int argc, char **argv)
 			hostno = bus_to_host(optarg);
 			break;
 		case 'H':
-			rc = str_to_val(optarg, hostno, 0, UINT_MAX);
+			rc = str_to_int(optarg, hostno, 0, UINT_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
@@ -570,7 +570,7 @@ int main(int argc, char **argv)
 			ac_dir = ACCOUNT_TYPE_OUTGOING;
 			break;
 		case 'C':
-			rc = str_to_val(optarg, control_port, 0, USHRT_MAX);
+			rc = str_to_int(optarg, control_port, 0, USHRT_MAX);
 			if (rc)
 				bad_optarg(rc, ch, optarg);
 			break;
diff --git a/usr/tgtd.c b/usr/tgtd.c
index 8bfc555..b5d7ec3 100644
--- a/usr/tgtd.c
+++ b/usr/tgtd.c
@@ -511,17 +511,17 @@ int main(int argc, char **argv)
 			is_daemon = 0;
 			break;
 		case 'C':
-			ret = str_to_val(optarg, control_port, 0, USHRT_MAX);
+			ret = str_to_int(optarg, control_port, 0, USHRT_MAX);
 			if (ret)
 				bad_optarg(ret, ch, optarg);
 			break;
 		case 't':
-			ret = str_to_val(optarg, nr_iothreads, 0, USHRT_MAX);
+			ret = str_to_int(optarg, nr_iothreads, 0, USHRT_MAX);
 			if (ret)
 				bad_optarg(ret, ch, optarg);
 			break;
 		case 'd':
-			ret = str_to_val(optarg, is_debug, 0, 1);
+			ret = str_to_int(optarg, is_debug, 0, 1);
 			if (ret)
 				bad_optarg(ret, ch, optarg);
 			break;
diff --git a/usr/util.h b/usr/util.h
index 0f6f400..8abdb94 100644
--- a/usr/util.h
+++ b/usr/util.h
@@ -139,7 +139,7 @@ struct signalfd_siginfo {
 };
 #endif
 
-#define str_to_val(str, val, minv, maxv)		\
+#define str_to_int(str, val, minv, maxv)		\
 ({							\
 	char *ptr;					\
 	int ret = 0;					\
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list