From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Axel Lin <axel.lin@ingics.com>
Cc: "Wolfram Sang" <wsa@the-dreams.de>,
linux-i2c@vger.kernel.org,
"Uwe Kleine-König" <kernel@pengutronix.de>
Subject: Re: [PATCH v2] i2c: efm32: Prevent potential division by zero
Date: Thu, 14 Apr 2016 20:52:50 +0200 [thread overview]
Message-ID: <20160414185250.GT10108@pengutronix.de> (raw)
In-Reply-To: <CAFRkauC+JamMAM4YAunmqzggK7X4dDUAU8O0LTbcOEGHdD48uQ@mail.gmail.com>
Hello Axel,
On Thu, Apr 14, 2016 at 10:17:45PM +0800, Axel Lin wrote:
> 2016-04-14 19:40 GMT+08:00 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>:
> > On Thu, Apr 14, 2016 at 05:49:35PM +0800, Axel Lin wrote:
> >> Make sure we don't OOPS in case clock-frequency is set to 0 in a DT. The
> >> variable set here is later used as a divisor.
> >>
> >> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> >> ---
> >> If my understand is correct, you prefer to make it return error rather
> >> than using default frequency setting if DT setting is wrong.
> >
> > No, I'd say it doesn't matter that the driver crashes if something
> > invalid is specified in the device tree. This is not a driver bug, but a
> > dt bug. So if it happens, fix the device tree, no need to modify the
> > driver.
>
> I know that such case is a DT bug.
> But the intention of this patch is to avoid oops rather than fix dt.
> Make probe return error is enough to inform developer fixing dt.
an oops is also enough, and maybe even better because $developer cannot
miss it.
I don't care much, because the error probably won't happen. If you ask
me, I like your v2 better.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
prev parent reply other threads:[~2016-04-14 18:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 9:49 [PATCH v2] i2c: efm32: Prevent potential division by zero Axel Lin
2016-04-14 11:40 ` Uwe Kleine-König
2016-04-14 14:17 ` Axel Lin
2016-04-14 18:52 ` Uwe Kleine-König [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=20160414185250.GT10108@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=axel.lin@ingics.com \
--cc=kernel@pengutronix.de \
--cc=linux-i2c@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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;
as well as URLs for NNTP newsgroup(s).