[PATCH rdma-core 8/8] rdma-ndd: Tidy getopt_long call

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



struct option should be const and opt_idx can just be NULL.

Signed-off-by: Jason Gunthorpe <jgunthorpe@xxxxxxxxxxxxxxxxxxxx>
---
 rdma-ndd/rdma-ndd.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/rdma-ndd/rdma-ndd.c b/rdma-ndd/rdma-ndd.c
index 3e99d2dc5332dc..180cbb34a8e29b 100644
--- a/rdma-ndd/rdma-ndd.c
+++ b/rdma-ndd/rdma-ndd.c
@@ -289,15 +289,14 @@ int main(int argc, char *argv[])
 	openlog(NULL, LOG_NDELAY | LOG_CONS | LOG_PID, LOG_DAEMON);
 
 	while (1) {
-		int opt_idx = 0;
-		static struct option long_opts[] = {
+		static const struct option long_opts[] = {
 			{ "foreground",   0, NULL, 'f' },
 			{ "help",         0, NULL, 'h' },
 			{ "debug",        0, NULL, 'd' },
 			{ }
 		};
 
-		int c = getopt_long(argc, argv, "fh", long_opts, &opt_idx);
+		int c = getopt_long(argc, argv, "fh", long_opts, NULL);
 		if (c == -1)
 			break;
 
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux