From: Steve Longerbeam <slongerbeam@gmail.com>
To: Philipp Zabel <p.zabel@pengutronix.de>, Arnd Bergmann <arnd@arndb.de>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hans Verkuil <hans.verkuil@cisco.com>,
Marek Vasut <marex@denx.de>,
Russell King <rmk+kernel@armlinux.org.uk>,
linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] [media] staging/imx: remove confusing IS_ERR_OR_NULL usage
Date: Wed, 12 Jul 2017 10:12:45 -0700 [thread overview]
Message-ID: <0470fa74-dfbd-e512-295c-4ba64c483aac@gmail.com> (raw)
In-Reply-To: <1499874605.6374.56.camel@pengutronix.de>
On 07/12/2017 08:50 AM, Philipp Zabel wrote:
> On Tue, 2017-07-11 at 15:18 +0200, Arnd Bergmann wrote:
>> While looking at a compiler warning, I noticed the use of
>> IS_ERR_OR_NULL, which is generally a sign of a bad API design
>> and should be avoided.
>>
>> In this driver, this is fairly easy, we can simply stop storing
>> error pointers in persistent structures, and change the two
>> functions that might return either a NULL pointer or an error
>> code to consistently return error pointers when failing.
>>
>> of_parse_subdev() now separates the error code and the pointer
>> it looks up, to clarify the interface. There are two cases
>> where this function originally returns 'NULL', and I have
>> changed that to '0' for success to keep the current behavior,
>> though returning an error would also make sense there.
>>
>> Fixes: e130291212df ("[media] media: Add i.MX media core driver")
>> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
>> ---
>> v2: fix type mismatch
>> v3: rework of_parse_subdev() as well.
>
> Thanks!
>
> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
> Tested-by: Philipp Zabel <p.zabel@pengutronix.de>
>
Looks fine to me. Tested on SabreAuto with affected pipelines.
Reviewed-by: Steve Longerbeam <steve_longerbeam@mentor.com>
Tested-by: Steve Longerbeam <steve_longerbeam@mentor.com>
prev parent reply other threads:[~2017-07-12 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-11 13:18 [PATCH v2] [media] staging/imx: remove confusing IS_ERR_OR_NULL usage Arnd Bergmann
2017-07-12 15:50 ` Philipp Zabel
2017-07-12 17:12 ` Steve Longerbeam [this message]
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=0470fa74-dfbd-e512-295c-4ba64c483aac@gmail.com \
--to=slongerbeam@gmail.com \
--cc=arnd@arndb.de \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hans.verkuil@cisco.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=marex@denx.de \
--cc=mchehab@kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=rmk+kernel@armlinux.org.uk \
/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