From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:6f8:1178:4:290:27ff:fe1d:cc33]) by canuck.infradead.org with esmtps (Exim 4.72 #1 (Red Hat Linux)) id 1Q8Co7-0000ry-9a for barebox@lists.infradead.org; Fri, 08 Apr 2011 14:37:14 +0000 From: Sascha Hauer Date: Fri, 8 Apr 2011 16:36:59 +0200 Message-Id: <1302273422-6987-14-git-send-email-s.hauer@pengutronix.de> In-Reply-To: <1302273422-6987-1-git-send-email-s.hauer@pengutronix.de> References: <1302273422-6987-1-git-send-email-s.hauer@pengutronix.de> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 13/16] serial 16550: use xzalloc To: barebox@lists.infradead.org No need to check for the result and increases the chance that we build a binary without the rarely used calloc function. Signed-off-by: Sascha Hauer --- drivers/serial/serial_ns16550.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c index 290619f..ab172e7 100644 --- a/drivers/serial/serial_ns16550.c +++ b/drivers/serial/serial_ns16550.c @@ -211,9 +211,7 @@ static int ns16550_probe(struct device_d *dev) if ((plat->reg_read == NULL) || (plat->reg_write == NULL)) return -EINVAL; - cdev = calloc(1, sizeof(struct console_device)); - if (cdev == NULL) - return -ENOMEM; + cdev = xzalloc(sizeof(*cdev)); dev->type_data = cdev; cdev->dev = dev; -- 1.7.2.3 _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox