From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753606Ab2EYGFE (ORCPT ); Fri, 25 May 2012 02:05:04 -0400 Received: from cantor2.suse.de ([195.135.220.15]:56749 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803Ab2EYGFB (ORCPT ); Fri, 25 May 2012 02:05:01 -0400 Date: Fri, 25 May 2012 08:04:56 +0200 Message-ID: From: Takashi Iwai To: Devendra Naga Cc: Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [emu10k1]: remove the kcallloc cast (reported from make coccicheck's drop_kmalloc_cast.cocci) In-Reply-To: <1337868149-17783-1-git-send-email-devendra.aaru@gmail.com> References: <1337868149-17783-1-git-send-email-devendra.aaru@gmail.com> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At Thu, 24 May 2012 19:32:29 +0530, Devendra Naga wrote: > > Signed-off-by: Devendra Naga I don't think removing it improves anything much. It's cast to __user pointer, and this rather helps to catch the caution. thanks, Takashi > --- > sound/pci/emu10k1/emufx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c > index dae4050..272f8ac 100644 > --- a/sound/pci/emu10k1/emufx.c > +++ b/sound/pci/emu10k1/emufx.c > @@ -1815,7 +1815,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) > > if ((icode = kzalloc(sizeof(*icode), GFP_KERNEL)) == NULL) > return -ENOMEM; > - if ((icode->gpr_map = (u_int32_t __user *) > + if ((icode->gpr_map = > kcalloc(256 + 160 + 160 + 2 * 512, sizeof(u_int32_t), > GFP_KERNEL)) == NULL || > (controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, > -- > 1.7.9.5 >