lkml.org 
[lkml]   [2020]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/5] libata: Add missing annotation for ata_scsi_rbuf_get() and ata_scsi_rbuf_fill()
Date
Sparse reports a warning at ata_scsi_rbuf_fill() and ata_scsi_rbuf_get()

warning: context imbalance in ata_scsi_rbuf_get() - wrong count at exit
warning: context imbalance in ata_scsi_rbuf_fill() - unexpected unlock

The root cause is the missing annotation at ata_scsi_rbuf_fill()
and ata_scsi_rbuf_get()

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>
---
drivers/ata/libata-scsi.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index eb2eb599e602..3436b782053d 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2082,6 +2082,7 @@ struct ata_scsi_args {
*/
static void *ata_scsi_rbuf_get(struct scsi_cmnd *cmd, bool copy_in,
unsigned long *flags)
+ __acquires(&ata_scsi_rbuf_lock)
{
spin_lock_irqsave(&ata_scsi_rbuf_lock, *flags);

@@ -2106,6 +2107,7 @@ static void *ata_scsi_rbuf_get(struct scsi_cmnd *cmd, bool copy_in,
*/
static inline void ata_scsi_rbuf_put(struct scsi_cmnd *cmd, bool copy_out,
unsigned long *flags)
+ __releases(&ata_scsi_rbuf_lock)
{
if (copy_out)
sg_copy_from_buffer(scsi_sglist(cmd), scsi_sg_count(cmd),
--
2.24.1
\
 
 \ /
  Last update: 2020-04-03 18:06    [W:0.080 / U:1.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site