From patchwork Wed Oct 10 13:39:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Ospite X-Patchwork-Id: 14966 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TLwVc-0007bT-AM for patchwork@linuxtv.org; Wed, 10 Oct 2012 15:39:36 +0200 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp for id 1TLwVb-0003xB-FV; Wed, 10 Oct 2012 15:39:36 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756411Ab2JJNja (ORCPT ); Wed, 10 Oct 2012 09:39:30 -0400 Received: from smtp206.alice.it ([82.57.200.102]:53345 "EHLO smtp206.alice.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756318Ab2JJNj3 (ORCPT ); Wed, 10 Oct 2012 09:39:29 -0400 Received: from jcn (87.1.92.64) by smtp206.alice.it (8.6.023.02) id 50469700054FC432; Wed, 10 Oct 2012 15:39:27 +0200 Received: from ao2 by jcn with local (Exim 4.80) (envelope-from ) id 1TLwVR-00039v-9K; Wed, 10 Oct 2012 15:39:25 +0200 From: Antonio Ospite To: linux-media@vger.kernel.org Cc: Aapo Tahkola , Antonio Ospite , CityK Subject: [PATCH 3/5] m920x_parse.pl: use string comparison operators Date: Wed, 10 Oct 2012 15:39:20 +0200 Message-Id: <1349876363-12098-4-git-send-email-ospite@studenti.unina.it> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1349876363-12098-1-git-send-email-ospite@studenti.unina.it> References: <1349876363-12098-1-git-send-email-ospite@studenti.unina.it> X-Face: z*RaLf`X<@C75u6Ig9}{oW$H; 1_\2t5)({*|jhM/Vb; ]yA5\I~93>J<_`<4)A{':UrE Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.10.10.132716 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CP_URI_IN_BODY 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __SUBJ_ALPHA_END 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' --- contrib/m920x/m920x_parse.pl | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/contrib/m920x/m920x_parse.pl b/contrib/m920x/m920x_parse.pl index 135ed5a..9093e16 100755 --- a/contrib/m920x/m920x_parse.pl +++ b/contrib/m920x/m920x_parse.pl @@ -64,7 +64,7 @@ sub check { @cmp = split(/ /, $cmd); for ($i = 0; $i < scalar(@cmp); $i++) { #print "check $bytes[$i] vs $cmp[$i]\n"; - if ($cmp[$i] == "-1") { + if ($cmp[$i] eq "-1") { next; } @@ -102,7 +102,7 @@ sub get_line { } @cmp = split(/ /, $cmd); for ($i = 0; $i < scalar(@cmp); $i++) { - if ($cmp[$i] == "-1") { + if ($cmp[$i] eq "-1") { next; } @@ -117,10 +117,10 @@ sub get_line { sub us_get_write { #print "<$line>\n"; - if($input == "us" && $line =~ m/>>>\s+([a-fA-F0-9 ]+)/) { + if($input eq "us" && $line =~ m/>>>\s+([a-fA-F0-9 ]+)/) { return split(/ /, $1); } - if($input == "um") { + if($input eq "um") { if($line =~ m/\S+ \S+ \S+ \S+ \S+ \S+ \S+ \S+ \S+ \S+ \S+ = ([a-fA-F0-9 ]+)/) { #print "read match $line\n"; return expand_string_long(split(/ /, $1)); @@ -130,10 +130,10 @@ sub us_get_write { sub get_read { #print "<$line>\n"; - if($input == "us" && $line =~ m/<<< ([a-fA-F0-9 ]+)/) { + if($input eq "us" && $line =~ m/<<< ([a-fA-F0-9 ]+)/) { return split(/ /, $1); } - if($input == "um") { + if($input eq "um") { while($line = ) { if($line =~ m/\S+ \S+ \S+ \S+ \S+ \S+ = ([a-fA-F0-9 ]+)/) { return expand_string_long(split(/ /, $1)); @@ -161,11 +161,11 @@ getopts("m:i:", \%opt ) or usage(); $mode = $opt{m}; $input = $opt{i}; -if ($input != "um" && $input != "us" && $input != "sp") { +if ($input ne "um" && $input ne "us" && $input ne "sp") { usage(); } -if ($mode != "fw" && $mode != "i2c") { +if ($mode ne "fw" && $mode ne "i2c") { usage(); } @@ -207,9 +207,9 @@ while(@bytes = get_line("-1")) { $master_line = $. - 1; - if ($bytes[0] == "40" && $bytes[1] == "23") { + if ($bytes[0] eq "40" && $bytes[1] eq "23") { - if ($bytes[4] == "80" || $bytes[4] == "00") { + if ($bytes[4] eq "80" || $bytes[4] eq "00") { my $multibyte = 0; my $addr; @@ -225,16 +225,16 @@ while(@bytes = get_line("-1")) { @bytes = get_line("40 23"); $reg = $bytes[2]; - if ($bytes[4] == "80") { + if ($bytes[4] eq "80") { $multibyte = 1; } else { @bytes = get_line("40 23"); } - #if ($bytes[4] != "40") { + #if ($bytes[4] ne "40") { # print "(missing 40)"; #} - if ($bytes[4] == "80") { + if ($bytes[4] eq "80") { if ($multibyte == 0) { $raddr = sprintf("%02x", hex($addr) | 0x1); @@ -245,7 +245,7 @@ while(@bytes = get_line("-1")) { } else { print "$reg = "; @bytes = get_line("c0 23"); - while ($bytes[4] == "21") { + while ($bytes[4] eq "21") { check("c0 23 00 00 21 00 -1 -1", @bytes); @bytes = get_read(); @@ -265,7 +265,7 @@ while(@bytes = get_line("-1")) { check("40 23 -1 00 4|00 00 00 00", @bytes); print "reg $reg = $bytes[2]"; - while ($bytes[4] != "40") { + while ($bytes[4] ne "40") { @bytes = get_line("40 23"); check("40 23 -1 00 4|00 00 00 00", @bytes); print " $bytes[2]";