From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: Richard Weinberger <richard@nod.at>,
"linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>,
Brian Norris <computersforpeace@gmail.com>,
David Woodhouse <dwmw2@infradead.org>
Subject: Re: [PATCH 2/2] mtd: nand: Remove BUG() abuse in nand_scan_tail
Date: Mon, 4 Apr 2016 20:30:54 +0200 [thread overview]
Message-ID: <20160404203054.6da8f60a@bbrezillon> (raw)
In-Reply-To: <CAAEAJfCuqAB_io_XG1wjH7ce-de+yixh5A81RFk--Vbaw_DVmQ@mail.gmail.com>
On Mon, 4 Apr 2016 12:34:00 -0300
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> On 4 April 2016 at 12:30, Richard Weinberger <richard@nod.at> wrote:
> > Am 04.04.2016 um 17:20 schrieb Boris Brezillon:
> >> On Sat, 2 Apr 2016 15:55:24 +0200
> >> Boris Brezillon <boris.brezillon@free-electrons.com> wrote:
> >>
> >>> On Fri, 1 Apr 2016 18:29:24 -0300
> >>> Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> wrote:
> >>>
> >>>> There's no reason to BUG() when parameters are being
> >>>> validated. Drivers can get things wrong, and it's much nicer
> >>>> to just throw a noisy warn and fail gracefully, than calling
> >>>> BUG() and throwing the whole system down the drain.
> >>>
> >>> I'm fine with this change as long as all callers are checking
> >>> nand_scan_tail() return value.
> >>
> >> Actually, the s3c2410 driver is not checking nand_scan_tail() return
> >> value. Could you send a v2 addressing that?
> >
> > And maybe add __must_check to nand_scan_tail() such that we catch issues like
> > these.
> >
>
> In fact, why not adding must_check to all the functions that can fail
> in the kernel?
>
> That'll help catch even more issues ;-)
I'll take your patch and patch the s3c2410 driver myself. Still think
that keeping the BUG() calls until all callers have been patched to
check nand_scan_tail() return code would be safer, but I don't care
enough to spend more time arguing on this :P.
Thanks,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-04-04 18:31 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 21:29 [PATCH 0/2] nand: Remove BUG abuse Ezequiel Garcia
2016-04-01 21:29 ` [PATCH 1/2] mtd: nand: Drop mtd.owner requirement in nand_scan Ezequiel Garcia
2016-04-01 21:57 ` Richard Weinberger
2016-04-01 22:06 ` Ezequiel Garcia
2016-04-01 22:26 ` Brian Norris
2016-04-02 13:52 ` Boris Brezillon
2016-04-03 6:14 ` Brian Norris
2016-04-01 21:29 ` [PATCH 2/2] mtd: nand: Remove BUG() abuse in nand_scan_tail Ezequiel Garcia
2016-04-01 21:51 ` Richard Weinberger
2016-04-02 13:55 ` Boris Brezillon
2016-04-04 15:20 ` Boris Brezillon
2016-04-04 15:26 ` Ezequiel Garcia
2016-04-04 15:30 ` Richard Weinberger
2016-04-04 15:34 ` Ezequiel Garcia
2016-04-04 18:30 ` Boris Brezillon [this message]
2016-04-04 16:43 ` Brian Norris
2016-04-05 16:58 ` Boris Brezillon
2016-04-02 13:55 ` [PATCH 0/2] nand: Remove BUG abuse Boris Brezillon
2016-04-02 15:37 ` Ezequiel Garcia
2016-04-04 15:33 ` Boris Brezillon
2016-04-04 15:39 ` Ezequiel Garcia
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=20160404203054.6da8f60a@bbrezillon \
--to=boris.brezillon@free-electrons.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=linux-mtd@lists.infradead.org \
--cc=richard@nod.at \
/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