[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190228135403.GD9806@kadam>
Date: Thu, 28 Feb 2019 16:54:03 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Brendan Higgins <brendanhiggins@...gle.com>
Cc: Stephen Boyd <sboyd@...nel.org>,
Frank Rowand <frowand.list@...il.com>,
Kees Cook <keescook@...gle.com>,
Kieran Bingham <kieran.bingham@...asonboard.com>,
Luis Chamberlain <mcgrof@...nel.org>,
Rob Herring <robh@...nel.org>, shuah@...nel.org,
Greg KH <gregkh@...uxfoundation.org>,
Joel Stanley <joel@....id.au>,
Michael Ellerman <mpe@...erman.id.au>,
Joe Perches <joe@...ches.com>, brakmo@...com,
Steven Rostedt <rostedt@...dmis.org>,
"Bird, Timothy" <Tim.Bird@...y.com>,
Kevin Hilman <khilman@...libre.com>,
Julia Lawall <julia.lawall@...6.fr>,
linux-kselftest@...r.kernel.org, kunit-dev@...glegroups.com,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Jeff Dike <jdike@...toit.com>,
Richard Weinberger <richard@....at>,
linux-um@...ts.infradead.org, Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Dan Williams <dan.j.williams@...el.com>,
linux-nvdimm <linux-nvdimm@...ts.01.org>,
Knut Omang <knut.omang@...cle.com>,
devicetree <devicetree@...r.kernel.org>,
Petr Mladek <pmladek@...e.com>,
Sasha Levin <Alexander.Levin@...rosoft.com>,
Amir Goldstein <amir73il@...il.com>, wfg@...ux.intel.com
Subject: Re: [RFC v4 08/17] kunit: test: add support for test abort
On Thu, Feb 28, 2019 at 01:03:24AM -0800, Brendan Higgins wrote:
> you could do:
>
> if (IS_ERR_OR_NULL(ptr)) {
> KUNIT_FAIL(test, "ptr is an errno or null: %ld", ptr);
> return;
> }
It's best to not mix error pointers and NULL but when we do mix them,
it means that NULL is a special kind of success. Like we try to load
a feature and we get back:
valid pointer <-- success
null <-- feature is disabled. not an error.
error pointer <-- feature is broken. fail.
regards,
dan carpenter
Powered by blists - more mailing lists