ipmi: Add missing annotation for ipmi_ssif_lock_cond() and ipmi_ssif_unlock_cond()
authorJules Irenge <jbi.octave@gmail.com>
Fri, 3 Apr 2020 16:05:05 +0000 (17:05 +0100)
committerCorey Minyard <cminyard@mvista.com>
Fri, 3 Apr 2020 18:34:57 +0000 (13:34 -0500)
Sparse reports a warning at ipmi_ssif_unlock_cond()
and ipmi_ssif_lock_cond()

warning: context imbalance in ipmi_ssif_lock_cond()
- wrong count at exit
 warning: context imbalance in ipmi_ssif_unlock_cond()
- unexpected unlock

The root cause is the missing annotation at ipmi_ssif_unlock_cond()
and ipmi_ssif_lock_cond()

Add the missing __acquires(&ata_scsi_rbuf_lock)
Add the missing __releases(&ata_scsi_rbuf_lock)

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
Message-Id: <20200403160505.2832-6-jbi.octave@gmail.com>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
drivers/char/ipmi/ipmi_ssif.c

index 8ac390c2b51475b5dc79559c931dbd0b7f777571..b7145f370d3bb08b1eb230f96ac1db69783e6ee8 100644 (file)
@@ -313,6 +313,7 @@ static int start_send(struct ssif_info *ssif_info,
 
 static unsigned long *ipmi_ssif_lock_cond(struct ssif_info *ssif_info,
                                          unsigned long *flags)
+       __acquires(&ssif_info->lock)
 {
        spin_lock_irqsave(&ssif_info->lock, *flags);
        return flags;
@@ -320,6 +321,7 @@ static unsigned long *ipmi_ssif_lock_cond(struct ssif_info *ssif_info,
 
 static void ipmi_ssif_unlock_cond(struct ssif_info *ssif_info,
                                  unsigned long *flags)
+       __releases(&ssif_info->lock)
 {
        spin_unlock_irqrestore(&ssif_info->lock, *flags);
 }