From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: pakki001@umn.edu, Nicolas Ferre <nicolas.ferre@microchip.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Ludovic Desroches <ludovic.desroches@microchip.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] atmel: fix a missing check of clk_prepare
Date: Wed, 26 Dec 2018 09:32:24 +0100 [thread overview]
Message-ID: <20181226083224.GR2188@piout.net> (raw)
In-Reply-To: <20181226025405.72480-1-kjlu@umn.edu>
Hi,
On 25/12/2018 20:54:05-0600, Kangjie Lu wrote:
> clk_prepare() could fail, so let's check its status, and if it fails,
> issue an error message.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
> drivers/misc/atmel-ssc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
> index d8e3cc2dc747..9e69d0585f49 100644
> --- a/drivers/misc/atmel-ssc.c
> +++ b/drivers/misc/atmel-ssc.c
> @@ -60,7 +60,8 @@ struct ssc_device *ssc_request(unsigned int ssc_num)
> ssc->user++;
> spin_unlock(&user_lock);
>
> - clk_prepare(ssc->clk);
> + if (clk_prepare(ssc->clk))
> + pr_err("ssc: failed to prepare clk.\n");
>
There is no point in adding this check and yet another string to please
a static analysis tool. This is especially true because clk_prepare will
never actually fail else you wouldn't reach this code anyway.
--
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
prev parent reply other threads:[~2018-12-26 8:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-26 2:54 [PATCH] atmel: fix a missing check of clk_prepare Kangjie Lu
2018-12-26 8:32 ` Alexandre Belloni [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=20181226083224.GR2188@piout.net \
--to=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=kjlu@umn.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
--cc=nicolas.ferre@microchip.com \
--cc=pakki001@umn.edu \
/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