diff mbox series

[6/9] scsi: libsas: Add missing annotation for sas_ata_qc_issue()

Message ID 20200411001933.10072-7-jbi.octave@gmail.com (mailing list archive)
State Accepted
Headers show
Series None | expand

Commit Message

Jules Irenge April 11, 2020, 12:19 a.m. UTC
Sparse reports a warning at sas_ata_qc_issue()

warning: context imbalance in sas_ata_qc_issue() - unexpected unlock
The root cause is the missing annotation at sas_ata_qc_issue()

Add the missing __must_hold(ap->lock) annotation

Signed-off-by: Jules Irenge <jbi.octave@gmail.com>
---
 drivers/scsi/libsas/sas_ata.c | 1 +
 1 file changed, 1 insertion(+)

Comments

John Garry April 14, 2020, 7:35 a.m. UTC | #1
On 11/04/2020 01:19, Jules Irenge wrote:
> Sparse reports a warning at sas_ata_qc_issue()
> 
> warning: context imbalance in sas_ata_qc_issue() - unexpected unlock
> The root cause is the missing annotation at sas_ata_qc_issue()
> 
> Add the missing __must_hold(ap->lock) annotation
> 
> Signed-off-by: Jules Irenge <jbi.octave@gmail.com>

that looks ok...

Reviewed-by: John Garry <john.garry@huawei.com>

> ---
>   drivers/scsi/libsas/sas_ata.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
> index c5a828a041e0..5d716d388707 100644
> --- a/drivers/scsi/libsas/sas_ata.c
> +++ b/drivers/scsi/libsas/sas_ata.c
> @@ -160,6 +160,7 @@ static void sas_ata_task_done(struct sas_task *task)
>   }
>   
>   static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
> +	__must_hold(ap->lock)
>   {
>   	struct sas_task *task;
>   	struct scatterlist *sg;
>
Martin K. Petersen April 15, 2020, 1:44 a.m. UTC | #2
Jules,

> Sparse reports a warning at sas_ata_qc_issue()
>
> warning: context imbalance in sas_ata_qc_issue() - unexpected unlock
> The root cause is the missing annotation at sas_ata_qc_issue()
>
> Add the missing __must_hold(ap->lock) annotation

Applied to 5.8/scsi-queue, thanks!
diff mbox series

Patch

diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c
index c5a828a041e0..5d716d388707 100644
--- a/drivers/scsi/libsas/sas_ata.c
+++ b/drivers/scsi/libsas/sas_ata.c
@@ -160,6 +160,7 @@  static void sas_ata_task_done(struct sas_task *task)
 }
 
 static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
+	__must_hold(ap->lock)
 {
 	struct sas_task *task;
 	struct scatterlist *sg;