linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4/5] libata: Add missing annotation for ata_scsi_rbuf_get() and ata_scsi_rbuf_fill()
       [not found] ` <20200403160505.2832-1-jbi.octave@gmail.com>
@ 2020-04-03 16:05   ` Jules Irenge
  0 siblings, 0 replies; only message in thread
From: Jules Irenge @ 2020-04-03 16:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: boqun.feng, Jens Axboe,
	open list:LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-03 16:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <0/5>
     [not found] ` <20200403160505.2832-1-jbi.octave@gmail.com>
2020-04-03 16:05   ` [PATCH 4/5] libata: Add missing annotation for ata_scsi_rbuf_get() and ata_scsi_rbuf_fill() Jules Irenge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).