From patchwork Wed Nov 16 08:46:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yonatan cohen X-Patchwork-Id: 9431059 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 93B7160471 for ; Wed, 16 Nov 2016 08:47:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 841FD28E9C for ; Wed, 16 Nov 2016 08:47:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7887028E9E; Wed, 16 Nov 2016 08:47:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CCFAC28E9C for ; Wed, 16 Nov 2016 08:47:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753383AbcKPIq7 (ORCPT ); Wed, 16 Nov 2016 03:46:59 -0500 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:46992 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752806AbcKPIq7 (ORCPT ); Wed, 16 Nov 2016 03:46:59 -0500 Received: from Internal Mail-Server by MTLPINE1 (envelope-from yonatanc@mellanox.com) with ESMTPS (AES256-SHA encrypted); 16 Nov 2016 10:46:55 +0200 Received: from dev-l-vrt-146.mtl.labs.mlnx (dev-l-vrt-146.mtl.labs.mlnx [10.134.146.1]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id uAG8ktTp011086; Wed, 16 Nov 2016 10:46:55 +0200 Received: from dev-l-vrt-146.mtl.labs.mlnx (localhost [127.0.0.1]) by dev-l-vrt-146.mtl.labs.mlnx (8.14.7/8.14.7) with ESMTP id uAG8ktDM005319; Wed, 16 Nov 2016 10:46:55 +0200 Received: (from yonatanc@localhost) by dev-l-vrt-146.mtl.labs.mlnx (8.14.7/8.14.7/Submit) id uAG8klYb005307; Wed, 16 Nov 2016 10:46:47 +0200 From: Yonatan Cohen To: dledford@redhat.com, leon@kernel.org Cc: linux-rdma@vger.kernel.org, Yonatan Cohen Subject: [PATCH rdma-core] rxe: Remove perl::switch module dependancy Date: Wed, 16 Nov 2016 10:46:46 +0200 Message-Id: <1479286006-5265-1-git-send-email-yonatanc@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Remove perl::switch dependency from RXE, since it is not installed by default. Signed-off-by: Yonatan Cohen --- providers/rxe/rxe_cfg | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/providers/rxe/rxe_cfg b/providers/rxe/rxe_cfg index 6c414fb..c2dbd0e 100755 --- a/providers/rxe/rxe_cfg +++ b/providers/rxe/rxe_cfg @@ -37,7 +37,6 @@ use strict; use File::Basename; use Getopt::Long; -use Switch; my $help = 0; my $no_persist = 0; @@ -559,26 +558,21 @@ sub do_debug { my $debugfile = "$parms/debug"; chomp($arg2); - #print "debug $arg2\n"; - #system("echo 'debug $arg2' > $proc"); - if (!(-e "$debugfile")) { print "Error: debug is compiled out of this rxe driver\n"; return; } - switch ($arg2) { - case "on" { system("echo '31' > $debugfile"); } - case "off" { system("echo '0' > $debugfile"); } - case "0" { system("echo '0' > $debugfile"); } - case "" { } + if ($arg2 eq "on") { system("echo '31' > $debugfile"); } + elsif ($arg2 eq "off") { system("echo '0' > $debugfile"); } + elsif ($arg2 eq "0") { system("echo '0' > $debugfile"); } + elsif ($arg2 eq "") { } elsif ($arg2 ge "0" && $arg2 le "31") { system("echo '$arg2' > $debugfile"); } else { print "unrecognized debug cmd ($arg2)\n"; } - } my $current = read_file($debugfile); chomp($current); @@ -645,11 +639,10 @@ sub main { } # stuff that does not require modules to be loaded - switch($arg1) { - case "help" { usage(); exit; } - case "start" { do_start(); do_status(); exit; } - case "persistent" { system("cat $persistence_file"); exit; } - } + if ($arg1 eq "help") { usage(); exit; } + elsif ($arg1 eq "start") { do_start(); do_status(); exit; } + elsif ($arg1 eq "persistent") { system("cat $persistence_file"); exit; } + # can't do much else, bail if modules aren't loaded if (check_module_status()) { @@ -668,13 +661,11 @@ sub main { get_dev_info(); # Stuff that requires the rdma_rxe module to be loaded - switch($arg1) { - case "stop" { do_stop(); exit; } - case "debug" { do_debug($arg2); exit; } - case "add" { rxe_add($arg2); exit; } - case "remove" { rxe_remove($arg2); exit; } - case "help" { usage(); exit; } - } + if ($arg1 eq "stop") { do_stop(); exit; } + elsif ($arg1 eq "debug") { do_debug($arg2); exit; } + elsif ($arg1 eq "add") { rxe_add($arg2); exit; } + elsif ($arg1 eq "remove") { rxe_remove($arg2); exit; } + elsif ($arg1 eq "help") { usage(); exit; } } main();