From: "Jan Kundrát" <jan.kundrat@cesnet.cz>
To: SF Markus Elfring <elfring@users.sourceforge.net>
Cc: <linux-serial@vger.kernel.org>,
Alexander Shiyan <shc_work@mail.ru>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, LKML <linux-kernel@vger.kernel.org>,
<kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
Date: Fri, 08 Dec 2017 20:52:36 +0100 [thread overview]
Message-ID: <c5d3a5ff-5024-46fd-993c-05f18bada08b@cesnet.cz> (raw)
In-Reply-To: <4153838e-4796-537c-7b7f-98404d4f3481@users.sourceforge.net>
On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 8 Dec 2017 19:53:10 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/tty/serial/max310x.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index ecb6513a6505..2aad36f402fd 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device
> *dev, struct max310x_devtype *devtype,
> /* Alloc port structure */
> s = devm_kzalloc(dev, sizeof(*s) +
> sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
> - if (!s) {
> - dev_err(dev, "Error allocating port structure\n");
> + if (!s)
> return -ENOMEM;
> - }
>
> clk_osc = devm_clk_get(dev, "osc");
> clk_xtal = devm_clk_get(dev, "xtal");
I'm looking at this patch because I'm also making some modifications to
this driver. This patch makes sense; other drivers also simply return
ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously
works :).
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
prev parent reply other threads:[~2017-12-08 20:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 19:00 SF Markus Elfring
2017-12-08 19:52 ` Jan Kundrát [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=c5d3a5ff-5024-46fd-993c-05f18bada08b@cesnet.cz \
--to=jan.kundrat@cesnet.cz \
--cc=elfring@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=shc_work@mail.ru \
/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
all inboxes | Powered by JetHome®