1. 18 Mar, 2014 33 commits
  2. 17 Mar, 2014 7 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
    • Daniel Ngu's avatar
      Staging: gdm724x: netlink_k.c: fixed coding style · a6708372
      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>
      a6708372
    • Malcolm Priestley's avatar
      staging: vt6656: [BUG] Fix Warning BOGUS urb xfer, pipe 3 != type 1 · b9d93d1c
      Malcolm Priestley authored
      Stable kernels will need patches
      staging: vt6656: s_nsInterruptUsbIoCompleteRead remove usb_fill_bulk_urb
      staging: vt6656: PIPEnsInterruptRead use usb_fill_int_urb
      
      and a backported version of this patch.
      Signed-off-by: default avatarMalcolm Priestley <tvboxspy@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b9d93d1c
    • Fengguang Wu's avatar
      staging: r8188eu: fix coccinelle warnings · 19485a6d
      Fengguang Wu authored
      drivers/staging/rtl8188eu/core/rtw_mlme_ext.c:8030:3-9: Replace memcpy with struct assignment
      
      Generated by: coccinelle/misc/memcpy-assign.cocci
      Signed-off-by: default avatarFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      19485a6d
    • Jérôme Pinot's avatar
      staging/ozwpan: coding style ether_addr_copy · 072dc114
      Jérôme Pinot authored
      This fixes the following issues detected by checkpatch.pl:
      
       WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
       #220: FILE: drivers/staging/ozwpan/ozcdev.c:220:
       +              memcpy(g_cdev.active_addr, addr, ETH_ALEN);
      
       WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
       #286: FILE: drivers/staging/ozwpan/ozcdev.c:286:
       +                      memcpy(addr, g_cdev.active_addr, ETH_ALEN);
      
       WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2)
       #176: FILE: drivers/staging/ozwpan/ozpd.c:176:
       +              memcpy(pd->mac_addr, mac_addr, ETH_ALEN);
      Signed-off-by: default avatarJerome Pinot <ngc891@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      072dc114