1. 18 Mar, 2015 24 commits
  2. 16 Mar, 2015 16 commits
    • Andy Shevchenko's avatar
      staging: unisys: print MAC address via %pM · 9a836c0a
      Andy Shevchenko authored
      This patch converts code to use %pM specifier instead of placing each
      byte on stack.
      Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9a836c0a
    • Dan Carpenter's avatar
      staging: unisys: fix some debugfs output · bdbceb4d
      Dan Carpenter authored
      When we removed the ERRDEV() macro we made a small mistake so now it
      doesn't print the "Virtual PCI devices" section header.
      
      Fixes: 0aca7844 ('staging: unisys: remove ERRDEV macros')
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bdbceb4d
    • Michel von Czettritz's avatar
      staging: unisys: fix checkpatch warnings · 549fb6e3
      Michel von Czettritz authored
      This fixes "braces {} are not necessary for single statement blocks" in uislib.
      Signed-off-by: default avatarMichel von Czettritz <michel.von.czettritz@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      549fb6e3
    • Somya Anand's avatar
      Staging: nvec: use !x instead of x == NULL · 4c42d979
      Somya Anand authored
      Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
      usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
      Generally, When NULL represents failure, !x is commonly used.
      
      This patch cleans up the tests on the results of these functions, thereby
      using !x instead of x == NULL or NULL == x. This is done via following
      coccinelle script:
      @prob_7@
      identifier x;
      statement S;
      @@
      
      (
       x = devm_kzalloc(...);
      |
       x = usb_alloc_urb(...);
      |
       x = kmalloc_array(...);
      |
       x = devm_ioremap(...);
      |
       x = alloc_netdev(...);
      )
       ...
      - if(NULL == x)
      + if(!x)
              S
      Further we have used isomorphism characteristics of coccinelle to
      indicate x == NULL and NULL == x are equivalent. This is done via
      following iso script.
      
      Expression
      @ is_null @ expression X; @@
      X == NULL <=> NULL == X
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4c42d979
    • Somya Anand's avatar
      Staging: goldfish: use !x instead of x == NULL · 6e3f3bb8
      Somya Anand authored
      Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
      usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
      Generally, When NULL represents failure, !x is commonly used.
      
      This patch cleans up the tests on the results of these functions, thereby
      using !x instead of x == NULL or NULL == x. This is done via following
      coccinelle script:
      @prob_7@
      identifier x;
      statement S;
      @@
      
      (
       x = devm_kzalloc(...);
      |
       x = usb_alloc_urb(...);
      |
       x = kmalloc_array(...);
      |
       x = devm_ioremap(...);
      |
       x = alloc_netdev(...);
      )
       ...
      - if(NULL == x)
      + if(!x)
              S
      Further we have used isomorphism characteristics of coccinelle to
      indicate x == NULL and NULL == x are equivalent. This is done via
      following iso script.
      
      Expression
      @ is_null @ expression X; @@
      X == NULL <=> NULL == X
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6e3f3bb8
    • Somya Anand's avatar
      Staging: gdm72xx: use !x instead of x == NULL · 87e3dbc2
      Somya Anand authored
      Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
      usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
      Generally, When NULL represents failure, !x is commonly used.
      
      This patch cleans up the tests on the results of these functions, thereby
      using !x instead of x == NULL or NULL == x. This is done via following
      coccinelle script:
      @prob_7@
      identifier x;
      statement S;
      @@
      
      (
       x = devm_kzalloc(...);
      |
       x = usb_alloc_urb(...);
      |
       x = kmalloc_array(...);
      |
       x = devm_ioremap(...);
      |
       x = alloc_netdev(...);
      )
       ...
      - if(NULL == x)
      + if(!x)
              S
      Further we have used isomorphism characteristics of coccinelle to
      indicate x == NULL and NULL == x are equivalent. This is done via
      following iso script.
      
      Expression
      @ is_null @ expression X; @@
      X == NULL <=> NULL == X
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      87e3dbc2
    • Somya Anand's avatar
      staging: gdm724x: use !x instead of x == NULL · 9d877fdb
      Somya Anand authored
      Functions like devm_kzalloc, kmalloc_array, devm_ioremap,
      usb_alloc_urb, alloc_netdev return NULL as a return value on failure.
      Generally, When NULL represents failure, !x is commonly used.
      
      This patch cleans up the tests on the results of these functions, thereby
      using !x instead of x == NULL or NULL == x. This is done via following
      coccinelle script:
      @prob_7@
      identifier x;
      statement S;
      @@
      
      (
       x = devm_kzalloc(...);
      |
       x = usb_alloc_urb(...);
      |
       x = kmalloc_array(...);
      |
       x = devm_ioremap(...);
      |
       x = alloc_netdev(...);
      )
       ...
      - if(NULL == x)
      + if(!x)
      	S
      Further we have used isomorphism characteristics of coccinelle to
      indicate x == NULL and NULL == x are equivalent. This is done via
      following iso script.
      
      Expression
      @ is_null @ expression X; @@
      X == NULL <=> NULL == X
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9d877fdb
    • Haneen Mohammed's avatar
      Staging: emuxx_udc: replace pr_* with dev_* · 93275c80
      Haneen Mohammed authored
      dev_* is prefered over pr_* when appropriate dev structure is present.
      This patch replace pr_info and pr_warn with its dev_ counterpart.
      Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      93275c80
    • Haneen Mohammed's avatar
      Staging: ft1000: Remove parentheses around right side an assignment · 964308a6
      Haneen Mohammed authored
      Parentheses are not needed around the right hand side of an assignment.
      This patch remove parenthese of such occurenses. Issue was detected and
      solved using the following coccinelle script:
      
      @rule1@
      identifier x, y, z;
      expression E1, E2;
      @@
      
      (
      x = (y == z);
      |
      x = (E1 == E2);
      |
       x =
      -(
      ...
      -)
       ;
      )
      Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      964308a6
    • Haneen Mohammed's avatar
      Staging: media: Remove parentheses around right side an assignment · 8126e17f
      Haneen Mohammed authored
      Parentheses are not needed around the right hand side of an assignment.
      This patch remove parenthese of such occurenses. Issue was detected and
      solved using the following coccinelle script:
      
      @rule1@
      identifier x, y, z;
      expression E1, E2;
      @@
      
      (
      x = (y == z);
      |
      x = (E1 == E2);
      |
       x =
      -(
      ...
      -)
       ;
      )
      Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8126e17f
    • Haneen Mohammed's avatar
      Staging: rtl8723au: Remove parentheses around right side an assignment · acc4b97b
      Haneen Mohammed authored
      Parentheses are not needed around the right hand side of an assignment.
      This patch remove parenthese of such occurenses. Issue was detected and
      solved using the following coccinelle script:
      
      @rule1@
      identifier x, y, z;
      expression E1, E2;
      @@
      
      (
      x = (y == z);
      |
      x = (E1 == E2);
      |
       x =
      -(
      ...
      -)
       ;
      )
      Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      acc4b97b
    • Somya Anand's avatar
      Staging: gdm72xx: Iterate list using list_for_each_entry · 7e6eaa90
      Somya Anand authored
      Code using doubly linked list is iterated generally  using list_empty and
      list_entry functions, but it can be better written using list_for_each_entry
      macro.
      
      This patch replaces the while loop containing list_empty and list_entry with
      list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
      macro which is used to iterate over a list of given type. So while loop used to
      iterate over a list can be replaced with list_for_each_entry macro. However, if
      list_del is used in the loop, then list_for_each_entry_safe is a better choice.
      This transformation is done by using the following coccinelle script.
      
      @ rule1 @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry;
      @@
      
      - while (list_empty(&E1) == 0)
      + list_for_each_entry (I1, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...when != list_del(...);
             when != list_del_init(...);
       }
      
      @ rule2  @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry_safe;
      @@
         T *I1;
      +  T *tmp;
        ...
      - while (list_empty(&E1) == 0)
      + list_for_each_entry_safe (I1, tmp, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...
       }
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7e6eaa90
    • Somya Anand's avatar
      Staging: emxx_udc: Iterate list using list_for_each_entry · ca3d253e
      Somya Anand authored
      Code using doubly linked list is iterated generally  using list_empty and
      list_entry functions, but it can be better written using list_for_each_entry
      macro.
      
      This patch replaces the while loop containing list_empty and list_entry with
      list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
      macro which is used to iterate over a list of given type. So while loop used to
      iterate over a list can be replaced with list_for_each_entry macro. However, if
      list_del is used in the loop, then list_for_each_entry_safe is a better choice.
      This transformation is done by using the following coccinelle script.
      
      @ rule1 @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry;
      @@
      
      - while (list_empty(&E1) == 0)
      + list_for_each_entry (I1, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...when != list_del(...);
             when != list_del_init(...);
       }
      
      @ rule2  @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry_safe;
      @@
         T *I1;
      +  T *tmp;
        ...
      - while (list_empty(&E1) == 0)
      + list_for_each_entry_safe (I1, tmp, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...
       }
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ca3d253e
    • Somya Anand's avatar
      Staging: ft1000: Iterate list using list_for_each_entry · d19cb862
      Somya Anand authored
      Code using doubly linked list is iterated generally  using list_empty and
      list_entry functions, but it can be better written using list_for_each_entry
      macro.
      
      This patch replaces the while loop containing list_empty and list_entry with
      list_for_each_entry and list_for_each_entry_safe. list_for_each_entry is a
      macro which is used to iterate over a list of given type. So while loop used to
      iterate over a list can be replaced with list_for_each_entry macro. However, if
      list_del is used in the loop, then list_for_each_entry_safe is a better choice.
      This transformation is done by using the following coccinelle script.
      
      @ rule1 @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry;
      @@
      
      - while (list_empty(&E1) == 0)
      + list_for_each_entry (I1, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...when != list_del(...);
             when != list_del_init(...);
       }
      
      @ rule2  @
      expression E1;
      identifier I1, I2;
      type T;
      iterator name list_for_each_entry_safe;
      @@
         T *I1;
      +  T *tmp;
        ...
      - while (list_empty(&E1) == 0)
      + list_for_each_entry_safe (I1, tmp, &E1, I2)
       {
      	...when != T *I1;
      - 	I1 = list_entry(E1.next, T, I2);
          ...
       }
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d19cb862
    • Somya Anand's avatar
      Staging: i2o: Move assignment out of if statement · 68f4b737
      Somya Anand authored
      Checkpatch.pl suggest to avoid assignment in if statement.
      
      This patch moves assignments out of the if statement and place
      it before the if statement. This is done using following coccinelle
      script.
      
      @@
      expression E1;
      identifier p;
      statement S;
      @@
      - if ((p = E1))
      + p = E1;
      + if (p)
      	S
      Signed-off-by: default avatarSomya Anand <somyaanand214@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      68f4b737
    • Vatika Harlalka's avatar
      Staging: fbtft: Remove unnecessary print messages · afbd19ee
      Vatika Harlalka authored
      These print functions are called at the beginning
      of the function and do not indicate any abnormal condition.
      Signed-off-by: default avatarVatika Harlalka <vatikaharlalka@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      afbd19ee