From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-serial@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>, Pat Gefre <pfg@sgi.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 1/3] serial: ioc4: Delete error messages for a failed memory allocation in two functions
Date: Fri, 8 Dec 2017 22:51:15 +0100 [thread overview]
Message-ID: <d3a28c8f-b997-6f5c-8a08-d02d7ef3648f@users.sourceforge.net> (raw)
In-Reply-To: <514232dd-7e91-00f9-b95c-3e8f740090ca@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 22:15:53 +0100
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc4_serial.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index db5b979e5a0c..9524a6d3e1d8 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1076,11 +1076,9 @@ static inline int ioc4_attach_local(struct ioc4_driver_data *idd)
for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
port_number++) {
port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
- if (!port) {
- printk(KERN_WARNING
- "IOC4 serial memory not available for port\n");
+ if (!port)
goto free;
- }
+
spin_lock_init(&port->ip_lock);
/* we need to remember the previous ones, to point back to
@@ -2815,8 +2813,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
if (!control) {
- printk(KERN_WARNING "ioc4_attach_one"
- ": unable to get memory for the IOC4\n");
ret = -ENOMEM;
goto out2;
}
@@ -2825,9 +2821,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
/* Allocate the soft structure */
soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
if (!soft) {
- printk(KERN_WARNING
- "ioc4 (%p): unable to get memory for the soft struct\n",
- (void *)idd->idd_pdev);
ret = -ENOMEM;
goto out3;
}
--
2.15.1
next prev parent reply other threads:[~2017-12-08 21:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-08 21:50 [PATCH 0/3] tty/serial/ioc4: Adjustments for four function implementations SF Markus Elfring
2017-12-08 21:51 ` SF Markus Elfring [this message]
2017-12-08 21:52 ` [PATCH 2/3] serial: ioc4: Improve four size determinations SF Markus Elfring
2017-12-08 21:53 ` [PATCH 3/3] serial: ioc4: Adjust three function calls together with a variable assignment SF 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=d3a28c8f-b997-6f5c-8a08-d02d7ef3648f@users.sourceforge.net \
--to=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=pfg@sgi.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).