Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2811995ybi; Thu, 4 Jul 2019 20:02:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqwv53SpdEc3Qak3TrEGIIFeGZ9ResnRnWbj9xBasttelpB7GWRfaQzg/gb1A105fYEODNbX X-Received: by 2002:a65:62c4:: with SMTP id m4mr1898622pgv.243.1562295757701; Thu, 04 Jul 2019 20:02:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562295757; cv=none; d=google.com; s=arc-20160816; b=cQzk+OV7sXSuNx1vvQ+/QgO2sXVEjK+bdV6t/VCu6pe9Zg3dDLPWIcv1mI7q+GkJdI iC17qFPdTKpcFKjhOK3IVIwWofIZ/9PHy4Tp9V02oPWbjjaL+usyKGNJ4kFMxZuvpoDn xpUi/s8gDPsvUDp6JWX0ufTgLBMoHysVU8pHnvstGrYftOWXgiS9zUNJ934mDgFUpo9o y7s1z82zuYSglvdF+r7cVgUDUuNal5xRF/Rzn3NXp9EylxbTGddyseNwOV35R3+Sq8se RT0tlMoOclIohGxdgubEoTnJG4ZbyES1E2A0DW+HUZ7rBbpSm+24u/aABP7LjYfIga4P RWuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:to:from:date:dkim-signature; bh=69PbiH2nDR6ENHSGX1SX7mzvg/IBEPNGwMUur8Ydn8Y=; b=oD+9Kqr1RM2D061ysib1t5A/93npHdgC2buL4KkOXkhPsTLKBj785q/WFUxIg2UaB6 tRT6HHAys6XA+bhEP9he1vydGe+enX1FtjRUW34tF3PRmttcxYFcThAqkN3vsO75DnMH TOqwbCx6N+zIq8nUjhcmOxpYCUTOMQBB7UfPbVjX3CD+m7OrRx7fLMIkpC6B0LJF2xpy teicRbu8P5dCg1g59HLZfOOGzagI3MRCmbEEVXLCBzdNJsQlblMgO/qbaal87irHI98d 4SikP9cK//SfeQKlNrzDfXAh4SFbKMegCokrXh3M28K//RmvpiF5ZjR96IGSe9rOtH+H RIPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SqWT4LSE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i95si6448553plb.106.2019.07.04.20.02.22; Thu, 04 Jul 2019 20:02:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SqWT4LSE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727459AbfGEC5k (ORCPT + 99 others); Thu, 4 Jul 2019 22:57:40 -0400 Received: from mail-pl1-f196.google.com ([209.85.214.196]:39433 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbfGEC5k (ORCPT ); Thu, 4 Jul 2019 22:57:40 -0400 Received: by mail-pl1-f196.google.com with SMTP id b7so3878544pls.6 for ; Thu, 04 Jul 2019 19:57:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition :user-agent; bh=69PbiH2nDR6ENHSGX1SX7mzvg/IBEPNGwMUur8Ydn8Y=; b=SqWT4LSERE8Un8SWCqBPl/lVC2TctRHJRA1BoSQhQc5vj+N/jt/q4KhEf46vCMxZk3 V2gCn6rw1ZFYzREXuMI3pQIJO2pj0Gtxn/gaYGDp5uxhQHfUEpp2rfEq7R5uzFsPuC+z DHcAe8p5OcS5nbRZkEtbO6XOGTpo2/KPkIr0PGjiumUrEI8ZvaXXqn4cgRlAWBAOo6kW f5LsQpa1dPTVmIEwTxCA1fFRORx0oimeDAh4JH0HRjHD/kBF3YvCaukTg9u1mkTurrBK ekUnp0wg57nyKXmbNvF6cfZMzKbcyU5hv7Bn5bOgRosNcvTUnMeu0N1IBF7wWvwtQm5m E7aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=69PbiH2nDR6ENHSGX1SX7mzvg/IBEPNGwMUur8Ydn8Y=; b=odwfVR3+Z8udJlwEXI4qAg2pGbPOf32GLLUfqTxVNhoPvMe7Ceyn1ejfirMaq3OeXD T0cEl5y6VxWTtSVx9lqSBusuBMjCQ0eZ5Okkq8Ob2S/EOcGqqPEdCAgZZE9VcnbeVLuf X2I8rpih/n2FC/NftStq7VwHL6TLIWujF4PS/dOIArf/0RVBX3q5lCZTpG7XKjWcvsZn lxVLpOQWB0cWwkNvlOoCYNQnRX46pzm/N63FC1kFlp0YA1rH4mV8PfSUAHDYZP8ojKTV E5odkALkU4qTHxXXb5DOpXNx2zxlJkrFCRuiT0xHjtY3papCaHjiHZEBMdmlDZMQhn4j idJA== X-Gm-Message-State: APjAAAU7a4cJJ5srNsDSd/E0beul3yqJPH6BRqfS/RJZgAHQq/lEkvc+ H08JIQJzNY5Uimu7A96w3Yw= X-Received: by 2002:a17:902:e613:: with SMTP id cm19mr1648503plb.299.1562295459717; Thu, 04 Jul 2019 19:57:39 -0700 (PDT) Received: from hari-Inspiron-1545 ([183.83.81.29]) by smtp.gmail.com with ESMTPSA id h14sm5944246pgn.51.2019.07.04.19.57.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 19:57:39 -0700 (PDT) Date: Fri, 5 Jul 2019 08:27:33 +0530 From: Hariprasad Kelam To: Jaroslav Kysela , Takashi Iwai , Richard Fontana , Colin Ian King , Hariprasad Kelam , Allison Randal , Thomas Gleixner , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] sound: pci: asihpi: Remove unneeded variable change Message-ID: <20190705025733.GA26285@hari-Inspiron-1545> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org this patch fixes below issue reported by coccicheck sound/pci/asihpi/asihpi.c:1558:5-11: Unneeded variable: "change". Return "1" on line 1564 Signed-off-by: Hariprasad Kelam --- sound/pci/asihpi/asihpi.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index e7234f3..2a21a3d 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -1519,7 +1519,6 @@ static int snd_asihpi_volume_get(struct snd_kcontrol *kcontrol, static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { - int change; u32 h_control = kcontrol->private_value; short an_gain_mB[HPI_MAX_CHANNELS]; @@ -1530,9 +1529,8 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, /* change = asihpi->mixer_volume[addr][0] != left || asihpi->mixer_volume[addr][1] != right; */ - change = 1; hpi_handle_error(hpi_volume_set_gain(h_control, an_gain_mB)); - return change; + return 1; } static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0); @@ -1555,13 +1553,12 @@ static int snd_asihpi_volume_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { u32 h_control = kcontrol->private_value; - int change = 1; /* HPI currently only supports all or none muting of multichannel volume ALSA Switch element has opposite sense to HPI mute: on==unmuted, off=muted */ int mute = ucontrol->value.integer.value[0] ? 0 : HPI_BITMASK_ALL_CHANNELS; hpi_handle_error(hpi_volume_set_mute(h_control, mute)); - return change; + return 1; } static int snd_asihpi_volume_add(struct snd_card_asihpi *asihpi, -- 2.7.4