From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753654AbcG0INo (ORCPT ); Wed, 27 Jul 2016 04:13:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:37604 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752044AbcG0INg (ORCPT ); Wed, 27 Jul 2016 04:13:36 -0400 Message-ID: <1469606944.2408.0.camel@suse.com> Subject: Re: [PATCH v2 03/22] usb: serial: ti_usb_3410_5052: Use kzalloc instead of kmalloc From: Oliver Neukum To: Mathieu OTHACEHE Cc: johan@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Wed, 27 Jul 2016 10:09:04 +0200 In-Reply-To: <20160726180002.2398-4-m.othacehe@gmail.com> References: <20160726180002.2398-1-m.othacehe@gmail.com> <20160726180002.2398-4-m.othacehe@gmail.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.11 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2016-07-26 at 19:59 +0200, Mathieu OTHACEHE wrote: > Use kzalloc instead of kmalloc to avoid field initialisation to 0. > > Signed-off-by: Mathieu OTHACEHE > --- > drivers/usb/serial/ti_usb_3410_5052.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c > index 50a74b3..b694d69 100644 > --- a/drivers/usb/serial/ti_usb_3410_5052.c > +++ b/drivers/usb/serial/ti_usb_3410_5052.c > @@ -969,7 +969,7 @@ static void ti_set_termios(struct tty_struct *tty, > if (tport == NULL) > return; > > - config = kmalloc(sizeof(*config), GFP_KERNEL); > + config = kzalloc(sizeof(*config), GFP_KERNEL); > if (!config) > return; > Hi, in that case, where is the initialisation to 0 you avoid and hence can remove from the code? Regards Oliver