• Matthew Dharm's avatar
    [PATCH] USB Storage: Remove unnecessary state testing · b594df6e
    Matthew Dharm authored
    This patch started as as405 from Alan Stern.  It has been re-generated
    against the current tip of the BK tree.
    
    For quite a while we've had a bunch of state-transition testing code in the
    driver, to report if anything bad ever happens (like the SCSI midlayer
    trying to queue a second command before the first one finishes).  None of
    those tests triggered in a very long time; this aspect of the code appears
    to be extremely stable.
    
    So this patch removes all those tests for illegal values of us->sm_state.
    It turns out that sm_state was used only for one other purpose: to check
    whether a command had timed out and caused a SCSI abort.  That piece of
    information can easily be stored in a single new bitflag (which is called
    calling US_FLIDX_TIMED_OUT) and doing so makes us->sm_state completely
    unused.  Hence the patch removes it from the structure.
    Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
    Signed-off-by: default avatarMatthew Dharm <mdharm-usb@one-eyed-alien.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
    b594df6e
scsiglue.c 14.8 KB