• S
    ahci: avoid #ifdef DEBUG_AHCI bitrot · 192cf55c
    Stefan Hajnoczi 提交于
    Debug code using #ifdef is susceptible to bitrot because the compiler
    never checks the debug code.
    
    This is easy to avoid, change the DPRINTF() macro to use if (DEBUG_AHCI)
    and always give it a 0 or 1 value.
    
    This also allows us to drop an #ifdef DEBUG_AHCI in ahci_start_dma()
    since the compiler can now see the local variable is used.
    
    The motivation for this change is a recent DEBUG_AHCI build failure due
    to an outdated DPRINTF() format string.  From now on the compiler will
    catch these errors.
    
    Cc: John Snow <jsnow@redhat.com>
    Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
    Reviewed-by: NJohn Snow <jsnow@redhat.com>
    Message-id: 1415874281-7371-2-git-send-email-stefanha@redhat.com
    Signed-off-by: NKevin Wolf <kwolf@redhat.com>
    192cf55c
ahci.c 43.5 KB