• Arnd Bergmann's avatar
    HID: intel_ish-hid: clarify locking in client code · 538be0aa
    Arnd Bergmann authored
    I was trying to understand this code while working on a warning
    fix and the locking made no sense: spin_lock_irqsave() is pointless
    when run inside of an interrupt handler or nested inside of another
    spin_lock_irq() or spin_lock_irqsave().
    
    Here it turned out that the comment above the function is wrong,
    as both recv_ishtp_cl_msg_dma() and recv_ishtp_cl_msg() can in fact
    be called from a work queue rather than an ISR, so we do have to
    use the irqsave() version once.
    
    This fixes the comments accordingly, removes the misleading 'dev_flags'
    variable and modifies the inner spinlock to not use 'irqsave'.
    
    No functional change is intended, this is just for readability and
    it slightly simplifies the object code.
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
    538be0aa
client.c 27.1 KB