1. 07 Mar, 2010 2 commits
    • Joe Perches's avatar
      vsprintf.c: Reduce sizeof struct printf_spec from 24 to 8 bytes · ef0658f3
      Joe Perches authored
      Reducing the size of struct printf_spec is a good thing because multiple
      instances are commonly passed on stack.
      
      It's possible for type to be u8 and field_width to be s8, but this is
      likely small enough for now.
      Signed-off-by: default avatarJoe Perches <joe@perches.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      ef0658f3
    • Linus Torvalds's avatar
      usbfs: fix deadlock on 'usbfs_mutex', clean up poll · 7bc80cd9
      Linus Torvalds authored
      The caller of usbfs_conn_disc_event() in some cases (but not always)
      already holds usbfs_mutex, so trying to protect the event counter with
      that lock causes nasty deadlocks.
      
      The problem was introduced by commit 554f7696 ("USB: Remove BKL from
      poll()") when the BLK protection was turned into using the mutex instead.
      
      So fix this by using an atomic variable instead.  And while we're at it,
      get rid of the atrocious naming of said variable and the waitqueue it is
      associated with.
      
      This also cleans up the unnecessary locking in the poll routine, since
      the whole point of how the pollwait table works is that you can just add
      yourself to the waiting list, and then check the condition you're
      waiting for afterwards - avoiding all races.
      
      It also gets rid of the unnecessary dynamic allocation of the device
      status that just contained a single word.  We should use f_version for
      this, as Dmitry Torokhov points out.  That simplifies everything
      further.
      Reported-and-tested-by: default avatarJeff Chua <jeff.chua.linux@gmail.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Cc: Oliver Neukum <oliver@neukum.org>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7bc80cd9
  2. 06 Mar, 2010 38 commits