Linux Media Controller development
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: "Jakub Kicinski" <kuba@kernel.org>,
	Julia.Lawall@inria.fr, "Alex Deucher" <alexander.deucher@amd.com>,
	"Alexander Shishkin" <alexander.shishkin@linux.intel.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Arkadiusz Kubalewski" <arkadiusz.kubalewski@intel.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Christian König" <christian.koenig@amd.com>,
	"Daniel Lezcano" <daniel.lezcano@kernel.org>,
	"David Airlie" <airlied@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Dmitry Torokhov" <dmitry.torokhov@gmail.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Florian Westphal" <fw@strlen.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Hans de Goede" <hansg@kernel.org>,
	"Hans Verkuil" <hverkuil@kernel.org>,
	"Heikki Krogerus" <heikki.krogerus@linux.intel.com>,
	"Herbert Xu" <herbert@gondor.apana.org.au>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	"Jaroslav Kysela" <perex@perex.cz>,
	"Jason Gunthorpe" <jgg@ziepe.ca>, "Jiri Pirko" <jiri@resnulli.us>,
	"Joerg Roedel (AMD)" <joro@8bytes.org>,
	"Johan Hovold" <johan@kernel.org>,
	"Jonathan Cameron" <jic23@kernel.org>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Julian Anastasov" <ja@ssi.bg>,
	"Leon Romanovsky" <leon@kernel.org>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Linus Walleij" <linusw@kernel.org>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Matthew Sakai" <msakai@redhat.com>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Mike Rapoport" <rppt@kernel.org>,
	"Miri Korenblit" <miriam.rachel.korenblit@intel.com>,
	"Nicolas Palix" <nicolas.palix@imag.fr>,
	"Pablo Neira Ayuso" <pablo@netfilter.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Ping-Ke Shih" <pkshih@realtek.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	"Shuah Khan" <shuah@kernel.org>,
	"Simona Vetter" <simona@ffwll.ch>,
	"Simon Horman" <horms@verge.net.au>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Steve French" <sfrench@samba.org>,
	"Takashi Iwai" <tiwai@suse.com>,
	"Thomas Renninger" <trenn@suse.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Tony Luck" <tony.luck@intel.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Vadim Fedorenko" <vadim.fedorenko@linux.dev>,
	"Vinod Koul" <vkoul@kernel.org>, "Will Deacon" <will@kernel.org>,
	"Yazen Ghannam" <Yazen.Ghannam@amd.com>,
	cocci@inria.fr, amd-gfx@lists.freedesktop.org,
	dmaengine@vger.kernel.org, dm-devel@lists.linux.dev,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev,
	linux-cifs@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org,
	linux-gpio@vger.kernel.org, linux-iio@vger.kernel.org,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-media@vger.kernel.org, linux-mm@kvack.org,
	linux-pm@vger.kernel.org, linux-rdma@vger.kernel.org,
	linux-rtc@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-scsi@vger.kernel.org, linux-sound@vger.kernel.org,
	linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org,
	lvs-devel@vger.kernel.org, netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org, nouveau@lists.freedesktop.org,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH 00/36] treewide: remove conditional returns with no effect
Date: Mon, 27 Jul 2026 14:36:57 +0300	[thread overview]
Message-ID: <a4703624643e1d2fd1a9dedc1d36ce5d34d3133f@intel.com> (raw)
In-Reply-To: <CABFDxMFMOAZ_3kYxEGCutnGt1OSSmgvmwx-=M1RxGc3VGKORYQ@mail.gmail.com>

