mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "José Expósito" <jose.exposito89@gmail.com>
To: louis.chauvet@bootlin.com
Cc: airlied@gmail.com, dri-devel@lists.freedesktop.org,
	hamohammed.sa@gmail.com, linux-kernel@vger.kernel.org,
	maarten.lankhorst@linux.intel.com, mairacanal@riseup.net,
	melissa.srw@gmail.com, mripard@kernel.org,
	rodrigosiqueiramelo@gmail.com, simona@ffwll.ch,
	thomas.petazzoni@bootlin.com, tzimmermann@suse.de,
	"José Expósito" <jose.exposito89@gmail.com>
Subject: [PATCH] drm/vkms: Suppress context imbalance sparse warning
Date: Tue, 17 Sep 2024 18:02:24 +0200	[thread overview]
Message-ID: <20240917160228.2933-1-jose.exposito89@gmail.com> (raw)
In-Reply-To: <20240912-vkms-warnings-v1-1-59f3e13ea8e5@bootlin.com>

Hi Louis,

> The functions `vkms_crtc_atomic_begin` and `vkms_crtc_atomic_flush` are
> responsible for locking and unlocking a mutex, respectively. Add the
> `__acquires` and `__releases` annotations to these functions to prevent
> the associated sparse warning about context imbalance.
> 
> Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>

Thanks for fixing this warning. Tested it and I can confirm that these
warnings are fixed now:

  drivers/gpu/drm/vkms/vkms_crtc.c:233:13: warning: context imbalance in 'vkms_crtc_atomic_begin' - wrong count at exit
  drivers/gpu/drm/vkms/vkms_crtc.c:262:39: warning: context imbalance in 'vkms_crtc_atomic_flush' - unexpected unlock

Feel free to add:
Reviewed-by: José Expósito <jose.exposito89@gmail.com>

> ---
>  drivers/gpu/drm/vkms/vkms_crtc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 
> ---
> base-commit: d2194256049910d286cd6c308c2689df521d8842
> change-id: 20240912-vkms-warnings-e0e331bc5e6d
> 
> Best regards,
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu/drm/vkms/vkms_crtc.c
> index 40b4d084e3ceef9e1e24b7338efdd9253afee8d6..2ad164b518fb93f5b6b86948116ff7ed97770b60 100644
> --- a/drivers/gpu/drm/vkms/vkms_crtc.c
> +++ b/drivers/gpu/drm/vkms/vkms_crtc.c
> @@ -232,6 +232,7 @@ static void vkms_crtc_atomic_disable(struct drm_crtc *crtc,
>  
>  static void vkms_crtc_atomic_begin(struct drm_crtc *crtc,
>  				   struct drm_atomic_state *state)
> +	__acquires(&vkms_output->lock)
>  {
>  	struct vkms_output *vkms_output = drm_crtc_to_vkms_output(crtc);
>  
> @@ -243,6 +244,7 @@ static void vkms_crtc_atomic_begin(struct drm_crtc *crtc,
>  
>  static void vkms_crtc_atomic_flush(struct drm_crtc *crtc,
>  				   struct drm_atomic_state *state)
> +	__releases(&vkms_output->lock)
>  {
>  	struct vkms_output *vkms_output = drm_crtc_to_vkms_output(crtc);
>  
> 

  reply	other threads:[~2024-09-17 16:02 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-12 15:25 Louis Chauvet
2024-09-17 16:02 ` José Expósito [this message]
2024-09-24 23:59 ` Maíra Canal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240917160228.2933-1-jose.exposito89@gmail.com \
    --to=jose.exposito89@gmail.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=louis.chauvet@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mairacanal@riseup.net \
    --cc=melissa.srw@gmail.com \
    --cc=mripard@kernel.org \
    --cc=rodrigosiqueiramelo@gmail.com \
    --cc=simona@ffwll.ch \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®