From: "Luca Ceresoli" <luca.ceresoli@bootlin.com>
To: "Liu Ying" <victor.liu@nxp.com>,
"Andrzej Hajda" <andrzej.hajda@intel.com>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Robert Foss" <rfoss@kernel.org>,
"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
"Jonas Karlman" <jonas@kwiboo.se>,
"Jernej Skrabec" <jernej.skrabec@gmail.com>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
"David Airlie" <airlied@gmail.com>,
"Simona Vetter" <simona@ffwll.ch>
Cc: "Hui Pu" <Hui.Pu@gehealthcare.com>,
"Ian Ray" <ian.ray@gehealthcare.com>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH RESEND] drm/bridge: drm_bridge_get/put(): document NULL pointer behaviour
Date: Thu, 26 Mar 2026 11:00:03 +0100 [thread overview]
Message-ID: <DHCMK408P4K0.23H5IMREOL9GU@bootlin.com> (raw)
In-Reply-To: <6d2e9c83-8652-427f-869a-20f7353f126a@nxp.com>
Hello Liu,
On Thu Mar 26, 2026 at 10:36 AM CET, Liu Ying wrote:
>> --- a/drivers/gpu/drm/drm_bridge.c
>> +++ b/drivers/gpu/drm/drm_bridge.c
>> @@ -282,7 +282,7 @@ static void __drm_bridge_free(struct kref *kref)
>>
>> /**
>> * drm_bridge_get - Acquire a bridge reference
>> - * @bridge: DRM bridge
>> + * @bridge: DRM bridge; if NULL this function does nothing
>> *
>> * This function increments the bridge's refcount.
>> *
>> @@ -300,7 +300,7 @@ EXPORT_SYMBOL(drm_bridge_get);
>>
>> /**
>> * drm_bridge_put - Release a bridge reference
>> - * @bridge: DRM bridge
>> + * @bridge: DRM bridge; if NULL this function does nothing
>
> So, we can drop the if(_T) check for cleanup action, right?
We could, but it's supposed to be there to help compiler optimizations:
https://elixir.bootlin.com/linux/v7.0-rc5/source/include/linux/cleanup.h#L192-L207
> DEFINE_FREE(drm_bridge_put, struct drm_bridge *, if (_T) drm_bridge_put(_T))
>
> Reviewed-by: Liu Ying <victor.liu@nxp.com>
Thanks!
Luca
--
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2026-03-26 10:00 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 9:08 Luca Ceresoli
2026-03-26 9:36 ` Liu Ying
2026-03-26 10:00 ` Luca Ceresoli [this message]
2026-04-08 15:27 ` Louis Chauvet
2026-04-09 14:32 ` Luca Ceresoli
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=DHCMK408P4K0.23H5IMREOL9GU@bootlin.com \
--to=luca.ceresoli@bootlin.com \
--cc=Hui.Pu@gehealthcare.com \
--cc=Laurent.pinchart@ideasonboard.com \
--cc=airlied@gmail.com \
--cc=andrzej.hajda@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=ian.ray@gehealthcare.com \
--cc=jernej.skrabec@gmail.com \
--cc=jonas@kwiboo.se \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=rfoss@kernel.org \
--cc=simona@ffwll.ch \
--cc=thomas.petazzoni@bootlin.com \
--cc=tzimmermann@suse.de \
--cc=victor.liu@nxp.com \
/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
Powered by JetHome