On Mon, 27 Jul 2026, Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
> Hello,
>
> On Mon, Jul 27, 2026 at 5:30 PM Jani Nikula <jani.nikula@linux.intel.com> wrote:
>>
>> On Fri, 24 Jul 2026, Jakub Kicinski <kuba@kernel.org> wrote:
>> > On Fri, 24 Jul 2026 03:45:02 +0900 Sang-Heon Jeon wrote:
>> >> Patch 1 adds a Coccinelle script that matches the pattern, including
>> >> negation and constant-comparison variants. Where a local variable is
>> >> assigned right before the check, the assignment and the two returns
>> >> turn into a single return of the assigned expression.
>> >
>> > Huh, I thought we already had such script. Various script children have
>> > been sending such "cleanups" in the past.
>>
>> We did, and it was removed, I believe in 1a617a8475e8 ("coccinelle:
>> misc: remove "complex return code" warnings"), because people just don't
>> want this constant churn.
>>
>> It's perfectly fine to have the error case and happy day scenario
>> separated.
>
> Thanks for sharing the history.
>
> I checked the mailing list. The removed script looks similar to the
> new one, but it is different. The removed script reported a
> conditional return followed by an explicit return 0, where the error
> case and happy day scenario are separated as you mentioned, and Johan
> also complained about this 10 years ago.
>
> But the new script only reports when both branches return the same
> variable, not the explicit 0. So, I think the new script is close to
> the restricted version that Julia mentioned 10 years ago, and it
> should be acceptable.

ret === 0 after an if (ret) return.

BR,
Jani.


>
>>
>> BR,
>> Jani.
>>
>>
>> --
>> Jani Nikula, Intel
>
> Best Regards,
> Sang-Heon Jeon

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-07-27 11:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-23 18:45 [PATCH 00/36] treewide: remove conditional returns with no effect Sang-Heon Jeon
2026-07-23 18:45 ` [PATCH 12/36] media: remove conditional return " Sang-Heon Jeon
2026-07-23 20:26   ` Niklas Söderlund
2026-07-24 21:48 ` [PATCH 00/36] treewide: remove conditional returns " Jakub Kicinski
2026-07-27  8:30   ` Jani Nikula
2026-07-27 11:08     ` Sang-Heon Jeon
2026-07-27 11:36       ` Jani Nikula [this message]
2026-07-24 23:35 ` (subset) " Sebastian Reichel
2026-07-27 12:12 ` Mark Brown
2026-07-27 12:59   ` Sang-Heon Jeon

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=a4703624643e1d2fd1a9dedc1d36ce5d34d3133f@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=Julia.Lawall@inria.fr \
    --cc=Yazen.Ghannam@amd.com \
    --cc=airlied@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.deucher@amd.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=andrew@lunn.ch \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=bp@alien8.de \
    --cc=broonie@kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=cocci@inria.fr \
    --cc=daniel.lezcano@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dm-devel@lists.linux.dev \
    --cc=dmaengine@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=ekffu200098@gmail.com \
    --cc=fw@strlen.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=hansg@kernel.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=horms@verge.net.au \
    --cc=hverkuil@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=iommu@lists.linux.dev \
    --cc=ja@ssi.bg \
    --cc=jgg@ziepe.ca \
    --cc=jic23@kernel.org \
    --cc=jiri@resnulli.us \
    --cc=johan@kernel.org \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=joro@8bytes.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linusw@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=martin.petersen@oracle.com \
    --cc=mchehab@kernel.org \
    --cc=miriam.rachel.korenblit@intel.com \
    --cc=mripard@kernel.org \
    --cc=msakai@redhat.com \
    --cc=mturquette@baylibre.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=nicolas.palix@imag.fr \
    --cc=nouveau@lists.freedesktop.org \
    --cc=pabeni@redhat.com \
    --cc=pablo@netfilter.org \
    --cc=perex@perex.cz \
    --cc=pkshih@realtek.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rodrigo.vivi@intel.com \
    --cc=rppt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=sfrench@samba.org \
    --cc=shuah@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=sre@kernel.org \
    --cc=tiwai@suse.com \
    --cc=tony.luck@intel.com \
    --cc=trenn@suse.com \
    --cc=tursulin@ursulin.net \
    --cc=tzimmermann@suse.de \
    --cc=vadim.fedorenko@linux.dev \
    --cc=vkoul@kernel.org \
    --cc=will@kernel.org \
    /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