1. 18 Mar, 2014 37 commits
  2. 17 Mar, 2014 3 commits
    • Chi Pham's avatar
      staging:dgnc: Removed assignments from if statements. · f7c851d4
      Chi Pham authored
      Coccinelle was used for this patch. The script is not complete (semantically) and might raise some checkpatch warnings in terms of indentation depending on existing code.
      
      *** IFASSIGNMENT.COCCI START ***
      
      /* Coccinelle script to handle assignments in if statements
       * For compound statements, can so far only handle statements with the
       * assignment on either extreme */
      
      /* This rule is for simple cases
       * e.g. just an assignment in if, possibly with unary operator */
      @simple@
      expression E1, E2;
      statement S1, S2;
      @@
      
      + E1 = E2;
      if (
      - (E1 = E2)
      + E1
       )
      S1 else S2
      
      /* This rule is for compound statements where the assignment is on the right.*/
      @right@
      expression E, E1, E2;
      statement S1, S2;
      @@
      
      (
      /* and */
      - if (E && (E1 = E2))
      + if (E) {
      + E1 = E2;
      + if (E1)
      S1 else S2
      + } else S2
      |
      - if (E && (E1 = E2))
      + if (E) {
      + E1 = E2;
      + if (E1)
      S1
      + }
      
      /* or */
      |
      - if (E || (E1 = E2))
      + if (!E) {
      + E1 = E2;
      + if (E1)
      S1 else S2
      + }
      + else S1
      |
      - if (E || (E1 = E2))
      + if (!E) {
      + E1 = E2;
      + if (E1) S1
      + } else
      S1
      
      /* not equal */
      |
      - if (E != (E1 = E2))
      + E1 = E2;
      + if (E != E1)
      S1 else S2
      |
      - if (E != (E1 = E2))
      + E1 = E2;
      + if (E != E1)
      S1
      
      /* equal */
      |
      - if (E == (E1 = E2))
      + E1 = E2;
      + if (E == E1)
      S1 else S2
      |
      - if (E == (E1 = E2))
      + E1 = E2;
      + if (E == E1)
      S1
      
      /* greater than */
      |
      - if (E > (E1 = E2))
      + E1 = E2;
      + if (E > E1)
      S1 else S2
      |
      - if (E > (E1 = E2))
      + E1 = E2;
      + if (E > E1)
      S1
      
      /* less than */
      |
      - if (E < (E1 = E2))
      + E1 = E2;
      + if (E < E1)
      S1 else S2
      |
      - if (E < (E1 = E2))
      + E1 = E2;
      + if (E < E1)
      S1
      
      /* lesser than or equal to */
      |
      - if (E <= (E1 = E2))
      + E1 = E2;
      + if (E <= E1)
      S1 else S2
      |
      - if (E <= (E1 = E2))
      + E1 = E2;
      + if (E <= E1)
      S1
      
      /* greater than or equal to */
      |
      - if (E >= (E1 = E2))
      + E1 = E2;
      + if (E >= E1)
      S1 else S2
      |
      - if (E >= (E1 = E2))
      + E1 = E2;
      + if (E >= E1)
      S1
      )
      
      /* This rule is for compound statements where the assignment is on the left.*/
      @left@
      expression E, E1, E2;
      statement S1, S2;
      @@
      
      (
      /* and */
      - if ((E1 = E2) && E)
      + E1 = E2;
      + if (E1 && E)
      S1 else S2
      |
      - if ((E1 = E2) && E)
      + E1 = E2;
      + if (E1 && E)
      S1
      |
      
      /* or */
      - if ((E1 = E2) || E)
      + E1 = E2;
      + if (E1 || E)
      S1
      |
      - if ((E1 = E2) || E)
      + E1 = E2;
      + if (E1 || E)
      S1 else S2
      |
      
      /* not equal */
      - if ((E1 = E2) != E)
      + E1 = E2;
      + if (E1 != E)
      S1
      |
      - if ((E1 = E2) != E)
      + E1 = E2;
      + if (E1 != E)
      S1 else S2
      |
      
      /* equal */
      - if ((E1 = E2) == E)
      + E1 = E2;
      + if (E1 == E)
      S1
      |
      - if ((E1 = E2) == E)
      + E1 = E2;
      + if (E1 == E)
      S1 else S2
      |
      /* greater */
      - if ((E1 = E2) > E)
      + E1 = E2;
      + if (E1 > E)
      S1
      |
      - if ((E1 = E2) > E)
      + E1 = E2;
      + if (E1 > E)
      S1 else S2
      |
      
      /* less */
      - if ((E1 = E2) < E)
      + E1 = E2;
      + if (E1 < E)
      S1
      |
      - if ((E1 = E2) < E)
      + E1 = E2;
      + if (E1 < E)
      S1 else S2
      
      /* lesser than or equal to */
      - if ((E1 = E2) <= E)
      + E1 = E2;
      + if (E1 <= E)
      S1
      |
      - if ((E1 = E2) <= E)
      + E1 = E2;
      + if (E1 <= E)
      S1 else S2
      
      /* greater than or equal to */
      - if ((E1 = E2) >= E)
      + E1 = E2;
      + if (E1 >= E)
      S1
      |
      - if ((E1 = E2) >= E)
      + E1 = E2;
      + if (E1 >= E)
      S1 else S2
      )
      
      *** IFASSIGNMENT.COCCI END ***
      Signed-off-by: default avatarChi Pham <fempsci@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f7c851d4
    • Georgiana Rodica Chelu's avatar
      staging: android: Remove whitespace issue · 3e4cb2f3
      Georgiana Rodica Chelu authored
      This patch fixes coding style issue: removing the whitespace
      Signed-off-by: default avatarGeorgiana Rodica Chelu <georgiana.chelu93@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3e4cb2f3
    • Daniel Ngu's avatar
      Staging: gdm724x: gdm_mux.c: fixed coding style · 7b99b5ef
      Daniel Ngu authored
      Line over 80 characters
      Signed-off-by: default avatarDaniel Ngu <daniel.dy.ngu@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7b99b5ef