From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Thierry Reding <thierry.reding@gmail.com>,
linux-pwm@vger.kernel.org, Neil Brown <neilb@suse.de>,
kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
kernel@pengutronix.de, Neil Armstrong <narmstrong@baylibre.com>
Subject: Re: [PATCH 1/4] pwm: omap-dmtimer: remove pwmchip in .remove before making it unfunctional
Date: Mon, 11 Nov 2019 21:00:05 +0100 [thread overview]
Message-ID: <20191111200005.c37mecp44idxskjq@pengutronix.de> (raw)
In-Reply-To: <dd3fe743-ee4a-153a-c044-40587568a494@web.de>
Hello Markus,
On Mon, Nov 11, 2019 at 02:30:42PM +0100, Markus Elfring wrote:
> > In the old code (e.g.) mutex_destroy() was called before
> > pwmchip_remove(). Between these two calls it is possible that a pwm
> > callback is used which tries to grab the mutex.
>
> How do you think about to add a more “imperative mood” for your
> change description?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=31f4f5b495a62c9a8b15b1c3581acd5efeb9af8c#n151
I described the old behaviour and like my wording.
> > +++ b/drivers/pwm/pwm-omap-dmtimer.c
> > @@ -351,6 +351,11 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
> > static int pwm_omap_dmtimer_remove(struct platform_device *pdev)
> > {
> > struct pwm_omap_dmtimer_chip *omap = platform_get_drvdata(pdev);
> > + int ret;
> > +
> > + ret = pwmchip_remove(&omap->chip);
> > + if (ret)
> > + return ret;
> >
> > if (pm_runtime_active(&omap->dm_timer_pdev->dev))
> > omap->pdata->stop(omap->dm_timer);
>
> How do you think about to use the following statement variant?
>
> + int ret = pwmchip_remove(&omap->chip);
I think that between the declarations and code should be an empty line
and between the assignment to ret and the respective check there
shouldn't be one.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
next prev parent reply other threads:[~2019-11-11 20:00 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-09 12:26 [PATCH] pwm: omap-dmtimer: Add missing put_device() call in pwm_omap_dmtimer_probe() Markus Elfring
2019-11-11 7:19 ` Uwe Kleine-König
[not found] ` <20191111090357.13903-1-u.kleine-koenig@pengutronix.de>
[not found] ` <20191111091606.qf7gj5gln3khfnsl@pengutronix.de>
2019-11-11 13:28 ` [0/4] pwm: omap-dmtimer: Software improvements Markus Elfring
2019-11-11 13:28 ` Markus Elfring
2019-11-11 19:57 ` Uwe Kleine-König
2019-11-11 13:30 ` [PATCH 1/4] pwm: omap-dmtimer: remove pwmchip in .remove before making it unfunctional Markus Elfring
2019-11-11 20:00 ` Uwe Kleine-König [this message]
2019-11-11 21:00 ` [1/4] " Markus Elfring
[not found] ` <20191111090357.13903-2-u.kleine-koenig@pengutronix.de>
2019-11-11 13:32 ` [PATCH 2/4] pwm: omap-dmtimer: simplify error handling Markus Elfring
2019-11-11 20:08 ` Uwe Kleine-König
2019-11-11 21:30 ` Markus Elfring
[not found] ` <20191111090357.13903-3-u.kleine-koenig@pengutronix.de>
2019-11-11 13:41 ` [PATCH 3/4] pwm: omap-dmtimer: put_device() after of_find_device_by_node() Markus Elfring
2019-11-11 20:09 ` Uwe Kleine-König
2019-11-11 21:38 ` [3/4] " Markus Elfring
2019-11-11 21:46 ` Uwe Kleine-König
2019-11-12 7:40 ` Markus Elfring
[not found] ` <20191111090357.13903-4-u.kleine-koenig@pengutronix.de>
2019-11-11 13:47 ` [PATCH 4/4] pwm: omap-dmtimer: Allow compiling with COMPILE_TEST Markus Elfring
2019-11-11 13:47 ` Markus Elfring
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=20191111200005.c37mecp44idxskjq@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=Markus.Elfring@web.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pwm@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=neilb@suse.de \
--cc=thierry.reding@gmail.com \
/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).