From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754122AbdBVHAI (ORCPT ); Wed, 22 Feb 2017 02:00:08 -0500 Received: from mx2.suse.de ([195.135.220.15]:38124 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753327AbdBVHAA (ORCPT ); Wed, 22 Feb 2017 02:00:00 -0500 Date: Wed, 22 Feb 2017 07:59:57 +0100 Message-ID: From: Takashi Iwai To: "Tobin C. Harding" Cc: "Jaroslav Kysela" , , , Subject: Re: [PATCH] ALSA: emu10k1: Remove cast from memory allocation In-Reply-To: <1487746036-18181-1-git-send-email-me@tobin.cc> References: <1487746036-18181-1-git-send-email-me@tobin.cc> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.1 (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 On Wed, 22 Feb 2017 07:47:16 +0100, Tobin C. Harding wrote: > > Coccinelle emits multiple WARNING: casting value returned by memory allocation > function to (u_int32_t __user *) is useless. > > Remove unnecessary cast. > > Signed-off-by: Tobin C. Harding __user annotation requires the explicit cast. Takashi > --- > sound/pci/emu10k1/emufx.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c > index 56fc47b..8a39a6f 100644 > --- a/sound/pci/emu10k1/emufx.c > +++ b/sound/pci/emu10k1/emufx.c > @@ -1186,8 +1186,8 @@ static int _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu) > if (!icode) > return err; > > - icode->gpr_map = (u_int32_t __user *) kcalloc(512 + 256 + 256 + 2 * 1024, > - sizeof(u_int32_t), GFP_KERNEL); > + icode->gpr_map = kcalloc(512 + 256 + 256 + 2 * 1024, > + sizeof(u_int32_t), GFP_KERNEL); > if (!icode->gpr_map) > goto __err_gpr; > controls = kcalloc(SND_EMU10K1_GPR_CONTROLS, > @@ -1824,8 +1824,8 @@ static int _snd_emu10k1_init_efx(struct snd_emu10k1 *emu) > if (!icode) > return err; > > - icode->gpr_map = (u_int32_t __user *) kcalloc(256 + 160 + 160 + 2 * 512, > - sizeof(u_int32_t), GFP_KERNEL); > + icode->gpr_map = kcalloc(256 + 160 + 160 + 2 * 512, > + sizeof(u_int32_t), GFP_KERNEL); > if (!icode->gpr_map) > goto __err_gpr; > > -- > 2.7.4 > >