From patchwork Tue Jan 24 16:07:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 9535917 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 126AE6042D for ; Tue, 24 Jan 2017 21:36:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0457C26E76 for ; Tue, 24 Jan 2017 21:36:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C8C26E96; Tue, 24 Jan 2017 21:36:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 073FC26E76 for ; Tue, 24 Jan 2017 21:36:06 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6D172266CC8; Tue, 24 Jan 2017 22:36:05 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C91A1266A74; Tue, 24 Jan 2017 22:33:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id A3C90266D45; Tue, 24 Jan 2017 17:07:57 +0100 (CET) Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by alsa0.perex.cz (Postfix) with ESMTP id F32F0266D09 for ; Tue, 24 Jan 2017 17:07:55 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.33,278,1477954800"; d="scan'208";a="210711020" Received: from vaio-julia.rsr.lip6.fr ([132.227.76.33]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2017 17:07:54 +0100 Date: Tue, 24 Jan 2017 17:07:48 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Jerome Anand Message-ID: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, tiwai@suse.de, intel-gfx@lists.freedesktop.org, broonie@kernel.org, rakesh.a.ughreja@intel.com, kbuild-all@01.org Subject: [alsa-devel] [PATCH] ALSA: x86: hdmi: fix returnvar.cocci warnings X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Remove unneeded variable used to store return value. Generated by: scripts/coccinelle/misc/returnvar.cocci CC: Jerome Anand Signed-off-by: Julia Lawall Signed-off-by: Fengguang Wu --- In-Reply-To: <20170124225753.9045-5-jerome.anand@intel.com> url: https://github.com/0day-ci/linux/commits/Jerome-Anand/Add-support-for-Legacy -HDMI-audio-drivers/20170124-213547 This is probably not the right patch. It si just what the rule generates. Instead, I guess that retval should be updated in some way? intel_hdmi_audio_if.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) --- a/sound/x86/intel_hdmi_audio_if.c +++ b/sound/x86/intel_hdmi_audio_if.c @@ -239,7 +239,6 @@ static inline int had_chk_intrmiss(struc int had_process_buffer_done(struct snd_intelhad *intelhaddata) { - int retval = 0; u32 len = 1; enum intel_had_aud_buf_type buf_id; enum intel_had_aud_buf_type buff_done; @@ -258,7 +257,7 @@ int had_process_buffer_done(struct snd_i if (intelhaddata->drv_status == HAD_DRV_DISCONNECTED) { spin_unlock_irqrestore(&intelhaddata->had_spinlock, flag_irqs); pr_err("%s:Device already disconnected\n", __func__); - return retval; + return 0; } buf_id = intelhaddata->curr_buf; intelhaddata->buff_done = buf_id; @@ -280,7 +279,7 @@ int had_process_buffer_done(struct snd_i if (!intr_count || (intr_count > 3)) { pr_err("HAD SW state in non-recoverable!!! mode\n"); pr_err("Already played stale data\n"); - return retval; + return 0; } buf_id += (intr_count - 1); buf_id = buf_id % 4; @@ -298,7 +297,7 @@ int had_process_buffer_done(struct snd_i if (had_get_hwstate(intelhaddata)) { pr_err("HDMI cable plugged-out\n"); - return retval; + return 0; } /*Reprogram the registers with addr and length*/ @@ -322,12 +321,11 @@ int had_process_buffer_done(struct snd_i stream->period_elapsed(stream->had_substream); } - return retval; + return 0; } int had_process_buffer_underrun(struct snd_intelhad *intelhaddata) { - int retval = 0; enum intel_had_aud_buf_type buf_id; struct pcm_stream_info *stream; struct had_pvt_data *had_stream; @@ -355,7 +353,7 @@ int had_process_buffer_underrun(struct s if (drv_status == HAD_DRV_DISCONNECTED) { pr_err("%s:Device already disconnected\n", __func__); - return retval; + return 0; } if (stream_type == HAD_RUNNING_STREAM) { @@ -364,12 +362,11 @@ int had_process_buffer_underrun(struct s stream->period_elapsed(stream->had_substream); } - return retval; + return 0; } int had_process_hot_plug(struct snd_intelhad *intelhaddata) { - int retval = 0; enum intel_had_aud_buf_type buf_id; struct snd_pcm_substream *substream; struct had_pvt_data *had_stream; @@ -384,7 +381,7 @@ int had_process_hot_plug(struct snd_inte if (intelhaddata->drv_status == HAD_DRV_CONNECTED) { pr_debug("Device already connected\n"); spin_unlock_irqrestore(&intelhaddata->had_spinlock, flag_irqs); - return retval; + return 0; } buf_id = intelhaddata->curr_buf; intelhaddata->buff_done = buf_id; @@ -422,12 +419,12 @@ int had_process_hot_plug(struct snd_inte had_build_channel_allocation_map(intelhaddata); - return retval; + return 0; err: pm_runtime_disable(intelhaddata->dev); intelhaddata->dev = NULL; - return retval; + return 0; } int had_process_hot_unplug(struct snd_intelhad *intelhaddata)