From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivas Pandruvada Subject: Re: [PATCH -next] HID: intel_ish-hid: Use kzalloc instead of kmalloc/memset Date: Fri, 26 Aug 2016 11:52:20 -0700 Message-ID: <1472237540.2694.1.camel@linux.intel.com> References: <1471793450-24245-1-git-send-email-weiyj.lk@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Return-path: Received: from mga07.intel.com ([134.134.136.100]:4991 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751779AbcHZTFe (ORCPT ); Fri, 26 Aug 2016 15:05:34 -0400 In-Reply-To: <1471793450-24245-1-git-send-email-weiyj.lk@gmail.com> Sender: linux-input-owner@vger.kernel.org List-Id: linux-input@vger.kernel.org To: Wei Yongjun , Jiri Kosina , Benjamin Tissoires Cc: linux-input@vger.kernel.org On Sun, 2016-08-21 at 15:30 +0000, Wei Yongjun wrote: > Use kzalloc rather than kmalloc followed by memset with 0. > > Generated by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci > > Signed-off-by: Wei Yongjun Acked-by: Srinivas Pandruvada > --- >  drivers/hid/intel-ish-hid/ishtp/client-buffers.c | 3 +-- >  1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c > b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c > index 3f5ce5e..b9b917d 100644 > --- a/drivers/hid/intel-ish-hid/ishtp/client-buffers.c > +++ b/drivers/hid/intel-ish-hid/ishtp/client-buffers.c > @@ -73,11 +73,10 @@ int ishtp_cl_alloc_tx_ring(struct ishtp_cl *cl) >   for (j = 0; j < cl->tx_ring_size; ++j) { >   struct ishtp_cl_tx_ring *tx_buf; >   > - tx_buf = kmalloc(sizeof(struct ishtp_cl_tx_ring), > GFP_KERNEL); > + tx_buf = kzalloc(sizeof(struct ishtp_cl_tx_ring), > GFP_KERNEL); >   if (!tx_buf) >   goto out; >   > - memset(tx_buf, 0, sizeof(struct ishtp_cl_tx_ring)); >   tx_buf->send_buf.data = kmalloc(len, GFP_KERNEL); >   if (!tx_buf->send_buf.data) { >   kfree(tx_buf); > > >