From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEDBBC28CF6 for ; Wed, 1 Aug 2018 13:14:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 70542208A4 for ; Wed, 1 Aug 2018 13:14:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70542208A4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389411AbeHAPAJ (ORCPT ); Wed, 1 Aug 2018 11:00:09 -0400 Received: from mx2.suse.de ([195.135.220.15]:37716 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2389283AbeHAPAI (ORCPT ); Wed, 1 Aug 2018 11:00:08 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BAB1AACAD; Wed, 1 Aug 2018 13:14:22 +0000 (UTC) Date: Wed, 01 Aug 2018 15:14:22 +0200 Message-ID: From: Takashi Iwai To: "Walter Harms" Cc: , "Jaya Kumar" , "Jaroslav Kysela" , , Subject: Re: [PATCH 3/9] ALSA: emu10k1: remove redundant variable attn In-Reply-To: <220787354.139798.1533128625826@ox-groupware.bfs.de> References: <220787354.139798.1533128625826@ox-groupware.bfs.de> 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/26 (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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 01 Aug 2018 15:03:45 +0200, Walter Harms wrote: > > From: Colin Ian King > > Variable attn is being assigned but is never used hence it is > redundant and can be removed. > > Cleans up clang warning: > warning: variable 'attn' set but not used [-Wunused-but-set-variable] > > Signed-off-by: Colin Ian King > --- > sound/pci/emu10k1/emupcm.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c > index 69f9b100bd24..26f6eda3e766 100644 > --- a/sound/pci/emu10k1/emupcm.c > +++ b/sound/pci/emu10k1/emupcm.c > @@ -290,7 +290,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 > *emu, > struct snd_pcm_runtime *runtime = substream->runtime; > unsigned int silent_page, tmp; > int voice, stereo, w_16; > - unsigned char attn, send_amount[8]; > + unsigned char send_amount[8]; > unsigned char send_routing[8]; > unsigned long flags; > unsigned int pitch_target; > @@ -313,7 +313,6 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 > *emu, > /* volume parameters */ > if (extra) { > - attn = 0; > memset(send_routing, 0, sizeof(send_routing)); > send_routing[0] = 0; > send_routing[1] = 1; > > > IMHO, this code is a bit fishy. > The memset() sould go in the init section > and in the else branch tmp is set, maybe its an idea > to set it here also (for symmetry) What does it have to do with this patch...? The code there is OK, although it could be a bit optimized with a static array for the fixed routing. But it's pretty minor and it's no hot path, so no need to bother complicating things. thanks, Takashi