1. 26 Apr, 2011 32 commits
  2. 25 Apr, 2011 8 commits
    • Joe Perches's avatar
      staging: Remove unnecessary semicolons when switch (foo) {...}; · 95cd17c9
      Joe Perches authored
      Done via perl script:
      
      $ cat remove_semi_switch.pl
      my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
      my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;
      
      foreach my $file (@ARGV) {
          my $f;
          my $text;
          my $oldtext;
      
          next if ((-d $file));
      
          open($f, '<', $file)
      	or die "$P: Can't open $file for read\n";
          $oldtext = do { local($/) ; <$f> };
          close($f);
      
          next if ($oldtext eq "");
      
          $text = $oldtext;
      
          my $count = 0;
          do {
      	$count = 0;
      	$count += $text =~ s@\b(switch\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
          } while ($count > 0);
      
          if ($text ne $oldtext) {
      	my $newfile = $file;
      
      	open($f, '>', $newfile)
      	    or die "$P: Can't open $newfile for write\n";
      	print $f $text;
      	close($f);
          }
      }
      
      $
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      95cd17c9
    • Joe Perches's avatar
      staging: Remove unnecessary semicolons when for (foo) {...}; · 273f4bef
      Joe Perches authored
      Done via perl script:
      
      $ cat remove_semi_for.pl
      my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
      my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;
      
      foreach my $file (@ARGV) {
          my $f;
          my $text;
          my $oldtext;
      
          next if ((-d $file));
      
          open($f, '<', $file)
      	or die "$P: Can't open $file for read\n";
          $oldtext = do { local($/) ; <$f> };
          close($f);
      
          next if ($oldtext eq "");
      
          $text = $oldtext;
      
          my $count = 0;
          do {
      	$count = 0;
      	$count += $text =~ s@\b(for\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
          } while ($count > 0);
      
          if ($text ne $oldtext) {
      	my $newfile = $file;
      
      	open($f, '>', $newfile)
      	    or die "$P: Can't open $newfile for write\n";
      	print $f $text;
      	close($f);
          }
      }
      
      $
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      273f4bef
    • Joe Perches's avatar
      staging: Remove unnecessary semicolons when while (foo) {...}; · b0b0fb0f
      Joe Perches authored
      Done via perl script:
      
      $ cat remove_semi_while.pl
      my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
      my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;
      
      foreach my $file (@ARGV) {
          my $f;
          my $text;
          my $oldtext;
      
          next if ((-d $file));
      
          open($f, '<', $file)
      	or die "$P: Can't open $file for read\n";
          $oldtext = do { local($/) ; <$f> };
          close($f);
      
          next if ($oldtext eq "");
      
          $text = $oldtext;
      
          my $count = 0;
          do {
      	$count = 0;
      	$count += $text =~ s@\b(while\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
          } while ($count > 0);
      
          if ($text ne $oldtext) {
      	my $newfile = $file;
      
      	open($f, '>', $newfile)
      	    or die "$P: Can't open $newfile for write\n";
      	print $f $text;
      	close($f);
          }
      }
      
      $
      
      One false positive removed.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      b0b0fb0f
    • Joe Perches's avatar
      staging: Remove unnecessary semicolons when if (foo) {...}; · 9fc86028
      Joe Perches authored
      Done via perl script:
      
      $ cat remove_semi_if.pl
      my $match_balanced_parentheses = qr/(\((?:[^\(\)]++|(?-1))*\))/;
      my $match_balanced_braces      = qr/(\{(?:[^\{\}]++|(?-1))*\})/;
      
      foreach my $file (@ARGV) {
          my $f;
          my $text;
          my $oldtext;
      
          next if ((-d $file));
      
          open($f, '<', $file)
      	or die "$P: Can't open $file for read\n";
          $oldtext = do { local($/) ; <$f> };
          close($f);
      
          next if ($oldtext eq "");
      
          $text = $oldtext;
      
          my $count = 0;
          do {
      	$count = 0;
      	$count += $text =~ s@\b(if\s*${match_balanced_parentheses}\s*)${match_balanced_braces}\s*;@"$1$3"@egx;
          } while ($count > 0);
      
          if ($text ne $oldtext) {
      	my $newfile = $file;
      
      	open($f, '>', $newfile)
      	    or die "$P: Can't open $newfile for write\n";
      	print $f $text;
      	close($f);
          }
      }
      
      $
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      9fc86028
    • Greg Kroah-Hartman's avatar
      60b0fa1a
    • Vasiliy Kulikov's avatar
      staging: istallion: fix arbitrary kernel memory reads/writes · 5d46f326
      Vasiliy Kulikov authored
      stli_brdstats is defined as global variable.  After de-BKL-ization in
      the patch b4eda9cb an access to the variable is not serialized
      anymore.  This leads to the race window between the check and the use
      in stli_getbrdstats():
      
              if (copy_from_user(&stli_brdstats, bp, sizeof(combrd_t)))
                      return -EFAULT;
              if (stli_brdstats.brd >= STL_MAXBRDS) <<<
                      return -ENODEV;
              brdp = stli_brds[stli_brdstats.brd];  <<<
      
      If one process calls COM_GETBRDSTATS ioctl() with sane .brd, second
      process calls COM_GETBRDSTATS ioctl() with invalid .brd, and the
      second process' copy_from_user() executes exactly between the check and
      stli_brds[] indexation of the first process, then the first process gets
      contents of memory at *stli_brds[stli_brdstats.brd] address.  Also
      the resulting .nrpanels field may be too big, in this case
      stli_brdstats.panels array overflows.
      Signed-off-by: default avatarVasiliy Kulikov <segoon@openwall.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      5d46f326
    • Roland Vossen's avatar
      modules: Enabled dynamic debugging for staging modules · 7816c45b
      Roland Vossen authored
      Driver modules from the staging directory are marked 'tainted'
      by module.c. Subsequently, tainted modules are denied dynamic
      debugging. This is unwanted behavior, since staging modules should
      be able to use the dynamic debugging mechanism.
      
      Please merge this also into the staging-linus branch.
      Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
      Acked-by: default avatarJason Baron <jbaron@redhat.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      7816c45b
    • Franky Lin's avatar
      staging: brcm80211: Add dhdsdio_chip_attach in dhd_sdio.c · cb63e4c9
      Franky Lin authored
      dhdsdio_chip_attach and it sub functions are added for si/sb utils removal.
      It will replace si_attach in following patches.
      Signed-off-by: default avatarFranky Lin <frankyl@broadcom.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      cb63e4c9