1. 16 Nov, 2012 2 commits
    • Wei Yongjun's avatar
      wlcore: spi: use platform_device_unregister in wl1271_remove() · ca6dc103
      Wei Yongjun authored
      platform_device_unregister() only calls platform_device_del() and
      platform_device_put(), thus use platform_device_unregister() to
      simplify the code.
      
      Also the documents in platform.c shows that platform_device_del
      and platform_device_put must _only_ be externally called in error
      cases.  All other usage is a bug.
      
      dpatch engine is used to auto generate this patch.
      (https://github.com/weiyj/dpatch)
      Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
      Signed-off-by: default avatarLuciano Coelho <luca@coelho.fi>
      ca6dc103
    • Julia Lawall's avatar
      drivers/net/wireless/ti/wlcore/main.c: eliminate possible double power off · 4fb4e0be
      Julia Lawall authored
      The function wl12xx_set_power_on is only called twice, once in
      wl12xx_chip_wakeup and once in wl12xx_get_hw_info.  On the failure of the
      call in wl12xx_chip_wakeup, the containing function just returns, but on
      the failure of the call in wl12xx_get_hw_info, the containing function
      calls wl1271_power_off.  This does not seem necessary, because if
      wl12xx_set_power_on has set the power on and then fails, it has already
      turned the power off.
      
      A simplified version of the semantic match that finds this problem is as
      follows: (http://coccinelle.lip6.fr/)
      
      // <smpl>
      @r@
      identifier f,free,a;
      parameter list[n] ps;
      type T;
      expression e;
      @@
      
      f(ps,T a,...) {
        ... when any
            when != a = e
        if(...) { ... free(a); ... return ...; }
        ... when any
      }
      
      @@
      identifier r.f,r.free;
      expression x,a;
      expression list[r.n] xs;
      @@
      
      * x = f(xs,a,...);
        if (...) { ... free(a); ... return ...; }
      // </smpl>
      Signed-off-by: default avatarJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: default avatarLuciano Coelho <luca@coelho.fi>
      4fb4e0be
  2. 14 Nov, 2012 38 commits