From a2794df79becc23ba914f57929a23165cd3e1dbc Mon Sep 17 00:00:00 2001
From: Duncan Idaho <dune.idaho@gmail.com>
Date: Sat, 28 Apr 2012 07:17:57 +0000
Subject: [PATCH 16/18] lib/ipmi_lanp.c - unnecessary IPMI dev query
 Signed-off-by: Duncan Idaho <dune.idaho@gmail.com>

Commit removes, resp. moves further in the code, unnecessary query to IPMI
device in ipmi_lanp_main(). It doesn't make sense to query IPMI device only to
show help and terminate immediately.
---
 lib/ipmi_lanp.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/ipmi_lanp.c b/lib/ipmi_lanp.c
index 3906ecd..92d338d 100644
--- a/lib/ipmi_lanp.c
+++ b/lib/ipmi_lanp.c
@@ -2303,7 +2303,7 @@ int
 ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
 {
 	int rc = 0;
-	uint8_t chan = find_lan_channel(intf, 1);
+	uint8_t chan = 0;
 
 	if (argc == 0) {
 		print_lan_usage();
@@ -2311,7 +2311,11 @@ ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv)
 	} else if (strncmp(argv[0], "help", 4) == 0) {
 		print_lan_usage();
 		return 0;
-	} else if (strncmp(argv[0], "printconf", 9) == 0 ||
+	}
+
+	chan = find_lan_channel(intf, 1);
+
+	if (strncmp(argv[0], "printconf", 9) == 0 ||
 			strncmp(argv[0], "print", 5) == 0) 
 	{
 		if (argc > 2) {
-- 
1.7.5.1

